Class: IngestSample
- Inherits:
-
Object
- Object
- IngestSample
- Defined in:
- lib/netuitive/ingest_sample.rb
Instance Attribute Summary collapse
-
#avg ⇒ Object
Returns the value of attribute avg.
-
#cnt ⇒ Object
Returns the value of attribute cnt.
-
#max ⇒ Object
Returns the value of attribute max.
-
#metricId ⇒ Object
Returns the value of attribute metricId.
-
#min ⇒ Object
Returns the value of attribute min.
-
#sum ⇒ Object
Returns the value of attribute sum.
-
#timestamp ⇒ Object
Returns the value of attribute timestamp.
-
#val ⇒ Object
Returns the value of attribute val.
Instance Method Summary collapse
-
#initialize(metricId, timestamp, val, min, max, avg, sum, cnt) ⇒ IngestSample
constructor
A new instance of IngestSample.
- #to_json(options = {}) ⇒ Object
Constructor Details
#initialize(metricId, timestamp, val, min, max, avg, sum, cnt) ⇒ IngestSample
Returns a new instance of IngestSample.
4 5 6 7 8 9 10 11 12 13 |
# File 'lib/netuitive/ingest_sample.rb', line 4 def initialize(metricId, , val, min, max, avg, sum, cnt) @metricId=metricId @timestamp= @val=val @min=min @max=max @avg=avg @sum=sum @cnt=cnt end |
Instance Attribute Details
#avg ⇒ Object
Returns the value of attribute avg.
3 4 5 |
# File 'lib/netuitive/ingest_sample.rb', line 3 def avg @avg end |
#cnt ⇒ Object
Returns the value of attribute cnt.
3 4 5 |
# File 'lib/netuitive/ingest_sample.rb', line 3 def cnt @cnt end |
#max ⇒ Object
Returns the value of attribute max.
3 4 5 |
# File 'lib/netuitive/ingest_sample.rb', line 3 def max @max end |
#metricId ⇒ Object
Returns the value of attribute metricId.
3 4 5 |
# File 'lib/netuitive/ingest_sample.rb', line 3 def metricId @metricId end |
#min ⇒ Object
Returns the value of attribute min.
3 4 5 |
# File 'lib/netuitive/ingest_sample.rb', line 3 def min @min end |
#sum ⇒ Object
Returns the value of attribute sum.
3 4 5 |
# File 'lib/netuitive/ingest_sample.rb', line 3 def sum @sum end |
#timestamp ⇒ Object
Returns the value of attribute timestamp.
3 4 5 |
# File 'lib/netuitive/ingest_sample.rb', line 3 def @timestamp end |
#val ⇒ Object
Returns the value of attribute val.
3 4 5 |
# File 'lib/netuitive/ingest_sample.rb', line 3 def val @val end |
Instance Method Details
#to_json(options = {}) ⇒ Object
14 15 16 17 |
# File 'lib/netuitive/ingest_sample.rb', line 14 def to_json( = {}) millis=@timestamp.to_f * 1000 {'metricId' => @metricId,'timestamp' => millis.round, 'val' => @val,'min' => @min, 'max' => @max, 'avg' => @avg,'sum' => @sum, 'cnt' => @cnt}.to_json end |