rubycut-metriks 0.9.9.14 → 0.9.9.15

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fdceda10ac0e2d6c6c0be7ac8bccde38123ffdf5
4
- data.tar.gz: e129f3c5c13e236dcb8647148b9f8b2e3294d6c0
3
+ metadata.gz: 3095ab26dfe5e275d61483520a5dcd9207342e6e
4
+ data.tar.gz: 7a2f54b8d8b15283ed8e6acea52b4d9098752e02
5
5
  SHA512:
6
- metadata.gz: 0fb90a76f71aa203aa33b16ce4a38547fc743b60db22bc128beb28cb6db68f571a0a7bb255f1a37e37606aa89f2787e34bcb13f9c1d04d5b0d66c8ce0340b135
7
- data.tar.gz: 58927e4d637ab3548865737e5a1994be7f9d9a39ca3bb1b3c91a0373e0ed2ce4b67487fc1f3d83328043ee5f5fe997d8755d599836e74c7062b8c7c426651ef5
6
+ metadata.gz: fbd8cdff0d6a60c69542e3454ea4c0a814a2c9a1dd105214fe24bcd42c7e499f10d371f4702bd47397ee093115e851be880bc72c4c48ee8f67762254497825e7
7
+ data.tar.gz: a6548e8db380d530a9cfc3c2f64f7aacc55a13dd2773ecc3974660edb5169dcf8ea42a0eabb3613f3977e4b0fdf2748ea165148bf17c008a516ac8ff8a3c1fa3
@@ -90,6 +90,7 @@ module Metriks::Reporter
90
90
  ], [
91
91
  :median, :get_95th_percentile
92
92
  ]
93
+ metric.clear if metric.reset_on_submit
93
94
  when Metriks::Histogram
94
95
  send_metric name, metric, [
95
96
  :count, :min, :max, :mean, :stddev
data/lib/metriks/timer.rb CHANGED
@@ -6,11 +6,18 @@ require 'metriks/histogram'
6
6
 
7
7
  module Metriks
8
8
  class Timer
9
+ # I want to get mean value for last minute only not for eternity
10
+ attr_accessor :reset_on_submit
9
11
  class Context
10
12
  def initialize(timer)
11
13
  @timer = timer
12
14
  @interval = Hitimes::Interval.now
13
15
  end
16
+ # shortcut for onliners
17
+ def activate_reset_on_submit
18
+ @reset_on_submit = true
19
+ self
20
+ end
14
21
 
15
22
  def restart
16
23
  @interval = Hitimes::Interval.now
data/metriks.gemspec CHANGED
@@ -13,7 +13,7 @@ Gem::Specification.new do |s|
13
13
  ## If your rubyforge_project name is different, then edit it and comment out
14
14
  ## the sub! line in the Rakefile
15
15
  s.name = 'rubycut-metriks'
16
- s.version = '0.9.9.14'
16
+ s.version = '0.9.9.15'
17
17
  s.date = '2015-10-07'
18
18
 
19
19
  ## Make sure your summary is short. The description may be as long
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubycut-metriks
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.9.14
4
+ version: 0.9.9.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Lindvall