Class: Dtrace::Aggregate
- Inherits:
-
Object
- Object
- Dtrace::Aggregate
- Defined in:
- lib/dtrace/aggregate.rb
Instance Attribute Summary collapse
-
#tuple ⇒ Object
readonly
Returns the value of attribute tuple.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#add_record(r) ⇒ Object
Add a Dtrace::AggData record to this aggregate.
-
#initialize ⇒ Aggregate
constructor
Create an empty Dtrace::Aggregate: use
add_recordto add data.
Constructor Details
#initialize ⇒ Aggregate
Create an empty Dtrace::Aggregate: use add_record to add data.
20 21 22 |
# File 'lib/dtrace/aggregate.rb', line 20 def initialize @tuple = Array.new end |
Instance Attribute Details
#tuple ⇒ Object (readonly)
Returns the value of attribute tuple.
17 18 19 |
# File 'lib/dtrace/aggregate.rb', line 17 def tuple @tuple end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
17 18 19 |
# File 'lib/dtrace/aggregate.rb', line 17 def value @value end |
Instance Method Details
#add_record(r) ⇒ Object
Add a Dtrace::AggData record to this aggregate. Returns nil until it receives a record of aggtype “last”, when it returns the complete Dtrace::Aggregate.
27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/dtrace/aggregate.rb', line 27 def add_record(r) case r.aggtype when "tuple" @tuple << r.value when "value" @value = r.value when "last" return self end nil end |