From e8291c754f4570a33a671d3ea8fed9a21638b275 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Sun, 20 Jan 2019 15:19:39 +0100 Subject: [PATCH] + Fix cassandra cache mode --- database/cassandra/jmx/mode/cachesusage.pm | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/database/cassandra/jmx/mode/cachesusage.pm b/database/cassandra/jmx/mode/cachesusage.pm index 5be004f71..ac52ed3bc 100644 --- a/database/cassandra/jmx/mode/cachesusage.pm +++ b/database/cassandra/jmx/mode/cachesusage.pm @@ -30,7 +30,7 @@ sub set_counters { my ($self, %options) = @_; $self->{maps_counters_type} = [ - { name => 'ccache', type => 1, cb_prefix_output => 'prefix_ccache_output', skipped_code => { -10 => 1 } }, + { name => 'ccache', type => 1, cb_prefix_output => 'prefix_ccache_output', message_multiple => 'All caches are ok', skipped_code => { -10 => 1 } }, ]; $self->{maps_counters}->{ccache} = [ @@ -41,16 +41,17 @@ sub set_counters { threshold_use => 'prct_used', perfdatas => [ { label => 'used', value => 'prct_used', template => '%.2f', - unit => '%', min => 0, max => 100, label_extra_instance => 1, instance_use => 'display_absolute' }, + unit => '%', min => 0, max => 100, label_extra_instance => 1, instance_use => 'display' }, ], } }, { label => 'hits', set => { key_values => [ { name => 'Requests_Count', diff => 1 }, { name => 'Hits_Count', diff => 1 }, { name => 'display' } ], closure_custom_calc => $self->can('custom_hits_calc'), - output_template => 'Hits = %.2f %%', output_use => 'hits_prct', threshold_use => 'prct_used', + output_template => 'Hits = %.2f %%', output_use => 'hits_prct', threshold_use => 'hits_prct', perfdatas => [ - { label => 'hits', value => 'hits_prct', template => '%.2f', min => 0, max => 100, unit => '%' }, + { label => 'hits', value => 'hits_prct', template => '%.2f', min => 0, max => 100, + unit => '%', label_extra_instance => 1, instance_use => 'display' }, ], } }, @@ -87,7 +88,7 @@ sub custom_usage_calc { sub custom_hits_calc { my ($self, %options) = @_; - my $label = $options{extra_options}->{label_ref}; + $self->{result_values}->{display} = $options{new_datas}->{$self->{instance} . '_display'}; my $delta_value = $options{new_datas}->{$self->{instance} . '_Hits_Count'} - $options{old_datas}->{$self->{instance} . '_Hits_Count'}; my $delta_total = $options{new_datas}->{$self->{instance} . '_Requests_Count'} - $options{old_datas}->{$self->{instance} . '_Requests_Count'};