21 lines
427 B
Ruby
21 lines
427 B
Ruby
class Metrics::Reporter
|
|
include HasColorLogger
|
|
|
|
def initialize
|
|
@client = Metrics::Client.singleton
|
|
end
|
|
|
|
def log_writes!
|
|
@log_writes = true
|
|
end
|
|
|
|
def write_point(name, tags: {}, fields: {})
|
|
@client.write_point(self, name, tags: tags, fields: fields)
|
|
logger.info("reporter wrote point '#{name.bold}'") if @log_writes
|
|
end
|
|
|
|
def report
|
|
raise NotImplementedError, "implement in subclass"
|
|
end
|
|
end
|