Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
d7e5636
extra units in metadata: initial changes
kmcdonell Apr 29, 2026
5e36d53
Merge branch 'main' into units
kmcdonell Apr 30, 2026
2090324
Merge branch 'main' into units
kmcdonell Apr 30, 2026
439ec6a
libpcp_fault & libpcp_static: add extraunits.c to GNUmakefiles
kmcdonell Apr 30, 2026
b5401b1
Perl: compilation fixups for extra units in pmUnits
kmcdonell Apr 30, 2026
9a5d897
src/include/pcp/mmv_stats.h: extra units changes
kmcdonell May 2, 2026
a753e60
extra units: add __pmCheckDesc() and -e option for pminfo
kmcdonell May 3, 2026
362b001
statsd PMDA: extra units fixups
kmcdonell May 3, 2026
f90c33a
src/include/pcp/pmda.h: extra units: rework macros
kmcdonell May 3, 2026
ca48564
extra units: add support in Python interface layer
kmcdonell May 3, 2026
9636dda
qa/510: small tweak for lock file diagnostic
kmcdonell May 3, 2026
081ed21
qa/src/endian.c: changes for extra units
kmcdonell May 3, 2026
6804817
src/perl/PMDA/cvalue.c: extra units changes
kmcdonell May 3, 2026
37581bd
src/pmlogger/src/checks.c: extra units
kmcdonell May 3, 2026
90f92ff
src/collectl2pcp/pmdesc.c: changes for extra units
kmcdonell May 3, 2026
04663d0
scripts/man-spell: fixup
kmcdonell May 3, 2026
8e0c507
collectl2pcp: extra units changes
kmcdonell May 3, 2026
dc23160
libpcp_import: add support for extra units in pmUnits
kmcdonell May 3, 2026
f8ea879
qa/archives/extra: small new archive with sample metrics having extra…
kmcdonell May 5, 2026
e143496
Merge branch 'main' into units
kmcdonell May 6, 2026
a57488d
extra units changes for pmlogrewrite
kmcdonell May 7, 2026
f94ada2
Merge branch 'main' into units
kmcdonell May 10, 2026
4dca8b9
Merge branch 'main' into units
kmcdonell May 10, 2026
b374284
extra units: refactor the formatting and parsing routines in libpcp
kmcdonell May 11, 2026
993d2ed
extra units: next round of changes
kmcdonell May 14, 2026
beb377a
Merge branch 'main' into units
kmcdonell May 14, 2026
20007ff
Merge branch 'main' into units
kmcdonell May 15, 2026
95a5ee7
qa/group: unreserve 1664
kmcdonell May 15, 2026
782c07f
pmie: extra units changes
kmcdonell May 15, 2026
e63dacf
pmie and summary PMDA: extra units changes
kmcdonell May 19, 2026
7713cee
pmie & qa: small fixups
kmcdonell May 19, 2026
b1e93c0
Merge branch 'main' into units
kmcdonell May 19, 2026
6957da7
libpcp: extra units changes for derived metrics
kmcdonell May 20, 2026
9c648fe
qa/common.filter: add the summary PMDA to the "optional" ones to be f…
kmcdonell May 20, 2026
b01db90
libpcp: tidy up extra units seamntic checks for derived metrics
kmcdonell May 21, 2026
e5a43d9
extra units: last round of significant changes
kmcdonell May 22, 2026
f23cbed
Merge branch 'main' into units
kmcdonell May 22, 2026
f5f9700
extra units: small tweaks for the Python interface layer
kmcdonell May 22, 2026
3d9b480
qa/369.out & qa/1418.out: remade after pmiExtraUnits added
kmcdonell May 22, 2026
419eb08
qa/pdudata: update some configs
kmcdonell May 22, 2026
1ace97c
src/pmdas/statsd/src/pmdastatsd.c: fix from coderabbitai
kmcdonell May 22, 2026
34fc4ef
src/collectl2pcp/pmdesc.c: fix from coderabbitai
kmcdonell May 23, 2026
9febac9
extra units: fixes from coderabbitai for PR #2598
kmcdonell May 23, 2026
4242a8f
fix spelling: farenheit is one h short ... thanks coderabbitai
kmcdonell May 23, 2026
60c3955
src/collectl: revert coderabbitai suggestion
kmcdonell May 23, 2026
6b08669
src/pmdas/statsd: fix botched change (unrelated to) extra units
kmcdonell May 23, 2026
307948a
Merge branch 'main' into units
kmcdonell May 24, 2026
ea5252e
qa/new: fix interaction between -r and -R
kmcdonell May 24, 2026
d51845a
src/libpcp_import/src/import.c: avoid accidental sharing of static
kmcdonell May 24, 2026
80f7ff1
miscellaneous fixes: on @coderabbitai suggestions for PR #2598.
kmcdonell May 26, 2026
626957e
qa: remakes after recent small code changes
kmcdonell May 26, 2026
4439cc1
src/pmie/src/dstruct.c: fix wrong field name used in test
kmcdonell May 26, 2026
95cb1be
src/pmlogrewrite/lex.l: match MiXeDcAsE macro names for extraScale
kmcdonell May 26, 2026
5fabaab
src/collectl2pcp/GNUmakefile: avoid pmdesc rebuild and execution
kmcdonell May 26, 2026
a1ca90c
Merge branch 'main' into units
kmcdonell May 27, 2026
2ebc275
extra units: more minor fixups from @coderabbitai suggestions
kmcdonell May 27, 2026
0e4eb64
src/libpcp_web/src/query.c: small extra units tweak
kmcdonell May 28, 2026
a664c5a
pmrep: extra units changes via src/python/pcp/pmconfig.py
kmcdonell May 28, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions man/man1/pmie.1
Original file line number Diff line number Diff line change
Expand Up @@ -620,6 +620,9 @@ A
.B pmie
specification is a sequence of semicolon terminated expressions.
.PP
The sequence ``//'' introduces a comment and all text from here
to the end of the current input line will be ignored.
.PP
Basic operators are modeled on the arithmetic, relational and Boolean
operators of the C programming language.
Precedence rules are as expected, although the use of parentheses
Expand Down Expand Up @@ -670,6 +673,8 @@ and the time interval between these samples.
All numeric expressions are evaluated in double precision, and where
appropriate, automatically
scaled into canonical units of ``bytes'', ``seconds'' and ``counts''.
Note that metrics defined over extra units like ``temperature'' or ``voltage''
are not scaled into canonical units.
.PP
A
.B rule
Expand Down Expand Up @@ -1046,6 +1051,17 @@ Simple scale factors are constructed from the keywords:
\f(CBbyte\fR, \f(CBKbyte\fR, \f(CBMbyte\fR, \f(CBGbyte\fR, \f(CBTbyte\f1,
\f(CBcount\fR, \f(CBKcount\fR and \f(CBMcount\fR,
and the operator \f(CR/\fR, for example ``\f(CBKbytes / hour\f1''.
.PP
Metrics defined over extra units like ``temperature'' or ``voltage''
may have a very wide variety of possible scales, but there is no support
in
.B pmie
for keywords to effect scaling, so expressions must use explicit scaling,
e.g.
.br
.ti +0.5i
\f(CBthis.temp.celsius\fR >= (\f(CBother.temp.fahrenheit\fR - 32) * 5 / 9
.br
.SH MACROS
Macros are defined using expressions of the form:
.PP
Expand Down
8 changes: 7 additions & 1 deletion man/man1/pminfo.1
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
\f3pminfo\f1 \- display information about performance metrics
.SH SYNOPSIS
\fBpminfo\fR
[\fB\-dfFIlLmMstTvVxz?\fR]
[\fB\-defFIlLmMstTvVxz?\fR]
[\fB\-a\fR \fIarchive\fR]
[\fB\-b\fR \fIbatchsize\fR]
[\fB\-c\fR \fIdmfile\fR]
Expand Down Expand Up @@ -134,6 +134,12 @@ to be queried.
Metric descriptions detailing the PMID, data type, data semantics, units,
scale and associated instance domain.
.TP
\fB\-e\fR, \fB\-\-metadata-errors\fR
Same as
.B \-v
but do not report metrics that return no values, so any metrics reported
are ones that have either persistent errors or inconsistent metadata.
.TP
\fB\-f\fR, \fB\-\-fetch\fR
Fetch and print values for all instances.
When fetching from a set of archives, only those instances present in the
Expand Down
49 changes: 48 additions & 1 deletion man/man1/pmlogrewrite.1
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,9 @@ the
.KW RESCALE
option for the
.KW UNITS
clause of the metric rewriting rule described below.
and
.KW EXTRAUNITS
clauses of the metric rewriting rule described below.
.TP
\fB\-v\fR, \fB\-\-verbose\fR
Enable verbose mode.
Expand Down Expand Up @@ -1118,6 +1120,51 @@ may be used to chose value rescaling as per the
command line option, but applied to just this metric.
.RE

.PP
.KW EXTRAUNITS
.KW ->
.I newextraunits
[
.KW RESCALE
]
.RS +4n
.PP
Same semantics as the
.KW UNITS
clause, except
.I newextraunits
is eight values separated by commas.
The first six values are exactly the same as for
.I newunits
in the
.KW UNITS
clause.
The seventh value identifies one of the ``extra'' units and
should be 0 (if there is none),
else the
the XXX part of the name of one of the
.B PM_UNIT_XXX
macros, e.g.
.KW TEMPERATURE
for
.BR PM_UNIT_TEMPERATURE .
The eigth value identifies the scale of the ``extra'' unit and
should be 0 (if there is none),
else the XXX part of the name of one of the associated
.BI PM_ <unit> _XXX
macros, e.g.
.KW C
for
.BR PM_TEMPERATURE_C
(the value is a temperature in degrees Celsius).
.PP
The optional keyword
.KW RESCALE
has the same meaning as for the
.KW UNITS
clause.
.RE

.PP
.KW VALUE
.KW REPLACE
Expand Down
5 changes: 5 additions & 0 deletions man/man3/pmapi.3
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,11 @@ service time is Time/Count.
In each dimension there are a number
of common scale values that may be used to better encode ranges that might
otherwise exhaust the precision of a 32-bit value.
.PP
Orthogonally, extra ``units'' information is also supported for values
that represent physical and electrical measurements, e.g. temperature,
voltage, current, power, etc.
.PP
This information is encoded
in the
.CR pmUnits
Expand Down
12 changes: 11 additions & 1 deletion man/man3/pmconvscale.3
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,17 @@ The scaling takes place from the units defined by
.I iunit
into the units defined by
.IR ounit .
Both input and output units must have the same dimensionality.
Both input and output units must have the same dimensionality, i.e. each
of the fields
.IR dimSpace ,
.IR dimTime ,
.IR dimCount
and
.I extraUnit
must have the same value in both
.I iunit
and
.IR ounit .
.PP
The performance metric type for both input and output values is determined by
.IR type ,
Expand Down
18 changes: 11 additions & 7 deletions man/man3/pmiaddmetric.3
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,10 @@ The semantics of the metric (counter, instantaneous value, etc.) is
specified by the
.I sem
argument which would normally be the result of a call to the
convenience constructor method
.BR pmiUnits (3).
convenience constructor methods
.BR pmiUnits (3)
or
.BR pmiExtraUnits (3)
.SH DIAGNOSTICS
.B pmiAddMetric
returns zero on success else a negative value that can be turned into an
Expand All @@ -138,12 +140,14 @@ error message by calling
.SH SEE ALSO
.BR PCPIntro (1),
.BR LOGIMPORT (3),
.BR PMAPI (3),
.BR pmLookupDesc (3),
.BR pmiErrStr (3),
.BR pmiExtraUnits (3),
.BR pmiPutLabel (3),
.BR pmiPutResult (3),
.BR pmiPutValue (3),
.BR pmiPutValueHandle (3),
.BR pmiPutText (3),
.BR pmiPutLabel (3),
.BR pmiUnits (3)
.BR pmiPutValue (3),
.BR pmiPutValueHandle (3)
and
.BR pmLookupDesc (3).
.BR pmiUnits (3).
33 changes: 29 additions & 4 deletions man/man3/pmiunits.3
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
.TH PMIUNITS 3 "PCP" "Performance Co-Pilot"
.SH NAME
\f3pmiUnits\f1,
\f3pmiExtraUnits\f1,
\f3pmiID\f1,
\f3pmiInDom\f1 \- construct core metric data structures
.SH "C SYNOPSIS"
Expand All @@ -35,9 +36,20 @@ pmUnits pmiUnits(int \fIdimSpace\fP,
'in +\w'pmUnits pmiUnits('u
int\ \fIdimTime\fP,
int\ \fIdimCount\fP,
int\ \fIscaleSpace\fP,
int\ \fIscaleTime\fP,
int\ \fIscaleCount\fP);
unsigned\ int\ \fIscaleSpace\fP,
unsigned\ int\ \fIscaleTime\fP,
unsigned\ int\ \fIscaleCount\fP);
.in
.br
pmUnits pmiExtraUnits(int \fIdimSpace\fP,
'in +\w'pmExtraUnits pmiUnits('u
int\ \fIdimTime\fP,
int\ \fIdimCount\fP,
unsigned\ int\ \fIscaleSpace\fP,
unsigned\ int\ \fIscaleTime\fP,
unsigned\ int\ \fIscaleCount\fP,
int \fIextraUnit\fP,
unsigned\ int\ \fIextraScale\fP);
.in
.sp
cc ... \-lpcp_import \-lpcp
Expand All @@ -62,6 +74,17 @@ $\fIscaleSpace\fP,
$\fIscaleTime\fP,
$\fIscaleCount\fP);
.in
.br
$units = pmiExtraUnits($\fIdimSpace\fP,
'in +\w'$units = pmiExtraUnits('u
$\fIdimTime\fP,
$\fIdimCount\fP,
$\fIscaleSpace\fP,
$\fIscaleTime\fP,
$\fIscaleCount\fP,
$\fIextraUnit\fP,
$\fIextraScale\fP);
.in
.hy
.ad
.ft 1
Expand All @@ -85,7 +108,9 @@ for a complete description of the values and semantics of the
components of a
.B pmUnits
structure, and hence the valid argument values for
.BR pmiUnits .
.B pmiUnits
and
.BR pmiExtraUnits .
.SH SEE ALSO
.BR LOGIMPORT (3),
.BR pmiAddMetric (3),
Expand Down
37 changes: 34 additions & 3 deletions man/man3/pmlookupdesc.3
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ encoding as follows.
The dimensionality is defined by a power, or index, in
each of 3 orthogonal dimensions, namely Space, Time and Count
(or Events, which are dimensionless).
Additional ``extra'' units are also available as descibed below.
.PP
For example I/O throughput might be represented as
.ti 1i
.CR "\0\0\0\0\0\0\0\0\0\0-1"
Expand Down Expand Up @@ -193,10 +195,12 @@ structure.
* for Performance Metric Values
*
* For example, a pmUnits struct of
* { 1, \-1, 0, PM_SPACE_MBYTE, PM_TIME_SEC, 0 }
* { 1, \-1, 0, PM_SPACE_MBYTE, PM_TIME_SEC, 0, 0, 0 }
* represents Mbytes/sec, while
* { 0, 1, \-1, 0, PM_TIME_HOUR, 6 }
* represents hours/million-events
* { 0, 1, \-1, 0, PM_TIME_HOUR, 6, 0, 0 }
* represents hours/million-events, and
* { 0, 0, 0, 0, 0, 0, PM_UNIT_VOLTAGE, PM_VOLTAGE_mV }
* represents voltage in units of mV
*/
typedef struct {
int dimSpace:4; /* space dimension */
Expand All @@ -205,6 +209,8 @@ typedef struct {
unsigned int scaleSpace:4; /* one of PM_SPACE_* below */
unsigned int scaleTime:4; /* one of PM_TIME_* below */
int scaleCount:4; /* one of PM_COUNT_* below */
int extraUnit:5; /* code for extra unit from PM_UNIT_* below */
int extraScale:3; /* scale for extra unit */
} pmUnits; /* dimensional units and scale of value */

/* pmUnits.scaleSpace */
Expand All @@ -230,6 +236,31 @@ typedef struct {
* e.g. 6 for 10^6, or \-3 for 10^\-3
*/
#define PM_COUNT_ONE 0 /* 1 */
/*
* the extra unit types are mutually exclusive so at most one one of
* the following extraUnit values may be used for each metric
*/
#define PM_UNIT_TEMPERATURE 1
#define PM_UNIT_VOLTAGE 2
#define PM_UNIT_CURRENT 3
#define PM_UNIT_POWER 4
/*
* scale factors for extra units ... must be > 0 and <= 7 and
* unique for each extra unit type
*/
#define PM_TEMPERATURE_C 1 /* celsius */
#define PM_TEMPERATURE_F 2 /* fahrenheit */
#define PM_TEMPERATURE_K 3 /* kelvin */
#define PM_VOLTAGE_V 1 /* Volt */
#define PM_VOLTAGE_mV 2 /* milli Volt */
#define PM_VOLTAGE_uV 3 /* micro Volt */
#define PM_CURRENT_A 1 /* Ampere */
#define PM_CURRENT_mA 2 /* milli Ampere */
#define PM_CURRENT_uA 3 /* micro Ampere */
#define PM_POWER_kW 1 /* kilo Watt */
#define PM_POWER_W 2 /* Watt */
#define PM_POWER_mW 3 /* milli Watt */
#define PM_POWER_uW 4 /* micro Watt */
.in
.fi
.ft 1
Expand Down
11 changes: 11 additions & 0 deletions man/man3/pmregisterderived.3
Original file line number Diff line number Diff line change
Expand Up @@ -700,6 +700,17 @@ multiplication or division are allowed, or if the left operand is
not a counter and the right operand is a counter, then only multiplication
is allowed.
.PP
Metrics with extra units, like temperature or voltage, are subject
to some additional constraints, specifically no automatic scale
conversion (although the
.ft CR
rescale
.ft R
function works as expected),
extra units cannot be used for both operands in
multiplication (``*'') and extra units are only allowed for
both operands of division (``/'') if the units and scale are identical.
.PP
Because relational expressions use the current value only and produce
a result that is not a counter, either or both operands of a relational expression
may be counters.
Expand Down
Loading
Loading