class Hallmonitor::Event

The event class is a single-fire event, it most often represents a single, countable metric.

Attributes

count[RW]
name[RW]
tags[RW]
time[RW]

Public Class Methods

new(name, count: 1, tags: {}) click to toggle source

Builds a new event @param name [String] the name of this event @param count [Number,Hash] the count of this even, defaults to 1. Can

also be a hash of named value pairs

@param tags [Hash<Symbol,String>] Hash of tags to values for this event

# File lib/hallmonitor/event.rb, line 15
def initialize(name, count: 1, tags: {})
  @name = name
  @time = Time.now
  @count = count
  @tags = tags
end

Public Instance Methods

to_json(*a) click to toggle source
# File lib/hallmonitor/event.rb, line 22
def to_json(*a)
  {
    name: @name,
    time: @time,
    count: @count,
    tags: @tags
  }.to_json(*a)
end