Skip to content

Commit 1dee412

Browse files
jaygel179Elpedio Adoptante Jr
andauthored
Fix Fixnum conflict with ActiveSupport (#36)
* Fix Fixnum conflict with ActiveSupport Co-authored-by: Elpedio Adoptante Jr <eadoptante@stackify.com>
1 parent 2225fbc commit 1dee412

File tree

3 files changed

+3
-21
lines changed

3 files changed

+3
-21
lines changed

lib/core_ext/core_ext.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
require 'json'
22
require 'core_ext/object'
3-
require 'core_ext/fixnum'

lib/core_ext/fixnum.rb

Lines changed: 0 additions & 17 deletions
This file was deleted.

lib/stackify/metrics/metrics_client.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module 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

0 commit comments

Comments
 (0)