Net::P...ummary(3pm)
β¨ Net::P...ummary(3pm) β¨
okay bestie, gather round π this is the manual page for Net::Prometheus::Summary, living its best life in the User Contributed Perl Documentation zone. yes the title's truncated, yes we're still gonna read the whole thing, no cap.
πΈ NAME πΈ
"Net::Prometheus::Summary" β the class that summarises individual numeric observations. it's giving "I count things and I add things up" π
π SYNOPSIS π
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 );
}
literally the whole vibe right there β¨ make a client, make a summary, time your request, observe it. iconic.
π¦ DESCRIPTION π¦
so this class hands you a summary metric β which is a combo meal of a running total and a counter π. you use it to report on total and average values of your observations, and like, usually those observations are times (you know, how long stuff took β±οΈ).
and for the family tree girlies: it's a subclass of Net::Prometheus::Metric π so all that inherited energy comes along for the ride.
π CONSTRUCTOR π
real talk, you don't normally build these yourself by hand π. they get constructed for you by the Net::Prometheus object that's gonna serve it:
$summary = $prometheus->new_summary( %args )
and it takes the exact same constructor arguments as documented over in Net::Prometheus::Metric. no new rules, no secret extra options, just the same ones. periodt.
π₯ observe π₯
$summary->observe( @label_values, $value )
$summary->observe( \%labels, $value )
$child->observe( $value )
the way this works is so simple it's honestly slay: it bumps the summary's sum up by the value you hand it, and it kicks the count up by 1 π₯. that's it. that's the whole job. sum goes up by value, count goes up by one.
π AUTHOR π
Paul Evans <leonerd@leonerd.org.uk> β the icon who wrote this, we stan π«Ά
and that's a wrap, bestie!! π this was Net::P...ummary(3pm) from perl v5.42.3, dated 2026-08-20, filed under User Contributed Perl Documentation. mwah π go observe something. not me being emotionally attached to a summary metric π
π¦ where this page comes from
- ubuntu stonking: libnet-prometheus-perl 0.16-1build1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms