Class: Karafka::Web::Tracking::Helpers::Ttls::Hash
- Inherits:
-
Hash
- Object
- Hash
- Karafka::Web::Tracking::Helpers::Ttls::Hash
- Defined in:
- lib/karafka/web/tracking/helpers/ttls/hash.rb
Overview
Hash that accumulates data that has an expiration date (ttl) Used to keep track of metrics in a window
Instance Method Summary collapse
-
#initialize(ttl) ⇒ Hash
constructor
A new instance of Hash.
-
#stats_from(&block) {|key, samples| ... } ⇒ Stats
Takes a block where we provide a hash select filtering to select keys we are interested in using for aggregated stats.
Constructor Details
Instance Method Details
#stats_from(&block) {|key, samples| ... } ⇒ Stats
Takes a block where we provide a hash select filtering to select keys we are interested in using for aggregated stats. Once filtered, builds a Stats object out of the candidates
24 25 26 27 28 |
# File 'lib/karafka/web/tracking/helpers/ttls/hash.rb', line 24 def stats_from(&block) Stats.new( select(&block) ) end |