Sha256: fafe799588e14de7f432fe50252b934713d3239d6b3d26fc9cb710f880c55123
Contents?: true
Size: 1.85 KB
Versions: 16
Compression:
Stored size: 1.85 KB
Contents
# -*- encoding: utf-8 -*- # An example to create complex graphs # require anyway require 'growthforecast-client' # Create a GrowthForecast Client, given he base URI of GrowthForecast client = GrowthForecast::Client.new('http://localhost:5125') # I gonna apply for all services/sections sections = client.list_section sections.each do |service_name, sections| sections.each do |section_name| # Make a complex graph from these graphs from_graphs= [ {"service_name" => service_name, "section_name" => section_name, "graph_name" => "<1sec_count", "gmode" => 'gauge', "stack" => true, "type" => 'AREA'}, {"service_name" => service_name, "section_name" => section_name, "graph_name" => "<2sec_count", "gmode" => 'gauge', "stack" => true, "type" => 'AREA'}, {"service_name" => service_name, "section_name" => section_name, "graph_name" => "<3sec_count", "gmode" => 'gauge', "stack" => true, "type" => 'AREA'}, {"service_name" => service_name, "section_name" => section_name, "graph_name" => "<4sec_count", "gmode" => 'gauge', "stack" => true, "type" => 'AREA'}, {"service_name" => service_name, "section_name" => section_name, "graph_name" => ">=4sec_count", "gmode" => 'gauge', "stack" => true, "type" => 'AREA'}, ] # The propety of a complex graph to create to_complex = { "service_name" => service_name, "section_name" => section_name, "graph_name" => "response_time_count", "description" => "response time count", "sort" => 10, } # Create a complex graph! begin puts "Setup /#{service_name}/#{section_name}/#{to_complex['graph_name']}" client.create_complex(from_graphs, to_complex) rescue GrowthForecast::AlreadyExists => e puts "\tclass:#{e.class}\t#{e.message}" rescue GrowthForecast::NotFound => e puts "\tclass:#{e.class}\t#{e.message}" end end end
Version data entries
16 entries across 16 versions & 1 rubygems