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.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static longgetInitNanoTime()static java.util.List<MarkList>read()Returns a list ofMarkLists across all reachable threads.static MarkListreadForTest()May Returnnull.static voidregisterMarkHolder(MarkHolder markHolder)Note: it is the responsibility of the caller to keep a strong reference to the markHolder.static voidresetForAll()Removes the global Read index on all storage, but leaves local storage in place.static voidresetForThread()Removes all data for the calling Thread.static voidunregisterMarkHolder(MarkHolder markHolder)This method is meant to aid in cleanup.
-
-
-
Method Detail
-
getInitNanoTime
public static long getInitNanoTime()
-
read
public static java.util.List<MarkList> read()
Returns a list ofMarkLists across all reachable threads. MarkLists with no Marks may be removed.- Returns:
- all reachable MarkLists.
-
resetForThread
public static void resetForThread()
Removes all data for the calling Thread. Other threads may Still have stored data.
-
resetForAll
public static void resetForAll()
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 callresetForThread().
-
registerMarkHolder
public static void registerMarkHolder(MarkHolder markHolder)
Note: it is the responsibility of the caller to keep a strong reference to the markHolder.
-
unregisterMarkHolder
public static void unregisterMarkHolder(MarkHolder markHolder)
This method is meant to aid in cleanup. It is not efficient so don't use it in production.
-
readForTest
public static MarkList readForTest()
May Returnnull.
-
-