publicstaticvoid main(String[] args) throws Throwable {
Recording recording = new Recording();
recording.enable(EVENT_NAME);
recording.start(); // Need to sleep so a time delta can be calculated Thread.sleep(100);
recording.stop();
List<RecordedEvent> events = Events.fromRecording(recording); if (events.isEmpty()) { // CPU Load events are unreliable on Windows because // the way processes are identified with perf. counters. // See BUG 8010378. // Workaround is to detect Windows and allow // test to pass if events are missing. if (isWindows()) { return;
} thrownew AssertionError("Expected at least one event");
} for (RecordedEvent event : events) {
System.out.println("Event: " + event); for (String loadName : loadNames) {
Events.assertField(event, loadName).atLeast(0.0f).atMost(1.0f);
}
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.