[gimp/gimp-2-10] app: add "compression" field to the swap dashboard group



commit 3ae8ff5c741f3bfac0d638abf53378ccbe6fbc29
Author: Ell <ell_se yahoo com>
Date:   Thu Aug 16 07:11:31 2018 -0400

    app: add "compression" field to the swap dashboard group
    
    The "compression" field reports the ratio between the total size of
    the data in the swap, and the total size the data would have had if
    all tiles in the swap occupied a unique data block.
    
    See GEGL commit 185f4450f2a51690b39112973c61f894c1ec3e41.
    
    (cherry picked from commit b6e552a74b0305a1ec4f3ff2abcfe44a20c84d6d)

 app/widgets/gimpdashboard.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
---
diff --git a/app/widgets/gimpdashboard.c b/app/widgets/gimpdashboard.c
index 766b82f81b..9a30996e58 100644
--- a/app/widgets/gimpdashboard.c
+++ b/app/widgets/gimpdashboard.c
@@ -105,6 +105,8 @@ typedef enum
   VARIABLE_SWAP_WRITTEN,
   VARIABLE_SWAP_WRITING,
 
+  VARIABLE_SWAP_COMPRESSION,
+
 #ifdef HAVE_CPU_GROUP
   /* cpu */
   VARIABLE_CPU_USAGE,
@@ -517,6 +519,16 @@ static const VariableInfo variables[] =
     .data             = GINT_TO_POINTER (VARIABLE_SWAP_WRITTEN)
   },
 
+  [VARIABLE_SWAP_COMPRESSION] =
+  { .name             = "swap-compression",
+    .title            = NC_("dashboard-variable", "Compression"),
+    .description      = N_("Swap compression ratio"),
+    .type             = VARIABLE_TYPE_SIZE_RATIO,
+    .sample_func      = gimp_dashboard_sample_gegl_stats,
+    .data             = "swap-total\0"
+                        "swap-total-uncloned"
+  },
+
 
 #ifdef HAVE_CPU_GROUP
   /* cpu variables */
@@ -688,6 +700,12 @@ static const GroupInfo groups[] =
                             .meter_value      = 1
                           },
 
+                          { VARIABLE_SEPARATOR },
+
+                          { .variable         = VARIABLE_SWAP_COMPRESSION,
+                            .default_active   = FALSE
+                          },
+
                           {}
                         }
   },


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]