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.
This commit is contained in:
Ell 2018-08-16 07:11:31 -04:00
parent 8313a40fb5
commit b6e552a74b
1 changed files with 18 additions and 0 deletions

View File

@ -104,6 +104,8 @@ typedef enum
VARIABLE_SWAP_WRITTEN,
VARIABLE_SWAP_WRITING,
VARIABLE_SWAP_COMPRESSION,
#ifdef HAVE_CPU_GROUP
/* cpu */
VARIABLE_CPU_USAGE,
@ -510,6 +512,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 */
@ -681,6 +693,12 @@ static const GroupInfo groups[] =
.meter_value = 1
},
{ VARIABLE_SEPARATOR },
{ .variable = VARIABLE_SWAP_COMPRESSION,
.default_active = FALSE
},
{}
}
},