PluginProbe ʕ •ᴥ•ʔ
ShareThis Dashboard for Google Analytics / 3.2.2
ShareThis Dashboard for Google Analytics v3.2.2
3.3.2 trunk 1.0.7 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.1 2.1.2 2.1.3 2.1.4 2.1.5 2.2.5 2.3.5 2.3.6 2.3.7 2.3.8 2.4.0 2.4.1 2.5.0 2.5.1 2.5.2 2.5.3 2.5.4 2.5.5 3.0.0 3.1.0 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.2.0 3.2.1 3.2.2 3.2.3 3.2.4 3.3.0 3.3.1
googleanalytics / lib / analytics-admin / vendor / google / common-protos / src / Api / MetricDescriptor.php
googleanalytics / lib / analytics-admin / vendor / google / common-protos / src / Api Last commit date
BackendRule 3 years ago Billing 3 years ago Distribution 3 years ago Expr 3 years ago LabelDescriptor 3 years ago Logging 3 years ago MetricDescriptor 3 years ago Monitoring 3 years ago Property 3 years ago ResourceDescriptor 3 years ago Advice.php 3 years ago AuthProvider.php 3 years ago AuthRequirement.php 3 years ago Authentication.php 3 years ago AuthenticationRule.php 3 years ago Backend.php 3 years ago BackendRule.php 3 years ago BackendRule_PathTranslation.php 3 years ago Billing.php 3 years ago Billing_BillingDestination.php 3 years ago ChangeType.php 3 years ago ConfigChange.php 3 years ago Context.php 3 years ago ContextRule.php 3 years ago Control.php 3 years ago CustomHttpPattern.php 3 years ago Distribution.php 3 years ago Distribution_BucketOptions.php 3 years ago Distribution_BucketOptions_Explicit.php 3 years ago Distribution_BucketOptions_Exponential.php 3 years ago Distribution_BucketOptions_Linear.php 3 years ago Distribution_Exemplar.php 3 years ago Distribution_Range.php 3 years ago Documentation.php 3 years ago DocumentationRule.php 3 years ago Endpoint.php 3 years ago FieldBehavior.php 3 years ago Http.php 3 years ago HttpBody.php 3 years ago HttpRule.php 3 years ago LabelDescriptor.php 3 years ago LabelDescriptor_ValueType.php 3 years ago LaunchStage.php 3 years ago LogDescriptor.php 3 years ago Logging.php 3 years ago Logging_LoggingDestination.php 3 years ago Metric.php 3 years ago MetricDescriptor.php 3 years ago MetricDescriptor_MetricDescriptorMetadata.php 3 years ago MetricDescriptor_MetricKind.php 3 years ago MetricDescriptor_ValueType.php 3 years ago MetricRule.php 3 years ago MonitoredResource.php 3 years ago MonitoredResourceDescriptor.php 3 years ago MonitoredResourceMetadata.php 3 years ago Monitoring.php 3 years ago Monitoring_MonitoringDestination.php 3 years ago OAuthRequirements.php 3 years ago Page.php 3 years ago ProjectProperties.php 3 years ago Property.php 3 years ago Property_PropertyType.php 3 years ago Quota.php 3 years ago QuotaLimit.php 3 years ago ResourceDescriptor.php 3 years ago ResourceDescriptor_History.php 3 years ago ResourceReference.php 3 years ago RoutingParameter.php 3 years ago RoutingRule.php 3 years ago Service.php 3 years ago SourceInfo.php 3 years ago SystemParameter.php 3 years ago SystemParameterRule.php 3 years ago SystemParameters.php 3 years ago Usage.php 3 years ago UsageRule.php 3 years ago
MetricDescriptor.php
764 lines
1 <?php
2 # Generated by the protocol buffer compiler. DO NOT EDIT!
3 # source: google/api/metric.proto
4
5 namespace Google\Api;
6
7 use Google\Protobuf\Internal\GPBType;
8 use Google\Protobuf\Internal\RepeatedField;
9 use Google\Protobuf\Internal\GPBUtil;
10
11 /**
12 * Defines a metric type and its schema. Once a metric descriptor is created,
13 * deleting or altering it stops data collection and makes the metric type's
14 * existing data unusable.
15 *
16 * Generated from protobuf message <code>google.api.MetricDescriptor</code>
17 */
18 class MetricDescriptor extends \Google\Protobuf\Internal\Message
19 {
20 /**
21 * The resource name of the metric descriptor.
22 *
23 * Generated from protobuf field <code>string name = 1;</code>
24 */
25 private $name = '';
26 /**
27 * The metric type, including its DNS name prefix. The type is not
28 * URL-encoded. All user-defined metric types have the DNS name
29 * `custom.googleapis.com` or `external.googleapis.com`. Metric types should
30 * use a natural hierarchical grouping. For example:
31 * "custom.googleapis.com/invoice/paid/amount"
32 * "external.googleapis.com/prometheus/up"
33 * "appengine.googleapis.com/http/server/response_latencies"
34 *
35 * Generated from protobuf field <code>string type = 8;</code>
36 */
37 private $type = '';
38 /**
39 * The set of labels that can be used to describe a specific
40 * instance of this metric type. For example, the
41 * `appengine.googleapis.com/http/server/response_latencies` metric
42 * type has a label for the HTTP response code, `response_code`, so
43 * you can look at latencies for successful responses or just
44 * for responses that failed.
45 *
46 * Generated from protobuf field <code>repeated .google.api.LabelDescriptor labels = 2;</code>
47 */
48 private $labels;
49 /**
50 * Whether the metric records instantaneous values, changes to a value, etc.
51 * Some combinations of `metric_kind` and `value_type` might not be supported.
52 *
53 * Generated from protobuf field <code>.google.api.MetricDescriptor.MetricKind metric_kind = 3;</code>
54 */
55 private $metric_kind = 0;
56 /**
57 * Whether the measurement is an integer, a floating-point number, etc.
58 * Some combinations of `metric_kind` and `value_type` might not be supported.
59 *
60 * Generated from protobuf field <code>.google.api.MetricDescriptor.ValueType value_type = 4;</code>
61 */
62 private $value_type = 0;
63 /**
64 * The units in which the metric value is reported. It is only applicable
65 * if the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The `unit`
66 * defines the representation of the stored metric values.
67 * Different systems may scale the values to be more easily displayed (so a
68 * value of `0.02KBy` _might_ be displayed as `20By`, and a value of
69 * `3523KBy` _might_ be displayed as `3.5MBy`). However, if the `unit` is
70 * `KBy`, then the value of the metric is always in thousands of bytes, no
71 * matter how it may be displayed..
72 * If you want a custom metric to record the exact number of CPU-seconds used
73 * by a job, you can create an `INT64 CUMULATIVE` metric whose `unit` is
74 * `s{CPU}` (or equivalently `1s{CPU}` or just `s`). If the job uses 12,005
75 * CPU-seconds, then the value is written as `12005`.
76 * Alternatively, if you want a custome metric to record data in a more
77 * granular way, you can create a `DOUBLE CUMULATIVE` metric whose `unit` is
78 * `ks{CPU}`, and then write the value `12.005` (which is `12005/1000`),
79 * or use `Kis{CPU}` and write `11.723` (which is `12005/1024`).
80 * The supported units are a subset of [The Unified Code for Units of
81 * Measure](http://unitsofmeasure.org/ucum.html) standard:
82 * **Basic units (UNIT)**
83 * * `bit` bit
84 * * `By` byte
85 * * `s` second
86 * * `min` minute
87 * * `h` hour
88 * * `d` day
89 * **Prefixes (PREFIX)**
90 * * `k` kilo (10^3)
91 * * `M` mega (10^6)
92 * * `G` giga (10^9)
93 * * `T` tera (10^12)
94 * * `P` peta (10^15)
95 * * `E` exa (10^18)
96 * * `Z` zetta (10^21)
97 * * `Y` yotta (10^24)
98 * * `m` milli (10^-3)
99 * * `u` micro (10^-6)
100 * * `n` nano (10^-9)
101 * * `p` pico (10^-12)
102 * * `f` femto (10^-15)
103 * * `a` atto (10^-18)
104 * * `z` zepto (10^-21)
105 * * `y` yocto (10^-24)
106 * * `Ki` kibi (2^10)
107 * * `Mi` mebi (2^20)
108 * * `Gi` gibi (2^30)
109 * * `Ti` tebi (2^40)
110 * * `Pi` pebi (2^50)
111 * **Grammar**
112 * The grammar also includes these connectors:
113 * * `/` division or ratio (as an infix operator). For examples,
114 * `kBy/{email}` or `MiBy/10ms` (although you should almost never
115 * have `/s` in a metric `unit`; rates should always be computed at
116 * query time from the underlying cumulative or delta value).
117 * * `.` multiplication or composition (as an infix operator). For
118 * examples, `GBy.d` or `k{watt}.h`.
119 * The grammar for a unit is as follows:
120 * Expression = Component { "." Component } { "/" Component } ;
121 * Component = ( [ PREFIX ] UNIT | "%" ) [ Annotation ]
122 * | Annotation
123 * | "1"
124 * ;
125 * Annotation = "{" NAME "}" ;
126 * Notes:
127 * * `Annotation` is just a comment if it follows a `UNIT`. If the annotation
128 * is used alone, then the unit is equivalent to `1`. For examples,
129 * `{request}/s == 1/s`, `By{transmitted}/s == By/s`.
130 * * `NAME` is a sequence of non-blank printable ASCII characters not
131 * containing `{` or `}`.
132 * * `1` represents a unitary [dimensionless
133 * unit](https://en.wikipedia.org/wiki/Dimensionless_quantity) of 1, such
134 * as in `1/s`. It is typically used when none of the basic units are
135 * appropriate. For example, "new users per day" can be represented as
136 * `1/d` or `{new-users}/d` (and a metric value `5` would mean "5 new
137 * users). Alternatively, "thousands of page views per day" would be
138 * represented as `1000/d` or `k1/d` or `k{page_views}/d` (and a metric
139 * value of `5.3` would mean "5300 page views per day").
140 * * `%` represents dimensionless value of 1/100, and annotates values giving
141 * a percentage (so the metric values are typically in the range of 0..100,
142 * and a metric value `3` means "3 percent").
143 * * `10^2.%` indicates a metric contains a ratio, typically in the range
144 * 0..1, that will be multiplied by 100 and displayed as a percentage
145 * (so a metric value `0.03` means "3 percent").
146 *
147 * Generated from protobuf field <code>string unit = 5;</code>
148 */
149 private $unit = '';
150 /**
151 * A detailed description of the metric, which can be used in documentation.
152 *
153 * Generated from protobuf field <code>string description = 6;</code>
154 */
155 private $description = '';
156 /**
157 * A concise name for the metric, which can be displayed in user interfaces.
158 * Use sentence case without an ending period, for example "Request count".
159 * This field is optional but it is recommended to be set for any metrics
160 * associated with user-visible concepts, such as Quota.
161 *
162 * Generated from protobuf field <code>string display_name = 7;</code>
163 */
164 private $display_name = '';
165 /**
166 * Optional. Metadata which can be used to guide usage of the metric.
167 *
168 * Generated from protobuf field <code>.google.api.MetricDescriptor.MetricDescriptorMetadata metadata = 10;</code>
169 */
170 private $metadata = null;
171 /**
172 * Optional. The launch stage of the metric definition.
173 *
174 * Generated from protobuf field <code>.google.api.LaunchStage launch_stage = 12;</code>
175 */
176 private $launch_stage = 0;
177
178 /**
179 * Constructor.
180 *
181 * @param array $data {
182 * Optional. Data for populating the Message object.
183 *
184 * @type string $name
185 * The resource name of the metric descriptor.
186 * @type string $type
187 * The metric type, including its DNS name prefix. The type is not
188 * URL-encoded. All user-defined metric types have the DNS name
189 * `custom.googleapis.com` or `external.googleapis.com`. Metric types should
190 * use a natural hierarchical grouping. For example:
191 * "custom.googleapis.com/invoice/paid/amount"
192 * "external.googleapis.com/prometheus/up"
193 * "appengine.googleapis.com/http/server/response_latencies"
194 * @type \Google\Api\LabelDescriptor[]|\Google\Protobuf\Internal\RepeatedField $labels
195 * The set of labels that can be used to describe a specific
196 * instance of this metric type. For example, the
197 * `appengine.googleapis.com/http/server/response_latencies` metric
198 * type has a label for the HTTP response code, `response_code`, so
199 * you can look at latencies for successful responses or just
200 * for responses that failed.
201 * @type int $metric_kind
202 * Whether the metric records instantaneous values, changes to a value, etc.
203 * Some combinations of `metric_kind` and `value_type` might not be supported.
204 * @type int $value_type
205 * Whether the measurement is an integer, a floating-point number, etc.
206 * Some combinations of `metric_kind` and `value_type` might not be supported.
207 * @type string $unit
208 * The units in which the metric value is reported. It is only applicable
209 * if the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The `unit`
210 * defines the representation of the stored metric values.
211 * Different systems may scale the values to be more easily displayed (so a
212 * value of `0.02KBy` _might_ be displayed as `20By`, and a value of
213 * `3523KBy` _might_ be displayed as `3.5MBy`). However, if the `unit` is
214 * `KBy`, then the value of the metric is always in thousands of bytes, no
215 * matter how it may be displayed..
216 * If you want a custom metric to record the exact number of CPU-seconds used
217 * by a job, you can create an `INT64 CUMULATIVE` metric whose `unit` is
218 * `s{CPU}` (or equivalently `1s{CPU}` or just `s`). If the job uses 12,005
219 * CPU-seconds, then the value is written as `12005`.
220 * Alternatively, if you want a custome metric to record data in a more
221 * granular way, you can create a `DOUBLE CUMULATIVE` metric whose `unit` is
222 * `ks{CPU}`, and then write the value `12.005` (which is `12005/1000`),
223 * or use `Kis{CPU}` and write `11.723` (which is `12005/1024`).
224 * The supported units are a subset of [The Unified Code for Units of
225 * Measure](http://unitsofmeasure.org/ucum.html) standard:
226 * **Basic units (UNIT)**
227 * * `bit` bit
228 * * `By` byte
229 * * `s` second
230 * * `min` minute
231 * * `h` hour
232 * * `d` day
233 * **Prefixes (PREFIX)**
234 * * `k` kilo (10^3)
235 * * `M` mega (10^6)
236 * * `G` giga (10^9)
237 * * `T` tera (10^12)
238 * * `P` peta (10^15)
239 * * `E` exa (10^18)
240 * * `Z` zetta (10^21)
241 * * `Y` yotta (10^24)
242 * * `m` milli (10^-3)
243 * * `u` micro (10^-6)
244 * * `n` nano (10^-9)
245 * * `p` pico (10^-12)
246 * * `f` femto (10^-15)
247 * * `a` atto (10^-18)
248 * * `z` zepto (10^-21)
249 * * `y` yocto (10^-24)
250 * * `Ki` kibi (2^10)
251 * * `Mi` mebi (2^20)
252 * * `Gi` gibi (2^30)
253 * * `Ti` tebi (2^40)
254 * * `Pi` pebi (2^50)
255 * **Grammar**
256 * The grammar also includes these connectors:
257 * * `/` division or ratio (as an infix operator). For examples,
258 * `kBy/{email}` or `MiBy/10ms` (although you should almost never
259 * have `/s` in a metric `unit`; rates should always be computed at
260 * query time from the underlying cumulative or delta value).
261 * * `.` multiplication or composition (as an infix operator). For
262 * examples, `GBy.d` or `k{watt}.h`.
263 * The grammar for a unit is as follows:
264 * Expression = Component { "." Component } { "/" Component } ;
265 * Component = ( [ PREFIX ] UNIT | "%" ) [ Annotation ]
266 * | Annotation
267 * | "1"
268 * ;
269 * Annotation = "{" NAME "}" ;
270 * Notes:
271 * * `Annotation` is just a comment if it follows a `UNIT`. If the annotation
272 * is used alone, then the unit is equivalent to `1`. For examples,
273 * `{request}/s == 1/s`, `By{transmitted}/s == By/s`.
274 * * `NAME` is a sequence of non-blank printable ASCII characters not
275 * containing `{` or `}`.
276 * * `1` represents a unitary [dimensionless
277 * unit](https://en.wikipedia.org/wiki/Dimensionless_quantity) of 1, such
278 * as in `1/s`. It is typically used when none of the basic units are
279 * appropriate. For example, "new users per day" can be represented as
280 * `1/d` or `{new-users}/d` (and a metric value `5` would mean "5 new
281 * users). Alternatively, "thousands of page views per day" would be
282 * represented as `1000/d` or `k1/d` or `k{page_views}/d` (and a metric
283 * value of `5.3` would mean "5300 page views per day").
284 * * `%` represents dimensionless value of 1/100, and annotates values giving
285 * a percentage (so the metric values are typically in the range of 0..100,
286 * and a metric value `3` means "3 percent").
287 * * `10^2.%` indicates a metric contains a ratio, typically in the range
288 * 0..1, that will be multiplied by 100 and displayed as a percentage
289 * (so a metric value `0.03` means "3 percent").
290 * @type string $description
291 * A detailed description of the metric, which can be used in documentation.
292 * @type string $display_name
293 * A concise name for the metric, which can be displayed in user interfaces.
294 * Use sentence case without an ending period, for example "Request count".
295 * This field is optional but it is recommended to be set for any metrics
296 * associated with user-visible concepts, such as Quota.
297 * @type \Google\Api\MetricDescriptor\MetricDescriptorMetadata $metadata
298 * Optional. Metadata which can be used to guide usage of the metric.
299 * @type int $launch_stage
300 * Optional. The launch stage of the metric definition.
301 * }
302 */
303 public function __construct($data = NULL) {
304 \GPBMetadata\Google\Api\Metric::initOnce();
305 parent::__construct($data);
306 }
307
308 /**
309 * The resource name of the metric descriptor.
310 *
311 * Generated from protobuf field <code>string name = 1;</code>
312 * @return string
313 */
314 public function getName()
315 {
316 return $this->name;
317 }
318
319 /**
320 * The resource name of the metric descriptor.
321 *
322 * Generated from protobuf field <code>string name = 1;</code>
323 * @param string $var
324 * @return $this
325 */
326 public function setName($var)
327 {
328 GPBUtil::checkString($var, True);
329 $this->name = $var;
330
331 return $this;
332 }
333
334 /**
335 * The metric type, including its DNS name prefix. The type is not
336 * URL-encoded. All user-defined metric types have the DNS name
337 * `custom.googleapis.com` or `external.googleapis.com`. Metric types should
338 * use a natural hierarchical grouping. For example:
339 * "custom.googleapis.com/invoice/paid/amount"
340 * "external.googleapis.com/prometheus/up"
341 * "appengine.googleapis.com/http/server/response_latencies"
342 *
343 * Generated from protobuf field <code>string type = 8;</code>
344 * @return string
345 */
346 public function getType()
347 {
348 return $this->type;
349 }
350
351 /**
352 * The metric type, including its DNS name prefix. The type is not
353 * URL-encoded. All user-defined metric types have the DNS name
354 * `custom.googleapis.com` or `external.googleapis.com`. Metric types should
355 * use a natural hierarchical grouping. For example:
356 * "custom.googleapis.com/invoice/paid/amount"
357 * "external.googleapis.com/prometheus/up"
358 * "appengine.googleapis.com/http/server/response_latencies"
359 *
360 * Generated from protobuf field <code>string type = 8;</code>
361 * @param string $var
362 * @return $this
363 */
364 public function setType($var)
365 {
366 GPBUtil::checkString($var, True);
367 $this->type = $var;
368
369 return $this;
370 }
371
372 /**
373 * The set of labels that can be used to describe a specific
374 * instance of this metric type. For example, the
375 * `appengine.googleapis.com/http/server/response_latencies` metric
376 * type has a label for the HTTP response code, `response_code`, so
377 * you can look at latencies for successful responses or just
378 * for responses that failed.
379 *
380 * Generated from protobuf field <code>repeated .google.api.LabelDescriptor labels = 2;</code>
381 * @return \Google\Protobuf\Internal\RepeatedField
382 */
383 public function getLabels()
384 {
385 return $this->labels;
386 }
387
388 /**
389 * The set of labels that can be used to describe a specific
390 * instance of this metric type. For example, the
391 * `appengine.googleapis.com/http/server/response_latencies` metric
392 * type has a label for the HTTP response code, `response_code`, so
393 * you can look at latencies for successful responses or just
394 * for responses that failed.
395 *
396 * Generated from protobuf field <code>repeated .google.api.LabelDescriptor labels = 2;</code>
397 * @param \Google\Api\LabelDescriptor[]|\Google\Protobuf\Internal\RepeatedField $var
398 * @return $this
399 */
400 public function setLabels($var)
401 {
402 $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Api\LabelDescriptor::class);
403 $this->labels = $arr;
404
405 return $this;
406 }
407
408 /**
409 * Whether the metric records instantaneous values, changes to a value, etc.
410 * Some combinations of `metric_kind` and `value_type` might not be supported.
411 *
412 * Generated from protobuf field <code>.google.api.MetricDescriptor.MetricKind metric_kind = 3;</code>
413 * @return int
414 */
415 public function getMetricKind()
416 {
417 return $this->metric_kind;
418 }
419
420 /**
421 * Whether the metric records instantaneous values, changes to a value, etc.
422 * Some combinations of `metric_kind` and `value_type` might not be supported.
423 *
424 * Generated from protobuf field <code>.google.api.MetricDescriptor.MetricKind metric_kind = 3;</code>
425 * @param int $var
426 * @return $this
427 */
428 public function setMetricKind($var)
429 {
430 GPBUtil::checkEnum($var, \Google\Api\MetricDescriptor_MetricKind::class);
431 $this->metric_kind = $var;
432
433 return $this;
434 }
435
436 /**
437 * Whether the measurement is an integer, a floating-point number, etc.
438 * Some combinations of `metric_kind` and `value_type` might not be supported.
439 *
440 * Generated from protobuf field <code>.google.api.MetricDescriptor.ValueType value_type = 4;</code>
441 * @return int
442 */
443 public function getValueType()
444 {
445 return $this->value_type;
446 }
447
448 /**
449 * Whether the measurement is an integer, a floating-point number, etc.
450 * Some combinations of `metric_kind` and `value_type` might not be supported.
451 *
452 * Generated from protobuf field <code>.google.api.MetricDescriptor.ValueType value_type = 4;</code>
453 * @param int $var
454 * @return $this
455 */
456 public function setValueType($var)
457 {
458 GPBUtil::checkEnum($var, \Google\Api\MetricDescriptor_ValueType::class);
459 $this->value_type = $var;
460
461 return $this;
462 }
463
464 /**
465 * The units in which the metric value is reported. It is only applicable
466 * if the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The `unit`
467 * defines the representation of the stored metric values.
468 * Different systems may scale the values to be more easily displayed (so a
469 * value of `0.02KBy` _might_ be displayed as `20By`, and a value of
470 * `3523KBy` _might_ be displayed as `3.5MBy`). However, if the `unit` is
471 * `KBy`, then the value of the metric is always in thousands of bytes, no
472 * matter how it may be displayed..
473 * If you want a custom metric to record the exact number of CPU-seconds used
474 * by a job, you can create an `INT64 CUMULATIVE` metric whose `unit` is
475 * `s{CPU}` (or equivalently `1s{CPU}` or just `s`). If the job uses 12,005
476 * CPU-seconds, then the value is written as `12005`.
477 * Alternatively, if you want a custome metric to record data in a more
478 * granular way, you can create a `DOUBLE CUMULATIVE` metric whose `unit` is
479 * `ks{CPU}`, and then write the value `12.005` (which is `12005/1000`),
480 * or use `Kis{CPU}` and write `11.723` (which is `12005/1024`).
481 * The supported units are a subset of [The Unified Code for Units of
482 * Measure](http://unitsofmeasure.org/ucum.html) standard:
483 * **Basic units (UNIT)**
484 * * `bit` bit
485 * * `By` byte
486 * * `s` second
487 * * `min` minute
488 * * `h` hour
489 * * `d` day
490 * **Prefixes (PREFIX)**
491 * * `k` kilo (10^3)
492 * * `M` mega (10^6)
493 * * `G` giga (10^9)
494 * * `T` tera (10^12)
495 * * `P` peta (10^15)
496 * * `E` exa (10^18)
497 * * `Z` zetta (10^21)
498 * * `Y` yotta (10^24)
499 * * `m` milli (10^-3)
500 * * `u` micro (10^-6)
501 * * `n` nano (10^-9)
502 * * `p` pico (10^-12)
503 * * `f` femto (10^-15)
504 * * `a` atto (10^-18)
505 * * `z` zepto (10^-21)
506 * * `y` yocto (10^-24)
507 * * `Ki` kibi (2^10)
508 * * `Mi` mebi (2^20)
509 * * `Gi` gibi (2^30)
510 * * `Ti` tebi (2^40)
511 * * `Pi` pebi (2^50)
512 * **Grammar**
513 * The grammar also includes these connectors:
514 * * `/` division or ratio (as an infix operator). For examples,
515 * `kBy/{email}` or `MiBy/10ms` (although you should almost never
516 * have `/s` in a metric `unit`; rates should always be computed at
517 * query time from the underlying cumulative or delta value).
518 * * `.` multiplication or composition (as an infix operator). For
519 * examples, `GBy.d` or `k{watt}.h`.
520 * The grammar for a unit is as follows:
521 * Expression = Component { "." Component } { "/" Component } ;
522 * Component = ( [ PREFIX ] UNIT | "%" ) [ Annotation ]
523 * | Annotation
524 * | "1"
525 * ;
526 * Annotation = "{" NAME "}" ;
527 * Notes:
528 * * `Annotation` is just a comment if it follows a `UNIT`. If the annotation
529 * is used alone, then the unit is equivalent to `1`. For examples,
530 * `{request}/s == 1/s`, `By{transmitted}/s == By/s`.
531 * * `NAME` is a sequence of non-blank printable ASCII characters not
532 * containing `{` or `}`.
533 * * `1` represents a unitary [dimensionless
534 * unit](https://en.wikipedia.org/wiki/Dimensionless_quantity) of 1, such
535 * as in `1/s`. It is typically used when none of the basic units are
536 * appropriate. For example, "new users per day" can be represented as
537 * `1/d` or `{new-users}/d` (and a metric value `5` would mean "5 new
538 * users). Alternatively, "thousands of page views per day" would be
539 * represented as `1000/d` or `k1/d` or `k{page_views}/d` (and a metric
540 * value of `5.3` would mean "5300 page views per day").
541 * * `%` represents dimensionless value of 1/100, and annotates values giving
542 * a percentage (so the metric values are typically in the range of 0..100,
543 * and a metric value `3` means "3 percent").
544 * * `10^2.%` indicates a metric contains a ratio, typically in the range
545 * 0..1, that will be multiplied by 100 and displayed as a percentage
546 * (so a metric value `0.03` means "3 percent").
547 *
548 * Generated from protobuf field <code>string unit = 5;</code>
549 * @return string
550 */
551 public function getUnit()
552 {
553 return $this->unit;
554 }
555
556 /**
557 * The units in which the metric value is reported. It is only applicable
558 * if the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The `unit`
559 * defines the representation of the stored metric values.
560 * Different systems may scale the values to be more easily displayed (so a
561 * value of `0.02KBy` _might_ be displayed as `20By`, and a value of
562 * `3523KBy` _might_ be displayed as `3.5MBy`). However, if the `unit` is
563 * `KBy`, then the value of the metric is always in thousands of bytes, no
564 * matter how it may be displayed..
565 * If you want a custom metric to record the exact number of CPU-seconds used
566 * by a job, you can create an `INT64 CUMULATIVE` metric whose `unit` is
567 * `s{CPU}` (or equivalently `1s{CPU}` or just `s`). If the job uses 12,005
568 * CPU-seconds, then the value is written as `12005`.
569 * Alternatively, if you want a custome metric to record data in a more
570 * granular way, you can create a `DOUBLE CUMULATIVE` metric whose `unit` is
571 * `ks{CPU}`, and then write the value `12.005` (which is `12005/1000`),
572 * or use `Kis{CPU}` and write `11.723` (which is `12005/1024`).
573 * The supported units are a subset of [The Unified Code for Units of
574 * Measure](http://unitsofmeasure.org/ucum.html) standard:
575 * **Basic units (UNIT)**
576 * * `bit` bit
577 * * `By` byte
578 * * `s` second
579 * * `min` minute
580 * * `h` hour
581 * * `d` day
582 * **Prefixes (PREFIX)**
583 * * `k` kilo (10^3)
584 * * `M` mega (10^6)
585 * * `G` giga (10^9)
586 * * `T` tera (10^12)
587 * * `P` peta (10^15)
588 * * `E` exa (10^18)
589 * * `Z` zetta (10^21)
590 * * `Y` yotta (10^24)
591 * * `m` milli (10^-3)
592 * * `u` micro (10^-6)
593 * * `n` nano (10^-9)
594 * * `p` pico (10^-12)
595 * * `f` femto (10^-15)
596 * * `a` atto (10^-18)
597 * * `z` zepto (10^-21)
598 * * `y` yocto (10^-24)
599 * * `Ki` kibi (2^10)
600 * * `Mi` mebi (2^20)
601 * * `Gi` gibi (2^30)
602 * * `Ti` tebi (2^40)
603 * * `Pi` pebi (2^50)
604 * **Grammar**
605 * The grammar also includes these connectors:
606 * * `/` division or ratio (as an infix operator). For examples,
607 * `kBy/{email}` or `MiBy/10ms` (although you should almost never
608 * have `/s` in a metric `unit`; rates should always be computed at
609 * query time from the underlying cumulative or delta value).
610 * * `.` multiplication or composition (as an infix operator). For
611 * examples, `GBy.d` or `k{watt}.h`.
612 * The grammar for a unit is as follows:
613 * Expression = Component { "." Component } { "/" Component } ;
614 * Component = ( [ PREFIX ] UNIT | "%" ) [ Annotation ]
615 * | Annotation
616 * | "1"
617 * ;
618 * Annotation = "{" NAME "}" ;
619 * Notes:
620 * * `Annotation` is just a comment if it follows a `UNIT`. If the annotation
621 * is used alone, then the unit is equivalent to `1`. For examples,
622 * `{request}/s == 1/s`, `By{transmitted}/s == By/s`.
623 * * `NAME` is a sequence of non-blank printable ASCII characters not
624 * containing `{` or `}`.
625 * * `1` represents a unitary [dimensionless
626 * unit](https://en.wikipedia.org/wiki/Dimensionless_quantity) of 1, such
627 * as in `1/s`. It is typically used when none of the basic units are
628 * appropriate. For example, "new users per day" can be represented as
629 * `1/d` or `{new-users}/d` (and a metric value `5` would mean "5 new
630 * users). Alternatively, "thousands of page views per day" would be
631 * represented as `1000/d` or `k1/d` or `k{page_views}/d` (and a metric
632 * value of `5.3` would mean "5300 page views per day").
633 * * `%` represents dimensionless value of 1/100, and annotates values giving
634 * a percentage (so the metric values are typically in the range of 0..100,
635 * and a metric value `3` means "3 percent").
636 * * `10^2.%` indicates a metric contains a ratio, typically in the range
637 * 0..1, that will be multiplied by 100 and displayed as a percentage
638 * (so a metric value `0.03` means "3 percent").
639 *
640 * Generated from protobuf field <code>string unit = 5;</code>
641 * @param string $var
642 * @return $this
643 */
644 public function setUnit($var)
645 {
646 GPBUtil::checkString($var, True);
647 $this->unit = $var;
648
649 return $this;
650 }
651
652 /**
653 * A detailed description of the metric, which can be used in documentation.
654 *
655 * Generated from protobuf field <code>string description = 6;</code>
656 * @return string
657 */
658 public function getDescription()
659 {
660 return $this->description;
661 }
662
663 /**
664 * A detailed description of the metric, which can be used in documentation.
665 *
666 * Generated from protobuf field <code>string description = 6;</code>
667 * @param string $var
668 * @return $this
669 */
670 public function setDescription($var)
671 {
672 GPBUtil::checkString($var, True);
673 $this->description = $var;
674
675 return $this;
676 }
677
678 /**
679 * A concise name for the metric, which can be displayed in user interfaces.
680 * Use sentence case without an ending period, for example "Request count".
681 * This field is optional but it is recommended to be set for any metrics
682 * associated with user-visible concepts, such as Quota.
683 *
684 * Generated from protobuf field <code>string display_name = 7;</code>
685 * @return string
686 */
687 public function getDisplayName()
688 {
689 return $this->display_name;
690 }
691
692 /**
693 * A concise name for the metric, which can be displayed in user interfaces.
694 * Use sentence case without an ending period, for example "Request count".
695 * This field is optional but it is recommended to be set for any metrics
696 * associated with user-visible concepts, such as Quota.
697 *
698 * Generated from protobuf field <code>string display_name = 7;</code>
699 * @param string $var
700 * @return $this
701 */
702 public function setDisplayName($var)
703 {
704 GPBUtil::checkString($var, True);
705 $this->display_name = $var;
706
707 return $this;
708 }
709
710 /**
711 * Optional. Metadata which can be used to guide usage of the metric.
712 *
713 * Generated from protobuf field <code>.google.api.MetricDescriptor.MetricDescriptorMetadata metadata = 10;</code>
714 * @return \Google\Api\MetricDescriptor\MetricDescriptorMetadata
715 */
716 public function getMetadata()
717 {
718 return $this->metadata;
719 }
720
721 /**
722 * Optional. Metadata which can be used to guide usage of the metric.
723 *
724 * Generated from protobuf field <code>.google.api.MetricDescriptor.MetricDescriptorMetadata metadata = 10;</code>
725 * @param \Google\Api\MetricDescriptor\MetricDescriptorMetadata $var
726 * @return $this
727 */
728 public function setMetadata($var)
729 {
730 GPBUtil::checkMessage($var, \Google\Api\MetricDescriptor_MetricDescriptorMetadata::class);
731 $this->metadata = $var;
732
733 return $this;
734 }
735
736 /**
737 * Optional. The launch stage of the metric definition.
738 *
739 * Generated from protobuf field <code>.google.api.LaunchStage launch_stage = 12;</code>
740 * @return int
741 */
742 public function getLaunchStage()
743 {
744 return $this->launch_stage;
745 }
746
747 /**
748 * Optional. The launch stage of the metric definition.
749 *
750 * Generated from protobuf field <code>.google.api.LaunchStage launch_stage = 12;</code>
751 * @param int $var
752 * @return $this
753 */
754 public function setLaunchStage($var)
755 {
756 GPBUtil::checkEnum($var, \Google\Api\LaunchStage::class);
757 $this->launch_stage = $var;
758
759 return $this;
760 }
761
762 }
763
764