Class: Lambdakiq::Metrics
- Inherits:
-
Object
- Object
- Lambdakiq::Metrics
- Defined in:
- lib/lambdakiq/metrics.rb
Instance Attribute Summary collapse
-
#event ⇒ Object
readonly
Returns the value of attribute event.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(event) ⇒ Metrics
constructor
A new instance of Metrics.
- #log ⇒ Object
Constructor Details
#initialize(event) ⇒ Metrics
Returns a new instance of Metrics.
11 12 13 14 15 16 |
# File 'lib/lambdakiq/metrics.rb', line 11 def initialize(event) @event = event @metrics = [] @properties = {} instrument! end |
Instance Attribute Details
#event ⇒ Object (readonly)
Returns the value of attribute event.
3 4 5 |
# File 'lib/lambdakiq/metrics.rb', line 3 def event @event end |
Class Method Details
.log(event) ⇒ Object
6 7 8 |
# File 'lib/lambdakiq/metrics.rb', line 6 def log(event) new(event).log end |
Instance Method Details
#log ⇒ Object
18 19 20 21 |
# File 'lib/lambdakiq/metrics.rb', line 18 def log return unless lambdakiq? logger.info JSON.dump() end |