From 4dae2cd4dc7f896bcbc8dd9bc3cb3c456ff6e672 Mon Sep 17 00:00:00 2001 From: Shailaja kumari Date: Wed, 8 Nov 2023 12:15:38 +0530 Subject: [PATCH] updated callback frequency --- btrfs_plugin.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/btrfs_plugin.py b/btrfs_plugin.py index 87eb84b..b1a2f76 100644 --- a/btrfs_plugin.py +++ b/btrfs_plugin.py @@ -5,7 +5,7 @@ import collectd PLUGIN = 'btrfs' TYPE_STATS = "device_stats" - +INTERVAL = 600 def read_callback(): """Read Btrfs device information and dispatch values to collectd.""" @@ -24,11 +24,13 @@ def read_callback(): dev_info.path)[1:] for counter, value in stats.counters.items(): metric.type_instance = counter - metric.dispatch(TYPE_STATS, [value]) + metric.dispatch(TYPE_STATS, [value], interval=INTERVAL) except Exception as e: collectd.error("btrfs: read_callback: {}".format(e)) collectd.debug("btrfs: read done") if __name__ != "__main__": # Register callbacks - collectd.register_read(read_callback) + collectd.register_read(read_callback, INTERVAL) + +