Sha256: 4e1f2d194e2d91f103e7451bb332a77d38f9619f1afe52ca7f6378be60430b6f
Contents?: true
Size: 1.41 KB
Versions: 21
Compression:
Stored size: 1.41 KB
Contents
require 'rake' require 'rspec/core/rake_task' RSpec::Core::RakeTask.new(:spec) do |t| t.pattern = 'spec/*/*_spec.rb' end task :default => :spec desc "Run serverspec to all hosts" task :spec => 'serverspec:all' class ServerspecTask < RSpec::Core::RakeTask attr_accessor :target def spec_command cmd = super "env TARGET_HOST=#{target} #{cmd}" end end namespace :serverspec do %w(<%=@name%>).each do |profile| ServerspecTask.new(profile.to_sym) do |t| t.target = profile t.pattern = "spec/#{profile}/*_spec.rb" end end end <% if(@options[:bench_enable]) %> require 'gruff' require 'json' PLOTS = 'plots' namespace :plot do directory PLOTS task :hosts => [PLOTS] do hosts = IO.readlines('benchmark.json').map {|b| JSON.parse(b,{:symbolize_names => true }) }.group_by {|m| m[:host] } g = Gruff::Line.new g.title = 'All Hosts side by side' g.labels = Hash[hosts.keys.each_with_index.map {|i,h| [h , i]}] g.labels.each_pair {|i, l| g.data(l, hosts[l].map {|h| h[:total] }) } g.write("#{PLOTS}/all_hosts.png") end task :per_host => [PLOTS] do hosts = IO.readlines('benchmark.json').map {|b| JSON.parse(b,{:symbolize_names => true }) }.group_by {|m| m[:host] } hosts.each_pair {|h,data| g = Gruff::Line.new g.title = h g.labels = {0 => h} g.data(h, data.map {|d| d[:total] }) g.write("#{PLOTS}/#{h}.png") } end end <% end %>
Version data entries
21 entries across 21 versions & 1 rubygems