| Package | Description |
|---|---|
| net.obvj.performetrics |
Provides convenient classes for extracting performance metrics of Java code.
|
| net.obvj.performetrics.monitors |
Provides classes that can monitor other ones.
|
| Modifier and Type | Method and Description |
|---|---|
Counter.Type |
Counter.getType()
Returns the
Counter.Type associated with this counter. |
static Counter.Type |
Counter.Type.valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static Counter.Type[] |
Counter.Type.values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
| Modifier and Type | Method and Description |
|---|---|
Map<Counter.Type,List<Counter>> |
Stopwatch.getAllCountersByType()
Returns a map of populated counters grouped by type, where each entry in the counters
list represents a timing session.
|
List<Counter.Type> |
Stopwatch.getTypes()
Returns the counter types associated with this stopwatch instance.
|
| Modifier and Type | Method and Description |
|---|---|
static Stopwatch |
Stopwatch.createStarted(Counter.Type... types)
Provides a started stopwatch with specific counter types, for convenience.
|
Duration |
Stopwatch.elapsedTime(Counter.Type type)
Returns the total elapsed time for a specific counter.
|
Duration |
TimingSession.elapsedTime(Counter.Type type)
A convenient method that returns the elapsed time of a specific counter.
|
double |
Stopwatch.elapsedTime(Counter.Type type,
TimeUnit timeUnit)
Returns the total elapsed time for a specific counter, in the specified time unit.
|
double |
TimingSession.elapsedTime(Counter.Type type,
TimeUnit timeUnit)
A convenient method that returns the elapsed time of a specific counter, in the
specified time unit.
|
double |
Stopwatch.elapsedTime(Counter.Type type,
TimeUnit timeUnit,
ConversionMode conversionMode)
Returns the total elapsed time for a specific counter, in the specified time unit, with
a custom
ConversionMode applied. |
double |
TimingSession.elapsedTime(Counter.Type type,
TimeUnit timeUnit,
ConversionMode conversionMode)
A convenient method that returns the elapsed time of a specific counter, in the
specified time unit, by applying a custom
ConversionMode. |
Counter |
TimingSession.getCounter(Counter.Type type)
Returns the counter instance associated with a given type in this timing session.
|
List<Counter> |
Stopwatch.getCounters(Counter.Type type)
Returns a list of populated counters for a specific type in this stopwatch, or an empty
list if no counter is found (for example, if the stopwatch was not yet started, or
after reset).
|
static MonitoredOperation |
Performetrics.monitorOperation(Runnable runnable,
Counter.Type... types)
Runs the specified
Runnable, which can also be a lambda expression, and
collects metrics for the specified counter type(s) only. |
| Constructor and Description |
|---|
Counter(Counter.Type type)
Builds a Counter with a given type and default time unit.
|
Counter(Counter.Type type,
TimeUnit timeUnit)
Builds a Counter with the given type and time unit.
|
Counter(Counter.Type type,
TimeUnit timeUnit,
ConversionMode conversionMode)
Builds a Counter with the given type, time unit, and conversion mode.
|
Stopwatch(Counter.Type... types)
Creates a new stopwatch with specific counter types.
|
TimingSession(Counter.Type... types)
Creates a new timing session with custom counter types.
|
| Modifier and Type | Method and Description |
|---|---|
Map<Counter.Type,List<Counter>> |
MonitoredOperation.getAllCountersByType()
Returns a map of populated counters grouped by type, where each entry in the counters
list represents a timing session.
|
| Modifier and Type | Method and Description |
|---|---|
Duration |
MonitoredOperation.elapsedTime(Counter.Type type)
Returns the total elapsed time of a specific counter type.
|
double |
MonitoredOperation.elapsedTime(Counter.Type type,
TimeUnit timeUnit)
Returns the total elapsed time of a specific counter type, in the specified time unit.
|
double |
MonitoredOperation.elapsedTime(Counter.Type type,
TimeUnit timeUnit,
ConversionMode conversionMode)
Returns the total elapsed time of a specific counter, in the specified time unit, with
a custom
ConversionMode applied. |
List<Counter> |
MonitoredOperation.getCounters(Counter.Type type)
Returns all counters associated with a given type in this monitored operation.
|
| Constructor and Description |
|---|
MonitoredCallable(Callable<V> callable,
Counter.Type... types)
Builds this monitored operation with a given
Callable and one or more specific
counter types to be maintained. |
MonitoredRunnable(Runnable runnable,
Counter.Type... types)
Builds this monitored operation with a given
Runnable and one or more specific
counter types to be maintained. |
Copyright © 2022. All rights reserved.