Class Storage
java.lang.Object
io.perfmark.impl.Storage
Storage is responsible for storing and returning recorded marks. This is a low level class and
not intended for use by users. Instead, the
TraceEventWriter and TraceEventViewer
classes 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.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final ConcurrentMap<Object, Reference<MarkHolder>> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic longread()Returns a list ofMarkLists across all reachable threads.static MarkListMay Returnnull.static voidregisterMarkHolder(MarkHolder markHolder) Note: it is the responsibility of the caller to keep a strong reference to the markHolder.static voidRemoves the global Read index on all storage, but leaves local storage in place.static voidRemoves all data for the calling Thread.static voidunregisterMarkHolder(MarkHolder markHolder) This method is meant to aid in cleanup.
-
Field Details
-
allMarkHolders
-
-
Constructor Details
-
Storage
private Storage()
-
-
Method Details
-
getInitNanoTime
public static long getInitNanoTime() -
read
-
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
Note: it is the responsibility of the caller to keep a strong reference to the markHolder. -
unregisterMarkHolder
This method is meant to aid in cleanup. It is not efficient so don't use it in production. -
readForTest
May Returnnull.
-