source: trunk/man/arm_register_metric.3 @ 704

Revision 614, 7.8 KB checked in by dcarter, 4 years ago (diff)

see #111 - Build beta3

Line 
1.\" Copyright (c) 2005-2008 David Carter <dcarter@arm4.org> and others.
2.\" All rights reserved.   This program and the accompanying materials
3.\" are made available under the terms of the Eclipse Public License v1.0
4.\" which accompanies this distribution, and is available at
5.\" http://www.eclipse.org/legal/epl-v10.html
6.TH "arm_register_metric" 3 "August 2008" "arm4.org" "ARM 4 Programmer's Manual"
7.SH NAME
8arm_register_metric \- describe metrics
9.SH SYNOPSIS
10.B #include <arm4.h>
11.sp
12\fBarm_error_t
13.br
14arm_register_metric(
15.br
16    const arm_id_t *\fIapp_id\fB,
17.br
18    const arm_char_t *\fIname\fB,
19.br
20    const arm_metric_format_t \fIformat\fB,
21.br
22    const arm_metric_usage_t \fIusage\fB,
23.br
24    const arm_char_t *\fIunit\fB,
25.br
26    const arm_id_t *\fIinput_metric_id\fB,
27.br
28    const arm_int32_t \fIflags\fB,
29.br
30    const arm_buffer4_t *\fIbuffer4\fB,
31.br
32    arm_id_t *\fIoutput_metric_id\fB);\fR
33.SH DESCRIPTION
34\fBarm_register_metric()\fR describes metadata about a metric.
35
36The application uses \fBarm_register_metric()\fR to inform the ARM library of metadata about each
37metric the application provides.
38
39ARM generates an ID that is passed in the metric binding sub-buffer to
40\fBarm_register_transaction()\fR.
41
42\fIapp_id\fR is an application ID returned from an \fBarm_register_application()\fR call in the same
43process.
44
45\fIbuffer4\fR is a pointer to the user data buffer, if any. If the pointer is null, there is no buffer. No
46sub-buffer types are currently valid with this function call, so the pointer should be
47null (\fBARM_BUF4_NONE\fR).
48 
49\fIflags\fR contains 32-bit flags. No values are currently defined. The field should be zero
50(\fBARM_FLAG_NONE\fR).
51 
52\fIformat\fR describes the data type. The value must be one of the following values:
53 
54.IP 1
55(\fBARM_METRIC_FORMAT_COUNTER32\fR) = arm_int32_t counter
56.IP 2
57(\fBARM_METRIC_FORMAT_COUNTER64\fR) = arm_int64_t counter
58.IP 3
59(\fBARM_METRIC_FORMAT_CNTRDIVR\fR) = arm_int32_t counter + arm_int32_t
60divisor
61.IP 4
62(\fBARM_METRIC_FORMAT_GAUGE32\fR) = arm_int32_t gauge
63.IP 5
64(\fBARM_METRIC_FORMAT_GAUGE64\fR) = arm_int64_t gauge
65.IP 6
66(\fBARM_METRIC_FORMAT_GAUGEDIVR32\fR) = arm_int32_t gauge +
67arm_int32_t divisor
68.IP 7
69(\fBARM_METRIC_FORMAT_NUMERICID32\fR) = arm_int32_t numeric ID
70.IP 8
71(\fBARM_METRIC_FORMAT_NUMERICID64\fR) = arm_int64_t numeric ID
72.IP 9
73deprecated
74.IP 10
75(\fBARM_METRIC_FORMAT_STRING32\fR) = string (null-terminated) of a
76maximum length of 32 characters (33 including the null termination character)
77.P
78\fIinput_metric_id\fR is a pointer to an optional 128-bit ID (16 bytes) that is unique and that can be treated as
79an alias for the other metadata. It can be any value except all zeros or all ones. If the
80pointer is null (\fBARM_ID_NONE\fR), no ID is provided.
81 
82An ID is unique if the probability of the ID being associated with more than one set
83of metadata is vanishingly small. The selection of 128-bit IDs yields 3.4 x 10**38
84unique IDs, so the objective is to select an ID that makes use of all 128 bits and is
85reasonably likely to not be selected by another person creating an ID of the same
86form. Two suggested algorithms that generate 128-bit values with these
87characteristics are:
88 
89.IP 1.
90The Universal Unique Identifier (UUID) algorithm that is part of The Open
91Group specification: DCE 1.1: Remote Procedure Call. A developer could use the
92algorithm at the time the application is developed using a utility on his or her
93system, and be reasonably certain that nobody else would generate the same 128-bit
94ID.
95 
96.IP 2.
97The MD5 Message-Digest Algorithm, described in IETF RFC 1321. Applying
98this algorithm to a concatenation of all the metadata properties would almost
99certainly result in a value that would not collide with any other ID created with a
100different set of metadata properties.
101.P
102If an ARM implementation is passed an ID that was previously registered within
103this process, the implementation can ignore the other metadata parameters and
104assume they are identical to the previously registered metadata. The metric
105metadata consists of the following fields: \fIapp_id\fR, \fIname\fR, \fIformat\fR, \fIusage\fR, and \fIunit\fR.
106 
107\fIname\fR is a pointer to a null-terminated string containing the name of the metric. The maximum
108length of the string is 128 characters, including the termination character. It serves
109no purpose and is illegal to make this call if the pointer is null. The name should not
110contain trailing blank characters or consist of only blank characters.
111 
112The name can be any string, with one exception. Strings beginning with the four
113characters "ARM:" are reserved for the ARM specification. The specification will
114define names with known semantics using this prefix. One name format is currently
115defined. Any name beginning with the eight character prefix "ARM:CIM:"
116represents a name defined using the DMTF CIM (Distributed Management Task
117Force Common Information Model) naming rules. For example,
118"ARM:CIM:CIM_SoftwareElement.Name" indicates that the metric value has the
119semantics of the Name property of the CIM_SoftwareElement class. It is anticipated
120that additional naming semantics are likely to be added in the future.
121
122\fIoutput_metric_id\fR is a pointer to a 16-byte field. ARM will store a 16-byte value. There are no
123requirements on the value it is set to, except that it must be possible to pass it in the
124metric binding sub-buffer on the \fBarm_register_transaction()\fR call, without the
125application needing to do any error checking.
126
127\fIunit\fR is a pointer to a null-terminated string containing the units (such as "files transferred")
128of the metric. The maximum length of the string is 128 characters, including the
129termination character. The pointer may be null.
130
131\fIusage\fR describes how the metric is used. The value must be one of the following values, or
132a negative value (any negative value is specific to the application; the negative
133values are not expected to be widely used).
134 
135.IP 0
136(\fBARM_METRIC_USE_GENERAL\fR) = a metric without a specified usage. Most
137metrics are described with a GENERAL usage.
138.IP 1
139(\fBARM_METRIC_USE_TRAN_SIZE\fR) = a metric that indicates the "size" of a
140transaction. The "size" is something that would be expected to affect the response
141time, such as the number of bytes in a file transfer or the number of files backed up
142by a "backup" transaction. ARM implementations can use this knowledge to better
143interpret the response time.
144.IP 2
145(\fBARM_METRIC_USE_TRAN_STATUS\fR) = a metric that further explains the
146transaction status passed on \fBarm_stop_transaction()\fR, such as a sense code that
147explains why a transaction failed.
148.SH "RETURN VALUE"
149On success, the function returns \fBARM_SUCCESS\fR. A non-zero value indicates
150an error.
151.SH ERRORS
152If the return code is negative, an error occurred. If the return code is not negative, an error may
153or may not have occurred - the determination of what is an error and whether an error code is
154returned is at the discretion of the ARM implementation. The application can test the return code
155if it wants to provide its own error logging.
156
157The following errors are recognized by this implementation, but may not be portable to other implementations:
158
159.TP
160.B ARM_FAILURE_NULL_ARGUMENT
161The \fIoutput_metric_id\fR pointer must not be null.
162.TP
163.B ARM_FAILURE_INVALID_ARGUMENT
164One of \fIname\fR or \fIunit\fR is invalid.
165.TP
166.TP
167.B ARM_FAILURE_BAD_ALIAS
168The alias provided contains all 0's or all 1's.
169.TP
170.B ARM_FAILURE_DUPLICATE_ALIAS
171The alias provided already refers to a metric with different metadata.
172.B ARM_FAILURE_INTERNAL_ERROR
173An internal error has occurred that prevented the operation from completing. Check your
174system log for more details.
175.SH "CONFORMING TO"
176ARM Issue 4.0 C Language Bindings, Version 2
177.SH EXAMPLE
178None.
179.SH "SEE ALSO"
180.BR arm_register_application (3),
181.BR arm_register_transaction (3)
Note: See TracBrowser for help on using the repository browser.