Package com.apple.foundationdb

## Class MapEventKeeper

- java.lang.Object
- - com.apple.foundationdb.MapEventKeeper

All Implemented Interfaces:
  `EventKeeper`

    public class MapEventKeeper
    extends java.lang.Object
    implements 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
`MapEventKeeper()`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `count​(EventKeeper.Event event, long amt)` Count the number of events which occurred.
`long` `getCount​(EventKeeper.Event event)` Get the number of events which occurred since this timer was created.
`long` `getTimeNanos​(EventKeeper.Event event)` Get the amount of time taken by this event, in nanoseconds.
`void` `timeNanos​(EventKeeper.Event event, long nanos)` Count the time taken to perform an event, in nanoseconds.

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface com.apple.foundationdb.EventKeeper

`getTime, increment, time`

### Constructor Detail

#### MapEventKeeper

    public MapEventKeeper()

### Method Detail

#### count

    public void count​(EventKeeper.Event event,
                      long amt)

Description copied from interface: `EventKeeper`
Count the number of events which occurred.

Specified by:
  `count` in interface `EventKeeper`
Parameters:
  `event` - the event which occurred
  `amt` - the number of times that even occurred

#### timeNanos

    public void timeNanos​(EventKeeper.Event event,
                          long nanos)

Description copied from interface: `EventKeeper`
Count the time taken to perform an event, in nanoseconds. Note that `event.isTimeEvent()` should return true here.

Specified by:
  `timeNanos` in interface `EventKeeper`
Parameters:
  `event` - the event which was timed (the event should be a time event).
  `nanos` - the amount of time taken (in nanoseconds)

#### getCount

    public long getCount​(EventKeeper.Event event)

Description copied from interface: `EventKeeper`
Get the number of events which occurred since this timer was created. If the event was never recorded, then this returns 0.

Specified by:
  `getCount` in interface `EventKeeper`
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

    public long getTimeNanos​(EventKeeper.Event event)

Description copied from interface: `EventKeeper`
Get the amount of time taken by this event, in nanoseconds.

Specified by:
  `getTimeNanos` in interface `EventKeeper`
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.