Class: CollectdServer::Datapoint
- Inherits:
-
Object
- Object
- CollectdServer::Datapoint
- Defined in:
- lib/collectd_server/datapoint.rb
Instance Attribute Summary collapse
-
#metric_name ⇒ Object
readonly
Returns the value of attribute metric_name.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(name, timestamp, value) ⇒ Datapoint
constructor
A new instance of Datapoint.
- #to_a ⇒ Object
- #to_csv ⇒ Object
Constructor Details
#initialize(name, timestamp, value) ⇒ Datapoint
Returns a new instance of Datapoint.
8 9 10 |
# File 'lib/collectd_server/datapoint.rb', line 8 def initialize(name, , value) @metric_name, @timestamp, @value = name, , value end |
Instance Attribute Details
#metric_name ⇒ Object (readonly)
Returns the value of attribute metric_name.
6 7 8 |
# File 'lib/collectd_server/datapoint.rb', line 6 def metric_name @metric_name end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
6 7 8 |
# File 'lib/collectd_server/datapoint.rb', line 6 def @timestamp end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
6 7 8 |
# File 'lib/collectd_server/datapoint.rb', line 6 def value @value end |
Instance Method Details
#to_a ⇒ Object
16 17 18 |
# File 'lib/collectd_server/datapoint.rb', line 16 def to_a [metric_name, , value] end |
#to_csv ⇒ Object
12 13 14 |
# File 'lib/collectd_server/datapoint.rb', line 12 def to_csv to_a.to_csv end |