X Tutup
Skip to content

Commit 697dcdd

Browse files
committed
Refactor task service metrics
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
1 parent 16fcb8d commit 697dcdd

File tree

12 files changed

+965
-99
lines changed

12 files changed

+965
-99
lines changed

api/next.pb.txt

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2884,10 +2884,66 @@ file {
28842884
}
28852885
syntax: "proto3"
28862886
}
2887+
file {
2888+
name: "github.com/containerd/containerd/api/types/metrics.proto"
2889+
package: "containerd.types"
2890+
dependency: "gogoproto/gogo.proto"
2891+
dependency: "google/protobuf/any.proto"
2892+
dependency: "google/protobuf/timestamp.proto"
2893+
message_type {
2894+
name: "MetricsRequest"
2895+
field {
2896+
name: "filters"
2897+
number: 1
2898+
label: LABEL_REPEATED
2899+
type: TYPE_STRING
2900+
json_name: "filters"
2901+
}
2902+
}
2903+
message_type {
2904+
name: "MetricsResponse"
2905+
field {
2906+
name: "metrics"
2907+
number: 1
2908+
label: LABEL_REPEATED
2909+
type: TYPE_MESSAGE
2910+
type_name: ".containerd.types.Metric"
2911+
json_name: "metrics"
2912+
}
2913+
}
2914+
message_type {
2915+
name: "Metric"
2916+
field {
2917+
name: "timestamp"
2918+
number: 1
2919+
label: LABEL_OPTIONAL
2920+
type: TYPE_MESSAGE
2921+
type_name: ".google.protobuf.Timestamp"
2922+
options {
2923+
65010: 1
2924+
65001: 0
2925+
}
2926+
json_name: "timestamp"
2927+
}
2928+
field {
2929+
name: "data"
2930+
number: 2
2931+
label: LABEL_OPTIONAL
2932+
type: TYPE_MESSAGE
2933+
type_name: ".google.protobuf.Any"
2934+
json_name: "data"
2935+
}
2936+
}
2937+
options {
2938+
go_package: "github.com/containerd/containerd/api/types;types"
2939+
}
2940+
syntax: "proto3"
2941+
}
28872942
file {
28882943
name: "github.com/containerd/containerd/api/types/task/task.proto"
28892944
package: "containerd.v1.types"
28902945
dependency: "gogoproto/gogo.proto"
2946+
dependency: "google/protobuf/timestamp.proto"
28912947
message_type {
28922948
name: "Process"
28932949
field {
@@ -2954,6 +3010,18 @@ file {
29543010
type: TYPE_UINT32
29553011
json_name: "exitStatus"
29563012
}
3013+
field {
3014+
name: "exited_at"
3015+
number: 10
3016+
label: LABEL_OPTIONAL
3017+
type: TYPE_MESSAGE
3018+
type_name: ".google.protobuf.Timestamp"
3019+
options {
3020+
65010: 1
3021+
65001: 0
3022+
}
3023+
json_name: "exitedAt"
3024+
}
29573025
}
29583026
enum_type {
29593027
name: "Status"
@@ -3013,6 +3081,7 @@ file {
30133081
dependency: "google/protobuf/any.proto"
30143082
dependency: "gogoproto/gogo.proto"
30153083
dependency: "github.com/containerd/containerd/api/types/mount.proto"
3084+
dependency: "github.com/containerd/containerd/api/types/metrics.proto"
30163085
dependency: "github.com/containerd/containerd/api/types/descriptor.proto"
30173086
dependency: "github.com/containerd/containerd/api/types/task/task.proto"
30183087
dependency: "google/protobuf/timestamp.proto"
@@ -3551,6 +3620,11 @@ file {
35513620
input_type: ".containerd.services.tasks.v1.UpdateTaskRequest"
35523621
output_type: ".google.protobuf.Empty"
35533622
}
3623+
method {
3624+
name: "Metrics"
3625+
input_type: ".containerd.types.MetricsRequest"
3626+
output_type: ".containerd.types.MetricsResponse"
3627+
}
35543628
}
35553629
options {
35563630
go_package: "github.com/containerd/containerd/api/services/tasks/v1;tasks"

api/services/tasks/v1/tasks.pb.go

Lines changed: 119 additions & 83 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/services/tasks/v1/tasks.proto

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import "google/protobuf/empty.proto";
66
import "google/protobuf/any.proto";
77
import "gogoproto/gogo.proto";
88
import "github.com/containerd/containerd/api/types/mount.proto";
9+
import "github.com/containerd/containerd/api/types/metrics.proto";
910
import "github.com/containerd/containerd/api/types/descriptor.proto";
1011
import "github.com/containerd/containerd/api/types/task/task.proto";
1112
import "google/protobuf/timestamp.proto";
@@ -46,6 +47,8 @@ service Tasks {
4647
rpc Checkpoint(CheckpointTaskRequest) returns (CheckpointTaskResponse);
4748

4849
rpc Update(UpdateTaskRequest) returns (google.protobuf.Empty);
50+
51+
rpc Metrics(types.MetricsRequest) returns (types.MetricsResponse);
4952
}
5053

5154
message CreateTaskRequest {

api/types/descriptor.pb.go

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)
X Tutup