summaryrefslogtreecommitdiff
path: root/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/Metric.php
blob: 3d2538314f0197c5d8ccb2507ee63663a23a974e (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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: opentelemetry/proto/metrics/v1/metrics.proto

namespace Opentelemetry\Proto\Metrics\V1;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * Defines a Metric which has one or more timeseries.  The following is a
 * brief summary of the Metric data model.  For more details, see:
 *   https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/data-model.md
 * The data model and relation between entities is shown in the
 * diagram below. Here, "DataPoint" is the term used to refer to any
 * one of the specific data point value types, and "points" is the term used
 * to refer to any one of the lists of points contained in the Metric.
 * - Metric is composed of a metadata and data.
 * - Metadata part contains a name, description, unit.
 * - Data is one of the possible types (Sum, Gauge, Histogram, Summary).
 * - DataPoint contains timestamps, attributes, and one of the possible value type
 *   fields.
 *     Metric
 *  +------------+
 *  |name        |
 *  |description |
 *  |unit        |     +------------------------------------+
 *  |data        |---> |Gauge, Sum, Histogram, Summary, ... |
 *  +------------+     +------------------------------------+
 *    Data [One of Gauge, Sum, Histogram, Summary, ...]
 *  +-----------+
 *  |...        |  // Metadata about the Data.
 *  |points     |--+
 *  +-----------+  |
 *                 |      +---------------------------+
 *                 |      |DataPoint 1                |
 *                 v      |+------+------+   +------+ |
 *              +-----+   ||label |label |...|label | |
 *              |  1  |-->||value1|value2|...|valueN| |
 *              +-----+   |+------+------+   +------+ |
 *              |  .  |   |+-----+                    |
 *              |  .  |   ||value|                    |
 *              |  .  |   |+-----+                    |
 *              |  .  |   +---------------------------+
 *              |  .  |                   .
 *              |  .  |                   .
 *              |  .  |                   .
 *              |  .  |   +---------------------------+
 *              |  .  |   |DataPoint M                |
 *              +-----+   |+------+------+   +------+ |
 *              |  M  |-->||label |label |...|label | |
 *              +-----+   ||value1|value2|...|valueN| |
 *                        |+------+------+   +------+ |
 *                        |+-----+                    |
 *                        ||value|                    |
 *                        |+-----+                    |
 *                        +---------------------------+
 * Each distinct type of DataPoint represents the output of a specific
 * aggregation function, the result of applying the DataPoint's
 * associated function of to one or more measurements.
 * All DataPoint types have three common fields:
 * - Attributes includes key-value pairs associated with the data point
 * - TimeUnixNano is required, set to the end time of the aggregation
 * - StartTimeUnixNano is optional, but strongly encouraged for DataPoints
 *   having an AggregationTemporality field, as discussed below.
 * Both TimeUnixNano and StartTimeUnixNano values are expressed as
 * UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970.
 * # TimeUnixNano
 * This field is required, having consistent interpretation across
 * DataPoint types.  TimeUnixNano is the moment corresponding to when
 * the data point's aggregate value was captured.
 * Data points with the 0 value for TimeUnixNano SHOULD be rejected
 * by consumers.
 * # StartTimeUnixNano
 * StartTimeUnixNano in general allows detecting when a sequence of
 * observations is unbroken.  This field indicates to consumers the
 * start time for points with cumulative and delta
 * AggregationTemporality, and it should be included whenever possible
 * to support correct rate calculation.  Although it may be omitted
 * when the start time is truly unknown, setting StartTimeUnixNano is
 * strongly encouraged.
 *
 * Generated from protobuf message <code>opentelemetry.proto.metrics.v1.Metric</code>
 */
class Metric extends \Google\Protobuf\Internal\Message
{
    /**
     * name of the metric, including its DNS name prefix. It must be unique.
     *
     * Generated from protobuf field <code>string name = 1;</code>
     */
    protected $name = '';
    /**
     * description of the metric, which can be used in documentation.
     *
     * Generated from protobuf field <code>string description = 2;</code>
     */
    protected $description = '';
    /**
     * unit in which the metric value is reported. Follows the format
     * described by http://unitsofmeasure.org/ucum.html.
     *
     * Generated from protobuf field <code>string unit = 3;</code>
     */
    protected $unit = '';
    protected $data;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           name of the metric, including its DNS name prefix. It must be unique.
     *     @type string $description
     *           description of the metric, which can be used in documentation.
     *     @type string $unit
     *           unit in which the metric value is reported. Follows the format
     *           described by http://unitsofmeasure.org/ucum.html.
     *     @type \Opentelemetry\Proto\Metrics\V1\Gauge $gauge
     *     @type \Opentelemetry\Proto\Metrics\V1\Sum $sum
     *     @type \Opentelemetry\Proto\Metrics\V1\Histogram $histogram
     *     @type \Opentelemetry\Proto\Metrics\V1\ExponentialHistogram $exponential_histogram
     *     @type \Opentelemetry\Proto\Metrics\V1\Summary $summary
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Opentelemetry\Proto\Metrics\V1\Metrics::initOnce();
        parent::__construct($data);
    }

    /**
     * name of the metric, including its DNS name prefix. It must be unique.
     *
     * Generated from protobuf field <code>string name = 1;</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * name of the metric, including its DNS name prefix. It must be unique.
     *
     * Generated from protobuf field <code>string name = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * description of the metric, which can be used in documentation.
     *
     * Generated from protobuf field <code>string description = 2;</code>
     * @return string
     */
    public function getDescription()
    {
        return $this->description;
    }

    /**
     * description of the metric, which can be used in documentation.
     *
     * Generated from protobuf field <code>string description = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setDescription($var)
    {
        GPBUtil::checkString($var, True);
        $this->description = $var;

        return $this;
    }

    /**
     * unit in which the metric value is reported. Follows the format
     * described by http://unitsofmeasure.org/ucum.html.
     *
     * Generated from protobuf field <code>string unit = 3;</code>
     * @return string
     */
    public function getUnit()
    {
        return $this->unit;
    }

    /**
     * unit in which the metric value is reported. Follows the format
     * described by http://unitsofmeasure.org/ucum.html.
     *
     * Generated from protobuf field <code>string unit = 3;</code>
     * @param string $var
     * @return $this
     */
    public function setUnit($var)
    {
        GPBUtil::checkString($var, True);
        $this->unit = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>.opentelemetry.proto.metrics.v1.Gauge gauge = 5;</code>
     * @return \Opentelemetry\Proto\Metrics\V1\Gauge|null
     */
    public function getGauge()
    {
        return $this->readOneof(5);
    }

    public function hasGauge()
    {
        return $this->hasOneof(5);
    }

    /**
     * Generated from protobuf field <code>.opentelemetry.proto.metrics.v1.Gauge gauge = 5;</code>
     * @param \Opentelemetry\Proto\Metrics\V1\Gauge $var
     * @return $this
     */
    public function setGauge($var)
    {
        GPBUtil::checkMessage($var, \Opentelemetry\Proto\Metrics\V1\Gauge::class);
        $this->writeOneof(5, $var);

        return $this;
    }

    /**
     * Generated from protobuf field <code>.opentelemetry.proto.metrics.v1.Sum sum = 7;</code>
     * @return \Opentelemetry\Proto\Metrics\V1\Sum|null
     */
    public function getSum()
    {
        return $this->readOneof(7);
    }

    public function hasSum()
    {
        return $this->hasOneof(7);
    }

    /**
     * Generated from protobuf field <code>.opentelemetry.proto.metrics.v1.Sum sum = 7;</code>
     * @param \Opentelemetry\Proto\Metrics\V1\Sum $var
     * @return $this
     */
    public function setSum($var)
    {
        GPBUtil::checkMessage($var, \Opentelemetry\Proto\Metrics\V1\Sum::class);
        $this->writeOneof(7, $var);

        return $this;
    }

    /**
     * Generated from protobuf field <code>.opentelemetry.proto.metrics.v1.Histogram histogram = 9;</code>
     * @return \Opentelemetry\Proto\Metrics\V1\Histogram|null
     */
    public function getHistogram()
    {
        return $this->readOneof(9);
    }

    public function hasHistogram()
    {
        return $this->hasOneof(9);
    }

    /**
     * Generated from protobuf field <code>.opentelemetry.proto.metrics.v1.Histogram histogram = 9;</code>
     * @param \Opentelemetry\Proto\Metrics\V1\Histogram $var
     * @return $this
     */
    public function setHistogram($var)
    {
        GPBUtil::checkMessage($var, \Opentelemetry\Proto\Metrics\V1\Histogram::class);
        $this->writeOneof(9, $var);

        return $this;
    }

    /**
     * Generated from protobuf field <code>.opentelemetry.proto.metrics.v1.ExponentialHistogram exponential_histogram = 10;</code>
     * @return \Opentelemetry\Proto\Metrics\V1\ExponentialHistogram|null
     */
    public function getExponentialHistogram()
    {
        return $this->readOneof(10);
    }

    public function hasExponentialHistogram()
    {
        return $this->hasOneof(10);
    }

    /**
     * Generated from protobuf field <code>.opentelemetry.proto.metrics.v1.ExponentialHistogram exponential_histogram = 10;</code>
     * @param \Opentelemetry\Proto\Metrics\V1\ExponentialHistogram $var
     * @return $this
     */
    public function setExponentialHistogram($var)
    {
        GPBUtil::checkMessage($var, \Opentelemetry\Proto\Metrics\V1\ExponentialHistogram::class);
        $this->writeOneof(10, $var);

        return $this;
    }

    /**
     * Generated from protobuf field <code>.opentelemetry.proto.metrics.v1.Summary summary = 11;</code>
     * @return \Opentelemetry\Proto\Metrics\V1\Summary|null
     */
    public function getSummary()
    {
        return $this->readOneof(11);
    }

    public function hasSummary()
    {
        return $this->hasOneof(11);
    }

    /**
     * Generated from protobuf field <code>.opentelemetry.proto.metrics.v1.Summary summary = 11;</code>
     * @param \Opentelemetry\Proto\Metrics\V1\Summary $var
     * @return $this
     */
    public function setSummary($var)
    {
        GPBUtil::checkMessage($var, \Opentelemetry\Proto\Metrics\V1\Summary::class);
        $this->writeOneof(11, $var);

        return $this;
    }

    /**
     * @return string
     */
    public function getData()
    {
        return $this->whichOneof("data");
    }

}