lib/riemann/babbler/plugins/nginx.rb in riemann-babbler-2.0.0 vs lib/riemann/babbler/plugins/nginx.rb in riemann-babbler-2.0.1
- old
+ new
@@ -16,10 +16,10 @@
def collect
status = Array.new
lines = rest_get(plugin.status_url).split("\n")
lines[2].scan(/\d+/).each_with_index do |value, index|
- status << { :service => plugin.service + " #{NGINX_STATUS_1[index]}", :metric => value.to_i, :as_diff => true }
+ status << { :service => plugin.service + " #{NGINX_STATUS_1[index]}", :metric => value.to_f/plugin.interval, :as_diff => true }
end
# line[0]: Active connections: XXXX
status << { :service => plugin.service + ' active', :metric => lines[0].split(':')[1].strip.to_i }
# lines[3]: Reading: 0 Writing: 1 Waiting: 0
lines[3].scan(/\d+/).each_with_index do |value, index|