Sha256: 9f05bd85c730f9c1291702d17e20724d5588c1604391fc23a568a877d5874d7d
Contents?: true
Size: 880 Bytes
Versions: 9
Compression:
Stored size: 880 Bytes
Contents
MetricFu.metrics_require { "hotspots/hotspot_analyzer" } module MetricFu class HotspotsGenerator < Generator def self.metric :hotspots end def initialize(options = {}) MetricFu::Metric.enabled_metrics.each do |metric| require_hotspot(metric.name) end super end def emit # no-op end def analyze analyzer = MetricFu::HotspotAnalyzer.new(MetricFu.result.result_hash) @hotspots = analyzer.hotspots end def to_h result = { hotspots: {} } @hotspots.each do |granularity, hotspots| result[:hotspots][granularity.to_s] = hotspots.map(&:to_hash) end result end private def require_hotspot(metric_name) require "metric_fu/metrics/#{metric_name}/hotspot" rescue LoadError mf_debug "*** No hotspot for #{metric_name}" end end end
Version data entries
9 entries across 9 versions & 3 rubygems