.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Net::Prometheus::Types 3pm" .TH Net::Prometheus::Types 3pm 2024-03-07 "perl v5.38.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME "Net::Prometheus::Types" \- a collection of support structure types .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 1 \& use Net::Prometheus::Types qw( Sample ); \& \& my $ob = Sample( variable => [], 123 ); \& \& print "The sample relates to a variable called ", $ob\->varname; .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" This package contains some simple support structures that assist with other parts of the Net::Prometheus distribution. .PP Each type is exported as a constructor function. .SH TYPES .IX Header "TYPES" .SS Sample .IX Subsection "Sample" This structure represents an individual value sample; associating a numerical value with a named variable and set of label values. .PP .Vb 1 \& $sample = Sample( $varname, $labels, $value ) .Ve .PP \fIvarname\fR .IX Subsection "varname" .PP .Vb 1 \& $varname = $sample\->varname .Ve .PP The string variable name. This is the basic name, undecorated by label values. .PP \fIlabels\fR .IX Subsection "labels" .PP .Vb 1 \& $labels = $sample\->labels .Ve .PP A reference to an even-sized ARRAY containing name/value pairs for the labels. Label values should be raw unescaped strings. .PP \fIvalue\fR .IX Subsection "value" .PP .Vb 1 \& $sample\->value .Ve .PP The numerical value observed. .SS MetricSamples .IX Subsection "MetricSamples" This structure represents all the samples made about a given metric, including metadata about the metric itself. .PP .Vb 1 \& $samples = MetricSamples( $fullname, $type, $help, $samples ) .Ve .PP \fIfullname\fR .IX Subsection "fullname" .PP A string giving the fullname of the metric. .PP \fItype\fR .IX Subsection "type" .PP A string, one of \f(CW\*(Aqgauge\*(Aq\fR, \f(CW\*(Aqcounter\*(Aq\fR, \f(CW\*(Aqsummary\*(Aq\fR or \f(CW\*(Aqhistogram\*(Aq\fR. .PP \fIhelp\fR .IX Subsection "help" .PP A string containing the descriptive help message text. .PP \fIsamples\fR .IX Subsection "samples" .PP A reference to an ARRAY containing individual "Sample" instances. .SH AUTHOR .IX Header "AUTHOR" Paul Evans