@@ -56,7 +56,7 @@ def last_datadog_metric
56
56
series
57
57
. first
58
58
. fetch ( "pointlist" )
59
- . map { |x | x [ 0 ] }
59
+ . map { |x | x [ 0 ] }
60
60
. max
61
61
. to_i / 1000
62
62
)
@@ -82,7 +82,7 @@ def reporting_interval
82
82
now_i = minute_precision ( Time . now ) . to_i - 60
83
83
start_time_i = last_time_submitted . to_i + 60
84
84
times = ( start_time_i ..now_i ) . step ( 60 ) . to_a
85
- Hash [ times . collect { |time | [ Time . at ( time ) , { } ] } ]
85
+ Hash [ times . collect { |time | [ Time . at ( time ) , { } ] } ]
86
86
end
87
87
88
88
def _95percentile ( sorted_values )
@@ -93,7 +93,7 @@ def _95percentile(sorted_values)
93
93
def add_metric_to_bucket ( prior , new )
94
94
new_values = prior [ :values ] . push ( new )
95
95
new_count = new_values . length
96
- new_avg = ( ( prior [ :avg ] * prior [ :count ] ) + new ) / new_count
96
+ new_avg = ( ( prior [ :avg ] * prior [ :count ] ) + new ) / new_count
97
97
98
98
sorted_values = new_values . sort
99
99
new_median = sorted_values [ ( sorted_values . count / 2 ) - 1 ]
@@ -118,7 +118,7 @@ def did_i_get_it_all?(slowlog)
118
118
slowlog [ -1 ] [ 0 ] == 0
119
119
end
120
120
121
- def redis_slowlog ( length = 128 )
121
+ def redis_slowlog ( length = 128 )
122
122
resp = @redis . slowlog ( 'get' , length )
123
123
124
124
return resp if length > MAXLENGTH
@@ -174,7 +174,7 @@ def slowlogs_by_flush_interval
174
174
break if minute_precision ( time ) <= minute_precision ( last_time_submitted )
175
175
176
176
command = slowlog [ 3 ] [ 0 ]
177
- value = slowlog_microseconds ( slowlog )
177
+ value = slowlog_microseconds ( slowlog )
178
178
bucket = minute_precision ( time )
179
179
180
180
if result [ bucket ] . nil?
0 commit comments