Skip to content

Commit

Permalink
Bump new proto version
Browse files Browse the repository at this point in the history
  • Loading branch information
codebien committed Apr 21, 2023
1 parent c737540 commit 019b27a
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 32 deletions.
74 changes: 48 additions & 26 deletions output/cloud/expv2/pbcloud/metric.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 26 additions & 6 deletions output/cloud/expv2/pbcloud/metric.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,25 @@ syntax = "proto3";

package metrics;

option go_package = "go.k6.io/k6/otput/cloud/expv2/pbcloud";
option go_package = "go.k6.io/k6/output/cloud/expv2/pbcloud";

import "google/protobuf/timestamp.proto";

// The type of a Metric.
enum MetricType {
METRICTYPE_UNSPECIFIED = 0;
COUNTER = 1;
GAUGE = 2;
RATE = 3;
TREND = 4;
// Metric of type METRICTYPE_UNSPECIFIED declared, but not allowed.
// See: https://protobuf.dev/programming-guides/dos-donts/#do-include-an-unspecified-value-in-an-enum.
METRIC_TYPE_UNSPECIFIED = 0;
METRIC_TYPE_COUNTER = 1;
METRIC_TYPE_GAUGE = 2;
METRIC_TYPE_RATE = 3;
METRIC_TYPE_TREND = 4;
}

// MetricSet is the top-level container type
// that is encoded and sent over the wire.
message MetricSet {
// Required.
repeated Metric metrics = 1;
}

Expand All @@ -26,6 +29,7 @@ message Metric {
string name = 1;

// Required.
// Can't be of type MetricType.METRICTYPE_UNSPECIFIED (which is zero value).
MetricType type = 2;

// Optional.
Expand All @@ -43,11 +47,17 @@ message Label {

// TimeSeries is a single metric with a unique set of labels..
message TimeSeries {
// Required.
//
// At minimum two labels should be present:
// - name: "__name__", value: "metric name this time series belongs to/is contained within",
// - name: "test_run_id", value: "cloud test run ID this time series belongs to".
repeated Label labels = 1;

// time bucket size in seconds
uint32 aggregation_period = 2;

// Required.
oneof samples {
CounterSamples counter_samples = 3;
GaugeSamples gauge_samples = 4;
Expand All @@ -57,27 +67,34 @@ message TimeSeries {
}

message CounterSamples {
// Required.
repeated CounterValue values = 1;
}

message GaugeSamples {
// Required.
repeated GaugeValue values = 1;
}

message RateSamples {
// Required.
repeated RateValue values = 1;
}

message TrendHdrSamples {
// Required.
repeated TrendHdrValue values = 1;
}

message CounterValue {
// Required.
google.protobuf.Timestamp time = 1;

double value = 2;
}

message GaugeValue {
// Required.
google.protobuf.Timestamp time = 1;

// last observed value
Expand All @@ -91,12 +108,15 @@ message GaugeValue {
}

message RateValue {
// Required.
google.protobuf.Timestamp time = 1;

uint32 nonzero_count = 2;
uint32 total_count = 3;
}

message TrendHdrValue {
// Required.
google.protobuf.Timestamp time = 1;

// histogram parameter - value multiplier aka smallest value, default = 1.0
Expand Down

0 comments on commit 019b27a

Please sign in to comment.