github.com/m3db/m3@v1.5.0/src/metrics/generated/proto/metricpb/composite.proto (about)

     1  // Copyright (c) 2018 Uber Technologies, Inc.
     2  //
     3  // Permission is hereby granted, free of charge, to any person obtaining a copy
     4  // of this software and associated documentation files (the "Software"), to deal
     5  // in the Software without restriction, including without limitation the rights
     6  // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
     7  // copies of the Software, and to permit persons to whom the Software is
     8  // furnished to do so, subject to the following conditions:
     9  //
    10  // The above copyright notice and this permission notice shall be included in
    11  // all copies or substantial portions of the Software.
    12  //
    13  // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    14  // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    15  // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    16  // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    17  // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    18  // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
    19  // THE SOFTWARE.
    20  
    21  syntax = "proto3";
    22  
    23  option go_package = "github.com/m3db/m3/src/metrics/generated/proto/metricpb";
    24  
    25  package metricpb;
    26  
    27  import "github.com/gogo/protobuf/gogoproto/gogo.proto";
    28  import "github.com/m3db/m3/src/metrics/generated/proto/metricpb/metric.proto";
    29  import "github.com/m3db/m3/src/metrics/generated/proto/metricpb/metadata.proto";
    30  import "github.com/m3db/m3/src/metrics/generated/proto/policypb/policy.proto";
    31  
    32  message CounterWithMetadatas {
    33    Counter counter = 1 [(gogoproto.nullable) = false];
    34    StagedMetadatas metadatas = 2 [(gogoproto.nullable) = false];
    35  }
    36  
    37  message BatchTimerWithMetadatas {
    38    BatchTimer batch_timer = 1 [(gogoproto.nullable) = false];
    39    StagedMetadatas metadatas = 2 [(gogoproto.nullable) = false];
    40  }
    41  
    42  message GaugeWithMetadatas {
    43    Gauge gauge = 1 [(gogoproto.nullable) = false];
    44    StagedMetadatas metadatas = 2 [(gogoproto.nullable) = false];
    45  }
    46  
    47  message ForwardedMetricWithMetadata {
    48    ForwardedMetric metric = 1 [(gogoproto.nullable) = false];
    49    ForwardMetadata metadata = 2 [(gogoproto.nullable) = false];
    50  }
    51  
    52  message TimedMetricWithMetadata {
    53    TimedMetric metric = 1 [(gogoproto.nullable) = false];
    54    TimedMetadata metadata = 2 [(gogoproto.nullable) = false];
    55  }
    56  
    57  message TimedMetricWithMetadatas {
    58    TimedMetric metric = 1 [(gogoproto.nullable) = false];
    59    StagedMetadatas metadatas = 2 [(gogoproto.nullable) = false];
    60  }
    61  
    62  message TimedMetricWithStoragePolicy {
    63    TimedMetric timed_metric = 1 [(gogoproto.nullable) = false];
    64    policypb.StoragePolicy storage_policy = 2 [(gogoproto.nullable) = false];
    65  }
    66  
    67  message AggregatedMetric {
    68    TimedMetricWithStoragePolicy metric = 1 [(gogoproto.nullable) = false];
    69    int64 encode_nanos = 2;
    70  }
    71  
    72  // NB: we intentionally choose to explicitly define the message type as well
    73  // as the corresponding payload as opposed to use `oneof` protobuf type here.
    74  // This is because the generated `Unmarshal` method of `oneof` types doesn't
    75  // permit reusing existing protobuf messages for decoding, thus incurring a
    76  // significant performance hit when such message type is used for encoding
    77  // and decoding high volume traffic.
    78  message MetricWithMetadatas {
    79    enum Type {
    80      UNKNOWN = 0;
    81      COUNTER_WITH_METADATAS = 1;
    82      BATCH_TIMER_WITH_METADATAS = 2;
    83      GAUGE_WITH_METADATAS = 3;
    84      FORWARDED_METRIC_WITH_METADATA = 4;
    85      TIMED_METRIC_WITH_METADATA = 5;
    86      TIMED_METRIC_WITH_METADATAS = 6;
    87      TIMED_METRIC_WITH_STORAGE_POLICY = 7;
    88    }
    89    Type type = 1;
    90    CounterWithMetadatas counter_with_metadatas = 2;
    91    BatchTimerWithMetadatas batch_timer_with_metadatas = 3;
    92    GaugeWithMetadatas gauge_with_metadatas = 4;
    93    ForwardedMetricWithMetadata forwarded_metric_with_metadata = 5;
    94    TimedMetricWithMetadata timed_metric_with_metadata = 6;
    95    TimedMetricWithMetadatas timed_metric_with_metadatas = 7;
    96    TimedMetricWithStoragePolicy timed_metric_with_storage_policy = 8;
    97  }