=item B<ReportBytes> B<false>|B<true>
When enabled, the I<swap I/O> is reported in bytes. When disabled, the default,
-I<swap I/O> is reported in pages. This option is available under Linux only.
+I<swap I/O> is reported in pages. This option is available under Linux and
+NetBSD only.
-=item B<ValuesAbsolute> B<true>|B<false>
+=item B<ReportUsage> B<true>|B<false>
Enables or disables reporting of absolute swap metrics, i.e. number of I<bytes>
available and used. Defaults to B<true>.
-=item B<ValuesPercentage> B<false>|B<true>
+=item B<ReportUtilization> B<false>|B<true>
-Enables or disables reporting of relative swap metrics, i.e. I<percent>
-available and free. Defaults to B<false>.
+Enables or disables reporting of relative swap metrics, i.e. the ratio of used
+and free swap space. Defaults to B<false>.
This is useful for deploying I<collectd> in a heterogeneous environment, where
swap sizes differ and you want to specify generic thresholds or similar.
#error "No applicable input method."
#endif /* HAVE_LIBSTATGRAB */
-static bool values_absolute = true;
-static bool values_percentage;
+static bool report_usage = true;
+static bool report_utilization;
static bool report_io = true;
static char const *const label_device = "system.device";
"is not supported on this platform. "
"The option is going to be ignored.");
#endif /* SWAP_HAVE_REPORT_BY_DEVICE */
- else if (strcasecmp("ValuesAbsolute", child->key) == 0)
- cf_util_get_boolean(child, &values_absolute);
- else if (strcasecmp("ValuesPercentage", child->key) == 0)
- cf_util_get_boolean(child, &values_percentage);
+ /* ValuesAbsolute and ValuesPercentage are for collectd 5 compatibility. */
+ else if (strcasecmp("ReportUsage", child->key) == 0 ||
+ strcasecmp("ValuesAbsolute", child->key) == 0)
+ cf_util_get_boolean(child, &report_usage);
+ else if (strcasecmp("ReportUtilization", child->key) == 0 ||
+ strcasecmp("ValuesPercentage", child->key) == 0)
+ cf_util_get_boolean(child, &report_utilization);
else if (strcasecmp("ReportIO", child->key) == 0)
cf_util_get_boolean(child, &report_io);
else
bool have_other = (other_name != NULL) && !isnan(other);
- if (values_absolute) {
+ if (report_usage) {
if (have_other) {
metric_family_append(fam_usage, label_state, other_name,
(value_t){.gauge = other}, &m);
(value_t){.gauge = free}, &m);
}
- if (values_percentage) {
+ if (report_utilization) {
gauge_t total = used + free;
if (have_other) {
total += other;