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