public class Profiler extends Object implements DiagnosticsHandler.ProbeHandler
AverageMinMax
and provides an impl of DiagnosticsHandler.ProbeHandler
.
Note that this class in unsynchronized and needs external synchronization.Modifier and Type | Field and Description |
---|---|
protected AverageMinMax |
avg |
protected String |
name |
protected TimeUnit |
unit |
Constructor and Description |
---|
Profiler(String name,
TimeUnit unit)
Creates a Profiler instance which will reply to key 'name'.
|
Modifier and Type | Method and Description |
---|---|
Profiler |
add(long time) |
double |
average() |
Profiler |
clear() |
long |
count() |
Map<String,String> |
handleProbe(String... keys)
Handles a probe.
|
long |
max() |
long |
min() |
String[] |
supportedKeys()
Returns a list of supported keys
|
String |
toString() |
protected static String |
toString(TimeUnit unit) |
protected final AverageMinMax avg
protected final String name
protected final TimeUnit unit
public Profiler add(long time)
public long min()
public long max()
public double average()
public long count()
public Profiler clear()
public Map<String,String> handleProbe(String... keys)
DiagnosticsHandler.ProbeHandler
handleProbe
in interface DiagnosticsHandler.ProbeHandler
public String[] supportedKeys()
DiagnosticsHandler.ProbeHandler
supportedKeys
in interface DiagnosticsHandler.ProbeHandler
Copyright © 2018 JBoss, a division of Red Hat. All rights reserved.