Net::Prometheus::Summary(3pm)

Net::Prometheus::Summary3pm

Summarise individual numeric observations

Usage

   use Net::Prometheus;
   use Time::HiRes qw( time );
   my $client = Net::Prometheus->new;
   my $summary = $client->new_summary(
      name => "request_seconds",
      help => "Summary request processing time",
   );
   sub handle_request
   {
      my $start = time();
      ...
      $summary->observe( time() - $start );
   }

Overview

This class provides a summary metric - a combination of a running total and a counter, that can be used to report on total and average values of observations, usually times. It is a subclass of Net::Prometheus::Metric.

Constructor

Instances of this class are not usually constructed directly, but instead via the Net::Prometheus object that will serve it:

   $summary = $prometheus->new_summary( %args )

This takes the same constructor arguments as documented in Net::Prometheus::Metric.

observe

   $summary->observe( @label_values, $value )
   $summary->observe( \%labels, $value )
   $child->observe( $value )

Increment the summary sum by the given value, and the count by 1.

Releases

4 releases since Debian 10 (Buster); the text changed 3 times.

  1. 10
  2. 11
  3. 12
  4. 13

Author

Paul Evans <[email protected]>

From libnet-prometheus-perl 0.14-1 in Debian 13 (Trixie). Parsed by carta from the page's man source.