lib/rest-ftp-daemon/workers/reporter.rb in rest-ftp-daemon-0.430.1 vs lib/rest-ftp-daemon/workers/reporter.rb in rest-ftp-daemon-0.432.0
- old
+ new
@@ -8,11 +8,11 @@
def worker_init
# Load corker conf
config_section :reporter
# Other configuration options
- @report_newrelic = Conf.feature?(:newrelic)
+ @feature_newrelic = Conf.feature?(:newrelic)
# Check that everything is OK
return "invalid timer" unless @config[:timer].to_i > 0
return false
end
@@ -32,25 +32,22 @@
end
private
def do_metrics
- # What metrics to report?
- report_newrelic = Conf.feature?(:newrelic)
-
# Get common metrics and dump them to logs
log_debug "begin metrics sample"
metrics = Metrics.sample
# Skip following if no valid metrics collected
unless metrics.is_a? Hash
log_error "unable to collect metrics"
return
end
- log_info "collected metrics (newrelic: #{@report_newrelic})", metrics
+ log_info "collected metrics (newrelic: #{@feature_newrelic.inspect})", metrics
# Transpose metrics to NewRelic metrics
- report_newrelic(metrics) if @report_newrelic
+ report_newrelic(metrics) if @feature_newrelic
end
def report_newrelic metrics
metrics_newrelic = {}
metrics.each do |group, pairs|