Skip to content

Commit

Permalink
Fix event metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
jbachorik committed May 19, 2021
1 parent b179afa commit e0f5855
Show file tree
Hide file tree
Showing 9 changed files with 56 additions and 56 deletions.
Expand Up @@ -39,19 +39,19 @@

@Name(Type.EVENT_NAME_PREFIX + "ContainerCPUThrottling")
@Label("CPU Throttling")
@Category({"Operating System", "Container", "Processor"})
@Description("Container CPU throttling related information.")
@Category({"Operating System", "Processor"})
@Description("Container CPU throttling related information")
public class ContainerCPUThrottlingEvent extends AbstractJDKEvent {
@Label("CPU Elapsed Slices")
@Description("Number of time-slice periods that have elapsed if a CPU quota has been setup for the container.")
@Description("Number of time-slice periods that have elapsed if a CPU quota has been setup for the container")
public long cpuElapsedSlices;

@Label("CPU Throttled Slices")
@Description("Number of time-slice periods that the CPU has been throttled or limited due to exceeding CPU quota.")
@Description("Number of time-slice periods that the CPU has been throttled or limited due to exceeding CPU quota")
public long cpuThrottledSlices;

@Label("CPU Throttled Time")
@Description("Total time duration, in nanoseconds, that the CPU has been throttled or limited due to exceeding CPU quota.")
@Description("Total time duration, in nanoseconds, that the CPU has been throttled or limited due to exceeding CPU quota")
@Timespan
public long cpuThrottledTime;
}
Expand Up @@ -39,21 +39,21 @@

@Name(Type.EVENT_NAME_PREFIX + "ContainerCPUUsage")
@Label("CPU Usage")
@Category({"Operating System", "Container", "Processor"})
@Description("Container CPU usage related information.")
@Category({"Operating System", "Processor"})
@Description("Container CPU usage related information")
public class ContainerCPUUsageEvent extends AbstractJDKEvent {
@Label("CPU Time")
@Description("Aggregate time, in nanoseconds, consumed by all tasks in the container.")
@Description("Aggregate time consumed by all tasks in the container")
@Timespan
public long cpuTime;

@Label("CPU User Time")
@Description("Aggregate user time, in nanoseconds, consumed by all tasks in the container.")
@Description("Aggregate user time consumed by all tasks in the container")
@Timespan
public long cpuUserTime;

@Label("CPU System Time")
@Description("Aggregate system time, in nanoseconds, consumed by all tasks in the container.")
@Description("Aggregate system time consumed by all tasks in the container")
@Timespan
public long cpuSystemTime;
}
Expand Up @@ -39,43 +39,44 @@

@Name(Type.EVENT_NAME_PREFIX + "ContainerConfiguration")
@Label("Container Configuration")
@Category({"Operating System", "Container"})
@Description("A set of container specific attributes.")
@Category({"Operating System"})
@Description("A set of container specific attributes")
public final class ContainerConfigurationEvent extends AbstractJDKEvent {
@Label("Container type")
@Label("Container Type")
@Description("Container type information")
public String containerType;

@Label("CPU Slice Period")
@Description("Length of the scheduling period, in microseconds, for processes within the container.")
@Description("Length of the scheduling period for processes within the container")
@Timespan(Timespan.MICROSECONDS)
public long cpuSlicePeriod;

@Label("CPU Quota")
@Description("Total available run-time allowed, in microseconds, during each scheduling period for all tasks in the container.")
@Description("Total available run-time allowed during each scheduling period for all tasks in the container")
@Timespan(Timespan.MICROSECONDS)
public long cpuQuota;

@Label("CPU Shares")
@Description("Relative weighting of processes with the container used for prioritizing the scheduling of processes across " +
"all containers running on a host.")
"all containers running on a host")
public long cpuShares;

@Label("Effective CPU Count")
@Description("Number of effective processors that this container has available to it.")
@Description("Number of effective processors that this container has available to it")
public long effectiveCpuCount;

@Label("Memory Soft Limit")
@Description("Hint to the operating system that allows groups to specify the minimum required amount of physical memory.")
@Description("Hint to the operating system that allows groups to specify the minimum required amount of physical memory")
@DataAmount
public long memorySoftLimit;

@Label("Memory Limit")
@Description("Maximum amount of physical memory, in bytes, that can be allocated in the container.")
@Description("Maximum amount of physical memory that can be allocated in the container")
@DataAmount
public long memoryLimit;

@Label("Memory and Swap Limit")
@Description("Maximum amount of physical memory and swap space, in bytes, that can be allocated in the container.")
@Description("Maximum amount of physical memory and swap space, in bytes, that can be allocated in the container")
@DataAmount
public long swapMemoryLimit;
}
Expand Up @@ -39,17 +39,17 @@


@Name(Type.EVENT_NAME_PREFIX + "ContainerIOUsage")
@Label("Container I/O Usage")
@Category({"Operating System", "Container", "I/O"})
@Description("Container I/O usage related information.")
@Label("Container IO Usage")
@Category({"Operating System", "File System"})
@Description("Container IO usage related information")
public class ContainerIOUsageEvent extends AbstractJDKEvent {

@Label("BlkIO Request Count")
@Description("Number of block I/O requests to the disk that have been issued by the container.")
@Label("Block IO Request Count")
@Description("Number of block IO requests to the disk that have been issued by the container")
public long serviceRequests;

@Label("BlkIO Transfer")
@Description("Number of block I/O bytes that have been transferred to/from the disk by the container.")
@Label("Block IO Transfer")
@Description("Number of block IO bytes that have been transferred to/from the disk by the container")
@DataAmount
public long dataTransferred;
}
Expand Up @@ -39,25 +39,20 @@

@Name(Type.EVENT_NAME_PREFIX + "ContainerMemoryUsage")
@Label("Container Memory Usage")
@Category({"Operating System", "Container", "Memory"})
@Description("Container memory usage related information.")
@Category({"Operating System", "Memory"})
@Description("Container memory usage related information")
public final class ContainerMemoryUsageEvent extends AbstractJDKEvent {
@Label("Memory Pressure")
@Description("(attempts per second * 1000), if enabled, that the operating system tries to satisfy a memory request for any " +
"process in the current container when no free memory is readily available.")
public double memoryPressure;

@Label("Memory Fail Count")
@Description("Number of times that user memory requests in the container have exceeded the memory limit.")
@Description("Number of times that user memory requests in the container have exceeded the memory limit")
public long memoryFailCount;

@Label("Memory Usage")
@Description("Amount of physical memory, in bytes, that is currently allocated in the current container.")
@Description("Amount of physical memory, in bytes, that is currently allocated in the current container")
@DataAmount
public long memoryUsage;

@Label("Memory and Swap Usage")
@Description("Amount of physical memory and swap space, in bytes, that is currently allocated in the current container.")
@Description("Amount of physical memory and swap space, in bytes, that is currently allocated in the current container")
@DataAmount
public long swapMemoryUsage;
}
Expand Up @@ -159,14 +159,13 @@ public static void addInstrumentation() {
}

private static void initializeContainerEvents() {
SecuritySupport.registerEvent(ContainerConfigurationEvent.class);
SecuritySupport.registerEvent(ContainerCPUUsageEvent.class);
SecuritySupport.registerEvent(ContainerCPUThrottlingEvent.class);
SecuritySupport.registerEvent(ContainerMemoryUsageEvent.class);
SecuritySupport.registerEvent(ContainerIOUsageEvent.class);
containerMetrics = Container.metrics();
if (containerMetrics != null) {
SecuritySupport.registerEvent(ContainerConfigurationEvent.class);
SecuritySupport.registerEvent(ContainerCPUUsageEvent.class);
SecuritySupport.registerEvent(ContainerCPUThrottlingEvent.class);
SecuritySupport.registerEvent(ContainerMemoryUsageEvent.class);
SecuritySupport.registerEvent(ContainerIOUsageEvent.class);

RequestEngine.addTrustedJDKHook(ContainerConfigurationEvent.class, emitContainerConfiguration);
RequestEngine.addTrustedJDKHook(ContainerCPUUsageEvent.class, emitContainerCPUUsage);
RequestEngine.addTrustedJDKHook(ContainerCPUThrottlingEvent.class, emitContainerCPUThrottling);
Expand Down
12 changes: 5 additions & 7 deletions src/jdk.jfr/share/conf/jfr/default.jfc
Expand Up @@ -555,27 +555,27 @@
</event>

<event name="jdk.ContainerConfiguration">
<setting name="enabled" control="container-events-enabled">true</setting>
<setting name="enabled">true</setting>
<setting name="period">beginChunk</setting>
</event>

<event name="jdk.ContainerCPUUsage">
<setting name="enabled" control="container-events-enabled">true</setting>
<setting name="enabled">true</setting>
<setting name="period">30 s</setting>
</event>

<event name="jdk.ContainerCPUThrottling">
<setting name="enabled" control="container-events-enabled">true</setting>
<setting name="enabled">true</setting>
<setting name="period">30 s</setting>
</event>

<event name="jdk.ContainerMemoryUsage">
<setting name="enabled" control="container-events-enabled">true</setting>
<setting name="enabled">true</setting>
<setting name="period">30 s</setting>
</event>

<event name="jdk.ContainerIOUsage">
<setting name="enabled" control="container-events-enabled">true</setting>
<setting name="enabled">true</setting>
<setting name="period">30 s</setting>
</event>

Expand Down Expand Up @@ -1044,8 +1044,6 @@

<flag name="class-loading" label="Class Loading">false</flag>

<flag name="container-events-enabled" label="Container Events">true</flag>

</control>

</configuration>
11 changes: 5 additions & 6 deletions src/jdk.jfr/share/conf/jfr/profile.jfc
Expand Up @@ -555,27 +555,27 @@
</event>

<event name="jdk.ContainerConfiguration">
<setting name="enabled" control="container-events-enabled">true</setting>
<setting name="enabled">true</setting>
<setting name="period">beginChunk</setting>
</event>

<event name="jdk.ContainerCPUUsage">
<setting name="enabled" control="container-events-enabled">true</setting>
<setting name="enabled">true</setting>
<setting name="period">30 s</setting>
</event>

<event name="jdk.ContainerCPUThrottling">
<setting name="enabled" control="container-events-enabled">true</setting>
<setting name="enabled">true</setting>
<setting name="period">30 s</setting>
</event>

<event name="jdk.ContainerMemoryUsage">
<setting name="enabled" control="container-events-enabled">true</setting>
<setting name="enabled">true</setting>
<setting name="period">30 s</setting>
</event>

<event name="jdk.ContainerIOUsage">
<setting name="enabled" control="container-events-enabled">true</setting>
<setting name="enabled">true</setting>
<setting name="period">30 s</setting>
</event>

Expand Down Expand Up @@ -1044,7 +1044,6 @@

<flag name="class-loading" label="Class Loading">false</flag>

<flag name="container-events-enabled" label="Container Events">true</flag>
</control>

</configuration>
Expand Up @@ -71,6 +71,13 @@ public class TestLookForUntestedEvents {
"GCPhasePauseLevel4")
);

// Container events are tested in hotspot/jtreg/containers/docker/TestJFREvents.java
private static final Set<String> coveredContainerEvents = new HashSet<>(
Arrays.asList(
"ContainerConfiguration", "ContainerCPUUsage", "ContainerCPUThrottling",
"ContainerMemoryUsage", "ContainerIOUsage")
);

// This is a "known failure list" for this test.
// NOTE: if the event is not covered, a bug should be open, and bug number
// noted in the comments for this set.
Expand Down Expand Up @@ -115,6 +122,7 @@ private static void lookForEventsNotCoveredByTests() throws Exception {
// Account for hard-to-test, experimental and GC tested events
eventsNotCoveredByTest.removeAll(hardToTestEvents);
eventsNotCoveredByTest.removeAll(coveredGcEvents);
eventsNotCoveredByTest.removeAll(coveredContainerEvents);
eventsNotCoveredByTest.removeAll(knownNotCoveredEvents);

if (!eventsNotCoveredByTest.isEmpty()) {
Expand Down

0 comments on commit e0f5855

Please sign in to comment.