Package com.apple.foundationdb
Class MapEventKeeper
java.lang.Object
com.apple.foundationdb.MapEventKeeper
- All Implemented Interfaces:
EventKeeper
A simple map-based EventKeeper.
This class is thread-safe(per the
EventKeeper spec). It holds all counters in memory;-
Nested Class Summary
Nested classes/interfaces inherited from interface com.apple.foundationdb.EventKeeper
EventKeeper.Event, EventKeeper.Events -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcount(EventKeeper.Event event, long amt) Count the number of events which occurred.longgetCount(EventKeeper.Event event) Get the number of events which occurred since this timer was created.longgetTimeNanos(EventKeeper.Event event) Get the amount of time taken by this event, in nanoseconds.voidtimeNanos(EventKeeper.Event event, long nanos) Count the time taken to perform an event, in nanoseconds.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.apple.foundationdb.EventKeeper
getTime, increment, time
-
Constructor Details
-
MapEventKeeper
public MapEventKeeper()
-
-
Method Details
-
count
Description copied from interface:EventKeeperCount the number of events which occurred.- Specified by:
countin interfaceEventKeeper- Parameters:
event- the event which occurredamt- the number of times that even occurred
-
timeNanos
Description copied from interface:EventKeeperCount the time taken to perform an event, in nanoseconds. Note thatevent.isTimeEvent()should return true here.- Specified by:
timeNanosin interfaceEventKeeper- Parameters:
event- the event which was timed (the event should be a time event).nanos- the amount of time taken (in nanoseconds)
-
getCount
Description copied from interface:EventKeeperGet the number of events which occurred since this timer was created. If the event was never recorded, then this returns 0.- Specified by:
getCountin interfaceEventKeeper- Parameters:
event- the event to get the count for- Returns:
- the number of times the event was triggered. If the event has never been triggered, then this returns 0
-
getTimeNanos
Description copied from interface:EventKeeperGet the amount of time taken by this event, in nanoseconds.- Specified by:
getTimeNanosin interfaceEventKeeper- Parameters:
event- the event to get the time for- Returns:
- the total time measured for this event, in nanoseconds. If the event was never recorded, return 0 instead.
-