module TingYun::Support::CollectorMethods

Public Instance Methods

api_collector() click to toggle source
# File lib/ting_yun/support/collector.rb, line 19
def api_collector
  @api_collector ||= Collector.new(TingYun::Agent.config[:api_host], TingYun::Agent.config[:api_port])
end
collector() click to toggle source
# File lib/ting_yun/support/collector.rb, line 12
def collector
  @remote_collector ||= collector_from_host
end
collectorV3(host) click to toggle source
# File lib/ting_yun/support/collector.rb, line 15
def collectorV3(host)
  @remote_collector ||= collector_from_host(host)
end
collector_from_host(hostname=nil) click to toggle source
# File lib/ting_yun/support/collector.rb, line 23
def collector_from_host(hostname=nil)
  if hostname.nil?
    Collector.new(TingYun::Agent.config[:host], TingYun::Agent.config[:port])
  else
    args = hostname.split(':')
    Collector.new(args[0], args[1]||TingYun::Agent.config[:port])
  end
end
reset() click to toggle source
# File lib/ting_yun/support/collector.rb, line 32
def reset
  @remote_collector = nil
end