bin/metrics-ioping.rb in sensu-plugins-io-checks-1.0.0 vs bin/metrics-ioping.rb in sensu-plugins-io-checks-1.0.1

- old
+ new

@@ -1,9 +1,9 @@ #! /usr/bin/env ruby # encoding: UTF-8 # -# ioping-metrics +# metrics-ioping # # DESCRIPTION: # Push ioping stats into graphite # # OUTPUT: @@ -15,12 +15,15 @@ # DEPENDENCIES: # gem: sensu-plugin # gem: socket # # USAGE: +# Collect IO metrics from /dev/sda +# metrics-ioping.rb -n sda -d /dev/sda # # NOTES: +# The ioping command must be installed # # LICENSE: # Copyright 2014 Mitsutoshi Aoe <maoe@foldr.in> # Released under the same terms as Sensu (the MIT license); see LICENSE # for details. @@ -92,11 +95,12 @@ stats = parse_0_6(str) if stats.nil? stats end NUMBER = /\d+(?:\.\d+)?/ - TIME_UNIT = /(?:us|ms|s|min|hour|day)/ + TIME_UNIT = /(?:ns|us|ms|s|min|hour|day)/ TIME_UNITS = { + 'ns' => 1e-9, 'us' => 1e-6, 'ms' => 1e-3, 's' => 1, 'min' => 60, 'hour' => 60 * 60,