Package io.perfmark.impl
Class Storage
- java.lang.Object
-
- io.perfmark.impl.Storage
-
public final class Storage extends java.lang.ObjectStorage is responsible for storing and returning recorded marks. This is a low level class and not intended for use by users. Instead, theTraceEventWriterandTraceEventViewerclasses provide easier to use APIs for accessing PerfMark data.This code is NOT API stable, and may be removed in the future, or changed without notice.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classStorage.MarkHolderAndHandleThis class is needed to work around a race condition where a newly created MarkHolder could be GC'd before the caller ofallocateMarkHolder()can consume the results.static classStorage.MarkHolderHandle
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Storage.MarkHolderAndHandleallocateMarkHolder()static voidclearGlobalIndex()Removes the global Read index on all storage, but leaves local storage in place.static voidclearLocalStorage()Removes all data for the calling Thread.static longgetInitNanoTime()static java.util.List<MarkList>read()Returns a list ofMarkLists across all reachable threads.static MarkListreadForTest()
-
-
-
Method Detail
-
getInitNanoTime
public static long getInitNanoTime()
-
read
public static java.util.List<MarkList> read()
Returns a list ofMarkLists across all reachable threads.- Returns:
- all reachable MarkLists.
-
clearLocalStorage
public static void clearLocalStorage()
Removes all data for the calling Thread. Other threads may Still have stored data.
-
clearGlobalIndex
public static void clearGlobalIndex()
Removes the global Read index on all storage, but leaves local storage in place. Because writer threads may still be writing to the same buffer (which they have a strong ref to), this function only removed data that is truly unwritable anymore. In addition, it captures a timestamp to which marks to include when reading. Thus, the data isn't fully removed. To fully remove all data, each tracing thread must callclearLocalStorage().
-
readForTest
@Nullable public static MarkList readForTest()
-
allocateMarkHolder
public static Storage.MarkHolderAndHandle allocateMarkHolder()
-
-