migration_metrics.proto 4.4 KB

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