File tree Expand file tree Collapse file tree 3 files changed +3
-21
lines changed
Expand file tree Collapse file tree 3 files changed +3
-21
lines changed Original file line number Diff line number Diff line change 11require 'json'
22require 'core_ext/object'
3- require 'core_ext/fixnum'
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11module Stackify ::Metrics
22 class MetricsClient
3-
3+ TEN_MINUTES = 600
44 attr_reader :metrics_queue
55
66 def initialize
@@ -57,7 +57,7 @@ def queue_metric metric
5757
5858 def start_upload_metrics
5959 current_time = Stackify ::Utils . rounded_current_time
60- purge_older_than = current_time - 10 . minutes
60+ purge_older_than = current_time - TEN_MINUTES
6161 #read everything up to the start of the current minute
6262 read_queued_metrics_batch current_time
6363 handle_zero_reports current_time
@@ -67,7 +67,7 @@ def start_upload_metrics
6767 if first_50_metrics . length > 0
6868 #only getting metrics less than 10 minutes old to drop old data in case we get backed up
6969 #they are removed from the @aggregated_metrics in the upload function upon success
70- upload_aggregates ( first_50_metrics . select { |_key , aggr | aggr . occurred_utc > current_time - 10 . minutes } )
70+ upload_aggregates ( first_50_metrics . select { |_key , aggr | aggr . occurred_utc > current_time - TEN_MINUTES } )
7171 end
7272 @aggregate_metrics . delete_if { |_key , aggr | aggr . occurred_utc < purge_older_than }
7373 end
You can’t perform that action at this time.
0 commit comments