This implementation has the advantage of being cache friendly, benefiting from cache locality when counting/discarding the tracked metrics.
Besides this, metrics can also be quickly cloned, which is important for the lock-free algorithms which are operating with immutable objects.
| Modifier and Type | Field and Description |
|---|---|
| private static final int | |
| private int[] | |
| private static final int | |
| private long[] | |
| private static final int | |
| private static final int | |
| private static final int | |
| private static final int | |
| private static final int | |
| private static final int | |
| private static final int | |
| private static final int |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv PackedAggregation | |
| pack-priv void | |
| public int | getNumberOfCalls()
Implements io. Returns the total number of all calls in this measurement. |
| public int | getNumberOfFailedCalls()
Implements io. Returns the number of failed calls in this measurement. |
| public int | getNumberOfSlowCalls()
Implements io. Returns the number of calls in this measurement which were slower than a certain threshold. |
| public int | getNumberOfSlowFailedCalls()
Implements io. Returns the number of failed calls in this measurement which were slower than a certain threshold. |
| public long | getTotalDurationInMillis()
Implements io. Returns the total duration of all calls in this measurement. |
| public void | record(long
the call duration duration, TimeUnit the time unit of the call duration durationUnit, Metrics.the outcome of the call outcomeImplements io. Records a call duration and its outcome. |
| public String |
| CALLS_INDEX | back to summary |
|---|---|
| private static final int CALLS_INDEX | |
| counts | back to summary |
|---|---|
| private int[] counts | |
| DURATION_INDEX | back to summary |
|---|---|
| private static final int DURATION_INDEX | |
| durations | back to summary |
|---|---|
| private long[] durations | |
| FAILED_CALLS_INDEX | back to summary |
|---|---|
| private static final int FAILED_CALLS_INDEX | |
| FAILED_SLOW_CALLS_INDEX | back to summary |
|---|---|
| private static final int FAILED_SLOW_CALLS_INDEX | |
| SLOW_CALLS_INDEX | back to summary |
|---|---|
| private static final int SLOW_CALLS_INDEX | |
| TOTAL_CALLS_INDEX | back to summary |
|---|---|
| private static final int TOTAL_CALLS_INDEX | |
| TOTAL_DURATION_INDEX | back to summary |
|---|---|
| private static final int TOTAL_DURATION_INDEX | |
| TOTAL_FAILED_CALLS_INDEX | back to summary |
|---|---|
| private static final int TOTAL_FAILED_CALLS_INDEX | |
| TOTAL_FAILED_SLOW_CALLS_INDEX | back to summary |
|---|---|
| private static final int TOTAL_FAILED_SLOW_CALLS_INDEX | |
| TOTAL_SLOW_CALLS_INDEX | back to summary |
|---|---|
| private static final int TOTAL_SLOW_CALLS_INDEX | |
| PackedAggregation | back to summary |
|---|---|
| public PackedAggregation() | |
| PackedAggregation | back to summary |
|---|---|
| public PackedAggregation(long[] durations, int[] counts) | |
| copy | back to summary |
|---|---|
| pack-priv PackedAggregation copy() | |
| discard | back to summary |
|---|---|
| pack-priv void discard(PackedAggregation discarded) | |
| getNumberOfCalls | back to summary |
|---|---|
| public int getNumberOfCalls() Implements io. Doc from io. Returns the total number of all calls in this measurement.
| |
| getNumberOfFailedCalls | back to summary |
|---|---|
| public int getNumberOfFailedCalls() Implements io. Doc from io. Returns the number of failed calls in this measurement.
| |
| getNumberOfSlowCalls | back to summary |
|---|---|
| public int getNumberOfSlowCalls() Implements io. Doc from io. Returns the number of calls in this measurement which were slower than a certain threshold.
| |
| getNumberOfSlowFailedCalls | back to summary |
|---|---|
| public int getNumberOfSlowFailedCalls() Implements io. Doc from io. Returns the number of failed calls in this measurement which were slower than a certain threshold.
| |
| getTotalDurationInMillis | back to summary |
|---|---|
| public long getTotalDurationInMillis() Implements io. Doc from io. Returns the total duration of all calls in this measurement.
| |
| record | back to summary |
|---|---|
| public void record(long duration, TimeUnit durationUnit, Metrics. Implements io. Doc from io. Records a call duration and its outcome. | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |