Sha256: e082693dd6be26e272f865284263f28c743e261eb0920a8cb85db696d35bdb38

Contents?: true

Size: 1.06 KB

Versions: 3

Compression:

Stored size: 1.06 KB

Contents

require 'pulse-meter/visualizer'

module PulseToolbox::Server
  class Monitoring < PulseMeter::Visualize::App
    def initialize
      super(layout)
    end

    def layout
      PulseToolbox::Sensor::Manager.layout do |l|
        l.use_utc false

        l.outlier_color '#FF0000'

        l.highchart_options({
          x_axis: {
            min_padding: 0,
            max_padding: 0
          }
        })

        l.page "Requests" do |p|
          
          PulseToolbox::Sensor::Manager.each_group_with_title do |group, title|
            p.spline title do |w|
              PulseToolbox::Sensor::Manager.each_sensor_in_group(group) do |s|
                w.sensor s.name, :color => s.color
              end

              w.timespan 60 * 60 * 3
              w.redraw_interval 10

              w.show_last_point true
              w.values_label "Time"
              w.width 10
            end
          end

          p.highchart_options({
            tooltip: {
              value_decimals: 0
            }
          })
        end
      end.to_layout
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
pulse-meter-rails-0.1.1 lib/pulse_toolbox/server/monitoring.rb
pulse-meter-rails-0.1.0 lib/pulse_toolbox/server/monitoring.rb
pulse-meter-rails-0.0.1 lib/pulse_toolbox/server/monitoring.rb