Class: RailsPerformance::SystemMonitor::ResourceChart

Inherits:
Struct
  • Object
show all
Defined in:
lib/rails_performance/system_monitor/resource_chart.rb

Direct Known Subclasses

CPULoad, DiskUsage, MemoryUsage

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#descriptionObject

Returns the value of attribute description

Returns:

  • (Object)

    the current value of description



3
4
5
# File 'lib/rails_performance/system_monitor/resource_chart.rb', line 3

def description
  @description
end

#keyObject

Returns the value of attribute key

Returns:

  • (Object)

    the current value of key



3
4
5
# File 'lib/rails_performance/system_monitor/resource_chart.rb', line 3

def key
  @key
end

#legendObject

Returns the value of attribute legend

Returns:

  • (Object)

    the current value of legend



3
4
5
# File 'lib/rails_performance/system_monitor/resource_chart.rb', line 3

def legend
  @legend
end

#serverObject

Returns the value of attribute server

Returns:

  • (Object)

    the current value of server



3
4
5
# File 'lib/rails_performance/system_monitor/resource_chart.rb', line 3

def server
  @server
end

#subtitleObject

Returns the value of attribute subtitle

Returns:

  • (Object)

    the current value of subtitle



3
4
5
# File 'lib/rails_performance/system_monitor/resource_chart.rb', line 3

def subtitle
  @subtitle
end

#typeObject

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



3
4
5
# File 'lib/rails_performance/system_monitor/resource_chart.rb', line 3

def type
  @type
end

Instance Method Details

#dataObject



8
9
10
11
# File 'lib/rails_performance/system_monitor/resource_chart.rb', line 8

def data
  all_data = server.report.extract_signal { |e| signal(e) }
  all_data[server.key]
end

#format(measurement) ⇒ Object



17
18
19
# File 'lib/rails_performance/system_monitor/resource_chart.rb', line 17

def format measurement
  measurement
end

#idObject



4
5
6
# File 'lib/rails_performance/system_monitor/resource_chart.rb', line 4

def id
  [key, "report", server.key.parameterize].join("_")
end

#signal(e) ⇒ Object



13
14
15
# File 'lib/rails_performance/system_monitor/resource_chart.rb', line 13

def signal e
  format(e[key])
end