Module: PrometheusExporter::Ext::Server::ExpiredStatsCollector::ClassMethods

Defined in:
lib/prometheus_exporter/ext/server/expired_stats_collector.rb

Instance Method Summary collapse

Instance Method Details

#unique_metric_by {|new_metric, old_metric| ... } ⇒ Object

Defines a rule how old metric will be replaced with new one.

Yields:

  • compare new metric with existing one.

Yield Parameters:

  • new_metric (Hash)

    new metric data.

  • old_metric (Hash)

    existing metric data.

Yield Returns:

  • (Boolean)

    if true existing metric will be replaced with new one.



26
27
28
# File 'lib/prometheus_exporter/ext/server/expired_stats_collector.rb', line 26

def unique_metric_by(&block)
  @filter = block
end