Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (102)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (322)
Collections:
Other Resources:
JDK 17 jdk.jfr.jmod - JFR Module
JDK 17 jdk.jfr.jmod is the JMOD file for JDK 17 JFR module.
JDK 17 JFR module compiled class files are stored in \fyicenter\jdk-17.0.5\jmods\jdk.jfr.jmod.
JDK 17 JFR module compiled class files are also linked and stored in the \fyicenter\jdk-17.0.5\lib\modules JImage file.
JDK 17 JFR module source code files are stored in \fyicenter\jdk-17.0.5\lib\src.zip\jdk.jfr.
You can click and view the content of each source code file in the list below.
✍: FYIcenter
⏎ jdk/jfr/internal/tool/Summary.java
/*
* Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package jdk.jfr.internal.tool;
import java.io.IOException;
import java.io.PrintStream;
import java.nio.file.Path;
import java.time.Instant;
import java.time.ZoneOffset;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Deque;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import jdk.jfr.EventType;
import jdk.jfr.internal.MetadataDescriptor;
import jdk.jfr.internal.Type;
import jdk.jfr.internal.consumer.ChunkHeader;
import jdk.jfr.internal.consumer.FileAccess;
import jdk.jfr.internal.consumer.RecordingInput;
final class Summary extends Command {
private final DateTimeFormatter DATE_FORMAT = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss").withLocale(Locale.UK).withZone(ZoneOffset.UTC);
@Override
public String getName() {
return "summary";
}
private static class Statistics {
Statistics(String name) {
this.name = name;
}
String name;
long count;
long size;
}
@Override
public List<String> getOptionSyntax() {
return List.of("<file>");
}
@Override
public void displayOptionUsage(PrintStream stream) {
stream.println(" <file> Location of the recording file (.jfr) to display information about");
}
@Override
public String getDescription() {
return "Display general information about a recording file (.jfr)";
}
@Override
public void execute(Deque<String> options) throws UserSyntaxException, UserDataException {
ensureMaxArgumentCount(options, 1);
Path p = getJFRInputFile(options);
try {
printInformation(p);
} catch (IOException e) {
couldNotReadError(p, e);
}
}
private void printInformation(Path p) throws IOException {
long totalDuration = 0;
long chunks = 0;
try (RecordingInput input = new RecordingInput(p.toFile(), FileAccess.UNPRIVILEGED)) {
ChunkHeader first = new ChunkHeader(input);
ChunkHeader ch = first;
String eventPrefix = Type.EVENT_NAME_PREFIX;
if (first.getMajor() == 1) {
eventPrefix = "com.oracle.jdk.";
}
HashMap<Long, Statistics> stats = new HashMap<>();
stats.put(0L, new Statistics(eventPrefix + "Metadata"));
stats.put(1L, new Statistics(eventPrefix + "CheckPoint"));
int minWidth = 0;
while (true) {
long chunkEnd = ch.getEnd();
MetadataDescriptor md = ch.readMetadata();
for (EventType eventType : md.getEventTypes()) {
stats.computeIfAbsent(eventType.getId(), (e) -> new Statistics(eventType.getName()));
minWidth = Math.max(minWidth, eventType.getName().length());
}
totalDuration += ch.getDurationNanos();
chunks++;
input.position(ch.getEventStart());
while (input.position() < chunkEnd) {
long pos = input.position();
int size = input.readInt();
long eventTypeId = input.readLong();
Statistics s = stats.get(eventTypeId);
if (s == null) {
s = new Statistics(eventTypeId + " (missing event metadata)");
stats.put(eventTypeId, s);
}
if (s != null) {
s.count++;
s.size += size;
}
input.position(pos + size);
}
if (ch.isLastChunk()) {
break;
}
ch = ch.nextHeader();
}
println();
long epochSeconds = first.getStartNanos() / 1_000_000_000L;
long adjustNanos = first.getStartNanos() - epochSeconds * 1_000_000_000L;
println(" Version: " + first.getMajor() + "." + first.getMinor());
println(" Chunks: " + chunks);
println(" Start: " + DATE_FORMAT.format(Instant.ofEpochSecond(epochSeconds, adjustNanos)) + " (UTC)");
println(" Duration: " + (totalDuration + 500_000_000) / 1_000_000_000 + " s");
List<Statistics> statsList = new ArrayList<>(stats.values());
Collections.sort(statsList, (u, v) -> Long.compare(v.count, u.count));
println();
String header = " Count Size (bytes) ";
String typeHeader = " Event Type";
minWidth = Math.max(minWidth, typeHeader.length());
println(typeHeader + pad(minWidth - typeHeader.length(), ' ') + header);
println(pad(minWidth + header.length(), '='));
for (Statistics s : statsList) {
System.out.printf(" %-" + minWidth + "s%10d %12d\n", s.name, s.count, s.size);
}
}
}
private String pad(int count, char c) {
StringBuilder sb = new StringBuilder();
for (int i = 0; i < count; i++) {
sb.append(c);
}
return sb.toString();
}
}
⏎ jdk/jfr/internal/tool/Summary.java
Or download all of them as a single archive file:
File name: jdk.jfr-17.0.5-src.zip File size: 363343 bytes Release date: 2022-09-13 Download
⇒ JDK 17 jdk.jlink.jmod - JLink Tool
2023-04-17, ≈48🔥, 0💬
Popular Posts:
JDK 17 java.naming.jmod is the JMOD file for JDK 17 Naming module. JDK 17 Naming module compiled cla...
Apache Log4j IOStreams is a Log4j API extension that provides numerous classes from java.io that can...
JDK 17 java.base.jmod is the JMOD file for JDK 17 Base module. JDK 17 Base module compiled class fil...
JDOM provides a solution for using XML from Java that is as simple as Java itself. There is no compe...
MP3SPI is a Java Service Provider Interface that adds MP3 (MPEG 1/2/2.5 Layer 1/2/3) audio format su...