1// Copyright 2021 Google LLC 2// 3// Licensed under the Apache License, Version 2.0 (the "License"); 4// you may not use this file except in compliance with the License. 5// You may obtain a copy of the License at 6// 7// http://www.apache.org/licenses/LICENSE-2.0 8// 9// Unless required by applicable law or agreed to in writing, software 10// distributed under the License is distributed on an "AS IS" BASIS, 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12// See the License for the specific language governing permissions and 13// limitations under the License. 14 15syntax = "proto3"; 16 17package google.api.servicecontrol.v1; 18 19import "google/api/servicecontrol/v1/distribution.proto"; 20import "google/protobuf/timestamp.proto"; 21 22option cc_enable_arenas = true; 23option csharp_namespace = "Google.Cloud.ServiceControl.V1"; 24option go_package = "cloud.google.com/go/servicecontrol/apiv1/servicecontrolpb;servicecontrolpb"; 25option java_multiple_files = true; 26option java_outer_classname = "MetricValueSetProto"; 27option java_package = "com.google.api.servicecontrol.v1"; 28option php_namespace = "Google\\Cloud\\ServiceControl\\V1"; 29option ruby_package = "Google::Cloud::ServiceControl::V1"; 30 31// Represents a single metric value. 32message MetricValue { 33 // The labels describing the metric value. 34 // See comments on [google.api.servicecontrol.v1.Operation.labels][google.api.servicecontrol.v1.Operation.labels] for 35 // the overriding relationship. 36 // Note that this map must not contain monitored resource labels. 37 map<string, string> labels = 1; 38 39 // The start of the time period over which this metric value's measurement 40 // applies. The time period has different semantics for different metric 41 // types (cumulative, delta, and gauge). See the metric definition 42 // documentation in the service configuration for details. If not specified, 43 // [google.api.servicecontrol.v1.Operation.start_time][google.api.servicecontrol.v1.Operation.start_time] will be used. 44 google.protobuf.Timestamp start_time = 2; 45 46 // The end of the time period over which this metric value's measurement 47 // applies. If not specified, 48 // [google.api.servicecontrol.v1.Operation.end_time][google.api.servicecontrol.v1.Operation.end_time] will be used. 49 google.protobuf.Timestamp end_time = 3; 50 51 // The value. The type of value used in the request must 52 // agree with the metric definition in the service configuration, otherwise 53 // the MetricValue is rejected. 54 oneof value { 55 // A boolean value. 56 bool bool_value = 4; 57 58 // A signed 64-bit integer value. 59 int64 int64_value = 5; 60 61 // A double precision floating point value. 62 double double_value = 6; 63 64 // A text string value. 65 string string_value = 7; 66 67 // A distribution value. 68 Distribution distribution_value = 8; 69 } 70} 71 72// Represents a set of metric values in the same metric. 73// Each metric value in the set should have a unique combination of start time, 74// end time, and label values. 75message MetricValueSet { 76 // The metric name defined in the service configuration. 77 string metric_name = 1; 78 79 // The values in this metric. 80 repeated MetricValue metric_values = 2; 81} 82