|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectbr.com.oncast.dev.lobo.Telemetry
public class Telemetry
Telemetry collector.
Telemetry is used to collect profiling metrics in each profile scenario.
It is simple to define metrics in your scenario, take a look at the example:
@Profile
public void profileForLoop() throws Exception {
for (int i=0;i<1000;i++) {
for (int j=0;j<100;j++) Thread.sleep(10);
}
}
In this code the default metric "scenario-timespan" will collect the overall time of the method execution which will
be something like 1000000 milliseconds. But imagine that what is to be mesured is not the performance of all code,
what is to be done is to test the for (int j=0;j<100;j++) Thread.sleep(10); line 1000 times and
collect the average result.
@Profile
public void profileForLoop() throws Exception {
for (int i=0;i<1000;i++) {
Telemetry.startMetric("100-sleep",MetricType.AVERAGE);
for (int j=0;j<100;j++) Thread.sleep(10);
Telemetry.endMetric("100-sleep");
}
}
| Constructor Summary | |
|---|---|
Telemetry()
|
|
| Method Summary | |
|---|---|
static void |
endMetric(java.lang.String metricName)
Ends collecting the given metric. |
static void |
startMetric(java.lang.String metricName)
Starts collecting the given metric. |
static void |
startMetric(java.lang.String metricName,
MetricType type)
Starts collecting the given metric. |
static void |
switchMetric(java.lang.String metricName)
Switches the metric. Only valid for multi valored metrics. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Telemetry()
| Method Detail |
|---|
public static void startMetric(java.lang.String metricName)
metricName - the metric name.
public static void startMetric(java.lang.String metricName,
MetricType type)
metricName - the metric name.type - the metric collection type.public static void switchMetric(java.lang.String metricName)
metricName - the metric name.public static void endMetric(java.lang.String metricName)
metricName - the metric name.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||