mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8273526: Extend the OSContainer API pids controller with pids.current
Reviewed-by: sgehwolf, iklam
This commit is contained in:
parent
74ffe12267
commit
d4546b6b36
14 changed files with 88 additions and 3 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2020, Red Hat Inc.
|
||||
* Copyright (c) 2020, 2021, Red Hat Inc.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -154,6 +154,11 @@ public class CgroupMetrics implements Metrics {
|
|||
return subsystem.getPidsMax();
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getPidsCurrent() {
|
||||
return subsystem.getPidsCurrent();
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getBlkIOServiceCount() {
|
||||
return subsystem.getBlkIOServiceCount();
|
||||
|
|
|
@ -416,6 +416,10 @@ public class CgroupV1Subsystem implements CgroupSubsystem, CgroupV1Metrics {
|
|||
return CgroupSubsystem.limitFromString(pidsMaxStr);
|
||||
}
|
||||
|
||||
public long getPidsCurrent() {
|
||||
return getLongValue(pids, "pids.current");
|
||||
}
|
||||
|
||||
/*****************************************************************
|
||||
* BlKIO Subsystem
|
||||
****************************************************************/
|
||||
|
|
|
@ -311,6 +311,11 @@ public class CgroupV2Subsystem implements CgroupSubsystem {
|
|||
return CgroupSubsystem.limitFromString(pidsMaxStr);
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getPidsCurrent() {
|
||||
return getLongVal("pids.current");
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getBlkIOServiceCount() {
|
||||
return sumTokensIOStat(CgroupV2Subsystem::lineToRandWIOs);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue