Class: SnowAgent::Agent

Inherits:
Object
  • Object
show all
Defined in:
lib/snowagent/agent.rb

Defined Under Namespace

Classes: Metric

Instance Method Summary collapse

Constructor Details

#initialize(configuration) ⇒ Agent

Returns a new instance of Agent.



3
4
5
6
# File 'lib/snowagent/agent.rb', line 3

def initialize(configuration)
  strategy_class = SyncStrategy
  @strategy      = strategy_class.new(configuration)
end

Instance Method Details

#metric(key, value, kind = nil, context = nil, time = Time.now.to_i) ⇒ Object



10
11
12
# File 'lib/snowagent/agent.rb', line 10

def metric(key, value, kind = nil, context = nil, time = Time.now.to_i)
  @strategy.metric(Metric.new(key, value, kind, context, time))
end