-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move stat pb out as a separate library
Move the stat protobuf message out of stats as a separate library to make it easier for other proto to import stat while avoid having circular dependency with stats.proto. Bug: b/295363989 Test: Run post-submit Kokoro CI jobs to make sure rbe_metrics are correctly generated. Change-Id: I4e4c9c39819f55149c74182546eeaeb4960a4093 GitOrigin-RevId: 028ed86c273643270ca22b50ec877adcd07fe309
- Loading branch information
1 parent
eb9508e
commit 1aa72ad
Showing
9 changed files
with
200 additions
and
146 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
load("@rules_proto//proto:defs.bzl", "proto_library") | ||
load("@io_bazel_rules_go//go:def.bzl", "go_library") | ||
load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") | ||
|
||
proto_library( | ||
name = "stat_proto", | ||
srcs = ["stat.proto"], | ||
visibility = ["//visibility:public"], | ||
) | ||
|
||
go_proto_library( | ||
name = "stat_go_proto", | ||
importpath = "team/foundry-x/re-client/api/stat", | ||
proto = ":stat_proto", | ||
visibility = ["//visibility:public"], | ||
) | ||
|
||
go_library( | ||
name = "stat", | ||
embed = [":stat_go_proto"], | ||
importpath = "team/foundry-x/re-client/api/stat", | ||
visibility = ["//visibility:public"], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// Copyright 2023 Google LLC | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
syntax = "proto3"; | ||
|
||
package stats; | ||
|
||
// Outlier represents a command with an unusually large value in the stat. | ||
message Outlier { | ||
string command_id = 1; | ||
int64 value = 2; | ||
} | ||
|
||
message Stat { | ||
// The metric/stat name. | ||
string name = 1; | ||
|
||
// The number of all the true values for booleans, the sum of all the | ||
// values for ints. | ||
int64 count = 2; | ||
|
||
message Value { | ||
string name = 1; | ||
int64 count = 2; | ||
} | ||
// For enum stats, the count of each value. | ||
repeated Value counts_by_value = 3; | ||
|
||
// A list of commands that have the highest values. | ||
repeated Outlier outliers = 4; | ||
|
||
int64 median = 5; | ||
int64 percentile75 = 6; | ||
int64 percentile85 = 7; | ||
int64 percentile95 = 8; | ||
double average = 9; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.