From 4f5234d6cb705a123082271c129567820e466982 Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Tue, 20 Mar 2012 22:39:39 +0100 Subject: [PATCH] zfs_arc plugin: Introduce the single-valued "mutex_operation" type. --- src/types.db | 2 +- src/zfs_arc.c | 14 ++------------ 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/src/types.db b/src/types.db index d818b937..4d3951b1 100644 --- a/src/types.db +++ b/src/types.db @@ -95,7 +95,7 @@ memcached_octets rx:DERIVE:0:U, tx:DERIVE:0:U memcached_ops value:DERIVE:0:U memory value:GAUGE:0:281474976710656 multimeter value:GAUGE:U:U -mutex mutex_miss:COUNTER:0:U +mutex_operations value:DERIVE:0:U mysql_commands value:DERIVE:0:U mysql_handler value:DERIVE:0:U mysql_locks value:DERIVE:0:U diff --git a/src/zfs_arc.c b/src/zfs_arc.c index 8b4c7885..12f32866 100644 --- a/src/zfs_arc.c +++ b/src/zfs_arc.c @@ -75,15 +75,6 @@ static void za_submit_ratio (const char* type_instance, gauge_t hits, gauge_t mi za_submit_gauge ("cache_ratio", type_instance, ratio); } -static void za_submit_mutex_counts (derive_t mutex_miss) -{ - value_t values[1]; - - values[0].counter = mutex_miss; - - za_submit ("mutex", "counts", values, STATIC_ARRAY_SIZE(values)); -} - static void za_submit_deleted_counts (derive_t deleted) { value_t values[1]; @@ -134,7 +125,8 @@ static int za_read (void) za_submit_gauge ("cache_size", "arc", arc_size); za_submit_gauge ("cache_size", "L2", l2_size); - mutex_miss = get_kstat_value(ksp, "mutex_miss"); + mutex_miss = get_kstat_value (ksp, "mutex_miss"); + za_submit_derive ("mutex_operation", "miss", mutex_miss); deleted = get_kstat_value(ksp, "deleted"); @@ -184,8 +176,6 @@ static int za_read (void) za_submit ("io_octets", "L2", l2_io, /* num values = */ 2); - za_submit_mutex_counts (mutex_miss); - za_submit_deleted_counts (deleted); za_submit_hash_counts (deleted); -- 2.30.2