Class: Trace::Annotation
- Inherits:
-
Object
- Object
- Trace::Annotation
- Defined in:
- lib/zipkin-tracer/trace.rb
Overview
These classes all come from Finagle-thrift + some needed modifications (.to_h) Moved here as a first step, eventually move them out of the Trace module
Instance Attribute Summary collapse
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(value) ⇒ Annotation
constructor
A new instance of Annotation.
- #to_h ⇒ Object
Constructor Details
#initialize(value) ⇒ Annotation
Returns a new instance of Annotation.
55 56 57 58 |
# File 'lib/zipkin-tracer/trace.rb', line 55 def initialize(value) @timestamp = (Time.now.to_f * 1000 * 1000).to_i # micros @value = value end |
Instance Attribute Details
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
53 54 55 |
# File 'lib/zipkin-tracer/trace.rb', line 53 def @timestamp end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
53 54 55 |
# File 'lib/zipkin-tracer/trace.rb', line 53 def value @value end |
Instance Method Details
#to_h ⇒ Object
60 61 62 63 64 65 |
# File 'lib/zipkin-tracer/trace.rb', line 60 def to_h { value: @value, timestamp: @timestamp } end |