summaryrefslogtreecommitdiff
path: root/man/man3/pmstore.3
blob: 6370385018e3304664e442c292a497541ae13bb4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
'\"macro stdmacro
.\"
.\" Copyright (c) 2000-2004 Silicon Graphics, Inc.  All Rights Reserved.
.\" 
.\" This program is free software; you can redistribute it and/or modify it
.\" under the terms of the GNU General Public License as published by the
.\" Free Software Foundation; either version 2 of the License, or (at your
.\" option) any later version.
.\" 
.\" This program is distributed in the hope that it will be useful, but
.\" WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
.\" or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
.\" for more details.
.\" 
.\"
.TH PMSTORE 3 "PCP" "Performance Co-Pilot"
.SH NAME
\f3pmStore\f1 \- modify values of performance metrics
.SH "C SYNOPSIS"
.ft 3
#include <pcp/pmapi.h>
.sp
.nf
int pmStore(const pmResult *\fIresult\fP);
.fi
.sp
cc ... \-lpcp
.ft 1
.SH DESCRIPTION
.de CW
.ie t \f(CW\\$1\f1\\$2
.el \fI\\$1\f1\\$2
..
In some special cases it may be helpful to modify the current values of
performance metrics,
e.g. to reset a counter to zero, or to modify a ``metric'' which is a control
variable for some agent collecting performance metrics.
.PP
The routine
.B pmStore
is a lightweight inverse of
.BR pmFetch (3).
.PP
The caller must build the
.CW pmResult 
data structure (of course, this could have been returned from an earlier
.BR pmFetch (3)
call) and then call
.BR pmStore .
.PP
It is an error to pass a request to
.B pmStore
in which the
.CW numval
field within any of the
.B pmValueSet
structure has a value less than one.
.PP
The current
Performance Metrics Application Programming Interface (PMAPI)
context must be one with a host as the source of metrics, and the
current value of the nominated metrics will be changed, i.e.
.B pmStore
cannot be used to make retrospective changes to information in either
the archive logs, or in the recent past for real-time sources of metrics.
.PP
The return code from
.B pmStore
is zero for success.
.SH SEE ALSO
.BR PMAPI (3),
.BR pmFetch (3)
and
.BR pmSetMode (3).
.SH DIAGNOSTICS
.IP \f3PM_ERR_GENERIC\f1
At least one of the modifications was rejected.
No other status is available
from below the PMAPI (this is the lightweight part of the functionality!).  In
cases where the outcome of
.B pmStore
for individual metrics is important, the caller should make one call to
.B pmStore
for each metric. On the other hand, a bulk modification can be performed in a
single
.B pmStore
call for situations in which the outcome is not critical.
.IP \f3PM_ERR_NOTHOST\f1
The current PMAPI context is an archive rather than a host, or it
is a host that is not set to the current time, i.e. has been ``rewound''
to the recent past using
.BR pmSetMode (3).
.IP \f3PM_ERR_TOOSMALL\f1
The number of metrics specified in
.I result
is less than one.
.IP \f3PM_ERR_VALUE\f1
One or more of the
.CW pmValueSet s
in
.I result
has a
.CW numval
field with a value less than one.