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.cloud.bigquery.migration.v2alpha; 18 19import "google/api/distribution.proto"; 20import "google/api/field_behavior.proto"; 21import "google/api/metric.proto"; 22import "google/protobuf/timestamp.proto"; 23 24option csharp_namespace = "Google.Cloud.BigQuery.Migration.V2Alpha"; 25option go_package = "cloud.google.com/go/bigquery/migration/apiv2alpha/migrationpb;migrationpb"; 26option java_multiple_files = true; 27option java_outer_classname = "MigrationMetricsProto"; 28option java_package = "com.google.cloud.bigquery.migration.v2alpha"; 29option php_namespace = "Google\\Cloud\\BigQuery\\Migration\\V2alpha"; 30 31// The metrics object for a SubTask. 32message TimeSeries { 33 // Required. The name of the metric. 34 // 35 // If the metric is not known by the service yet, it will be auto-created. 36 string metric = 1 [(google.api.field_behavior) = REQUIRED]; 37 38 // Required. The value type of the time series. 39 google.api.MetricDescriptor.ValueType value_type = 2 [(google.api.field_behavior) = REQUIRED]; 40 41 // Optional. The metric kind of the time series. 42 // 43 // If present, it must be the same as the metric kind of the associated 44 // metric. If the associated metric's descriptor must be auto-created, then 45 // this field specifies the metric kind of the new descriptor and must be 46 // either `GAUGE` (the default) or `CUMULATIVE`. 47 google.api.MetricDescriptor.MetricKind metric_kind = 3 [(google.api.field_behavior) = OPTIONAL]; 48 49 // Required. The data points of this time series. When listing time series, points are 50 // returned in reverse time order. 51 // 52 // When creating a time series, this field must contain exactly one point and 53 // the point's type must be the same as the value type of the associated 54 // metric. If the associated metric's descriptor must be auto-created, then 55 // the value type of the descriptor is determined by the point's type, which 56 // must be `BOOL`, `INT64`, `DOUBLE`, or `DISTRIBUTION`. 57 repeated Point points = 4 [(google.api.field_behavior) = REQUIRED]; 58} 59 60// A single data point in a time series. 61message Point { 62 // The time interval to which the data point applies. For `GAUGE` metrics, 63 // the start time does not need to be supplied, but if it is supplied, it must 64 // equal the end time. For `DELTA` metrics, the start and end time should 65 // specify a non-zero interval, with subsequent points specifying contiguous 66 // and non-overlapping intervals. For `CUMULATIVE` metrics, the start and end 67 // time should specify a non-zero interval, with subsequent points specifying 68 // the same start time and increasing end times, until an event resets the 69 // cumulative value to zero and sets a new start time for the following 70 // points. 71 TimeInterval interval = 1; 72 73 // The value of the data point. 74 TypedValue value = 2; 75} 76 77// A time interval extending just after a start time through an end time. 78// If the start time is the same as the end time, then the interval 79// represents a single point in time. 80message TimeInterval { 81 // Optional. The beginning of the time interval. The default value 82 // for the start time is the end time. The start time must not be 83 // later than the end time. 84 google.protobuf.Timestamp start_time = 1 [(google.api.field_behavior) = OPTIONAL]; 85 86 // Required. The end of the time interval. 87 google.protobuf.Timestamp end_time = 2 [(google.api.field_behavior) = REQUIRED]; 88} 89 90// A single strongly-typed value. 91message TypedValue { 92 // The typed value field. 93 oneof value { 94 // A Boolean value: `true` or `false`. 95 bool bool_value = 1; 96 97 // A 64-bit integer. Its range is approximately +/-9.2x10^18. 98 int64 int64_value = 2; 99 100 // A 64-bit double-precision floating-point number. Its magnitude 101 // is approximately +/-10^(+/-300) and it has 16 significant digits of 102 // precision. 103 double double_value = 3; 104 105 // A variable-length string value. 106 string string_value = 4; 107 108 // A distribution value. 109 google.api.Distribution distribution_value = 5; 110 } 111} 112