Created
December 12, 2012 08:00
-
-
Save dmytro/4265948 to your computer and use it in GitHub Desktop.
Revisions
-
dmytro revised this gist
Dec 12, 2012 . 1 changed file with 0 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +0,0 @@ -
dmytro revised this gist
Dec 12, 2012 . 1 changed file with 6 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,6 @@ :vb_active_num: :namespace: Wizcorp::Couchbase :class: BucketStats :function: :avg # :avg, :sum, :none :operator: :< :rag: [1024,1024,1025] -
dmytro created this gist
Dec 12, 2012 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ def rag rag = -1 res = @connection.send(@key[:name]).send(@key[:function].to_sym) thresholds = @key[:rag].reverse thresholds.each_index do |idx| val = thresholds[idx] rag = idx if res.send(@key[:operator].to_sym, val) end { :service_description => "#{@bucket}: #{@key[:name]}", :host_name => hostname, :plugin_output => res, :return_code => rag } end