Sha256: 0b4170fc36ec246c4d833d6d1d1b88099b91578a883c7a8df44a13f160efadfe
Contents?: true
Size: 1.08 KB
Versions: 44
Compression:
Stored size: 1.08 KB
Contents
module ScoutApm module Instruments class HistogramReport attr_reader :name attr_reader :histogram def initialize(name, histogram) @name = name @histogram = histogram end def combine!(other) raise "Mismatched Histogram Names" unless name == other.name histogram.combine!(other.histogram) self end end class PercentileSampler attr_reader :logger # A hash of { time => RequestHistograms } attr_reader :histograms def initialize(logger, histograms) @logger = logger @histograms = histograms end def human_name 'Percentiles' end def metrics(timestamp, store) store.track_histograms!(percentiles(timestamp), :timestamp => timestamp) end def percentiles(time) result = [] histogram = histograms.delete(time) return result unless histogram histogram.each_name do |name| result << HistogramReport.new(name, histogram.raw(name)) end result end end end end
Version data entries
44 entries across 44 versions & 1 rubygems