Skip to content

Commit 1471c14

Browse files
tznealmxpv
authored andcommitted
feat: add cgroups v2 metrics proto bindings
1 parent cc5f2bd commit 1471c14

4 files changed

Lines changed: 165 additions & 0 deletions

File tree

crates/shim-protos/build.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,12 @@ fn main() {
4545
false,
4646
);
4747

48+
genmodule(
49+
"cgroups_v2",
50+
&["vendor/github.com/containerd/cgroups/cgroup2/stats/metrics.proto"],
51+
false,
52+
);
53+
4854
genmodule(
4955
"stats",
5056
&["vendor/microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/stats/stats.proto"],
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/*
2+
Copyright The containerd Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
pub mod metrics {
18+
include!(concat!(env!("OUT_DIR"), "/cgroups_v2/metrics.rs"));
19+
}

crates/shim-protos/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ pub use protobuf;
2121
pub use ttrpc;
2222

2323
pub mod cgroups;
24+
pub mod cgroups_v2;
2425
pub mod events;
2526
#[cfg(feature = "sandbox")]
2627
mod sandbox;

crates/shim-protos/vendor/github.com/containerd/cgroups/cgroup2/stats/metrics.proto

Lines changed: 139 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)