Sha256: bc7eab596a768a7f07f6b8f6f9b609bf78363ebf7e75811a453415c65e6fe0d9
Contents?: true
Size: 772 Bytes
Versions: 14
Compression:
Stored size: 772 Bytes
Contents
# encoding: utf-8 require 'ting_yun/agent' module TingYun module Support class Collector < Struct.new :name, :port def to_s; "#{name}:#{port}"; end end module CollectorMethods def collector @remote_collector ||= collector_from_host end def api_collector @api_collector ||= Collector.new(TingYun::Agent.config[:api_host], TingYun::Agent.config[:api_port]) end 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 end extend CollectorMethods end end
Version data entries
14 entries across 14 versions & 1 rubygems