Skip to content

Instantly share code, notes, and snippets.

@youyo
Created February 23, 2015 11:41
Show Gist options
  • Select an option

  • Save youyo/5f2e1c21a3149e9a4328 to your computer and use it in GitHub Desktop.

Select an option

Save youyo/5f2e1c21a3149e9a4328 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require 'gruff'
require 'json'
require 'yajl'
require 'pp'
giops = Gruff::Line.new
giops.title = "IOPS Result (bs=4k)"
giops.x_axis_label = 'IO depth'
giops.y_axis_label = 'IOPS'
giops.labels = {0 => '1', 1 => '2', 2 => '4', 3 => '8', 4 => '16', 5 => '32', 6 => '64'}
gbw = Gruff::Line.new
gbw.title = "BandWidth Result (bs=4k)"
gbw.x_axis_label = 'IO depth'
gbw.y_axis_label = 'BW KB/s'
gbw.labels = {0 => '1', 1 => '2', 2 => '4', 3 => '8', 4 => '16', 5 => '32', 6 => '64'}
Yajl::Parser.new.parse(STDIN) do |json|
giops.data(json["rwtype"], json["iops"])
gbw.data(json["rwtype"], json["bw"])
end
giops.write('./tmp/fio_result_iops.png')
gbw.write('./tmp/fio_result_bw.png')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment