Class: RRDNotifier::Packet
- Inherits:
-
DataStruct
- Object
- DataStruct
- RRDNotifier::Packet
- Defined in:
- lib/rrd-grapher/notifier/structures.rb
Overview
from collectd source code plugin.h
notification: int severity; cdtime_t time; char message; char host; char plugin; char plugin_instance; char type; char type_instance;
data value_t *values; int values_len; cdtime_t time; cdtime_t interval; char host; char plugin; char plugin_instance; char type; char type_instance;
Instance Method Summary collapse
- #data? ⇒ Boolean
-
#measure_id ⇒ Object
return a unique id for the measured data.
- #notification? ⇒ Boolean
- #plugin_display ⇒ Object
- #type_display ⇒ Object
- #value(index = 0) ⇒ Object
Methods inherited from DataStruct
attributes, #initialize, #merge_data_from, properties, #selected_field?
Constructor Details
This class inherits a constructor from DataStruct
Instance Method Details
#data? ⇒ Boolean
49 50 51 |
# File 'lib/rrd-grapher/notifier/structures.rb', line 49 def data? self..nil? end |
#measure_id ⇒ Object
return a unique id for the measured data.
75 76 77 |
# File 'lib/rrd-grapher/notifier/structures.rb', line 75 def measure_id "#{host}-#{plugin_display}-#{type_display}" end |
#notification? ⇒ Boolean
45 46 47 |
# File 'lib/rrd-grapher/notifier/structures.rb', line 45 def notification? !self..nil? end |
#plugin_display ⇒ Object
57 58 59 60 61 62 63 |
# File 'lib/rrd-grapher/notifier/structures.rb', line 57 def plugin_display if plugin_instance && !plugin_instance.empty? "#{plugin}/#{plugin_instance}" else plugin end end |
#type_display ⇒ Object
65 66 67 68 69 70 71 |
# File 'lib/rrd-grapher/notifier/structures.rb', line 65 def type_display if type_instance && !type_instance.empty? "#{type}/#{type_instance}" else type end end |
#value(index = 0) ⇒ Object
53 54 55 |
# File 'lib/rrd-grapher/notifier/structures.rb', line 53 def value(index = 0) values[index] end |