public class BuildMetrics extends Object implements Comparable<BuildMetrics>
BuildMetrics
's provides the services to record time spent in the various states and
should be tied to a unit of work. The start(io.takari.maven.builder.smart.BuildMetrics.Timer)
and stop(io.takari.maven.builder.smart.BuildMetrics.Timer)
services used with the corresponding Timer
provide the capability to accumulate time
towards the Timer
.Modifier and Type | Class and Description |
---|---|
static class |
BuildMetrics.Timer |
Constructor and Description |
---|
BuildMetrics()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(BuildMetrics bm) |
long |
getMetricElapsedTime(BuildMetrics.Timer timer,
TimeUnit desiredUnit)
Returns the provided
timer elapsed time in the unit specified by desiredUnit . |
long |
getMetricMillis(BuildMetrics.Timer timer)
Returns the provided
timer elapsed time in milliseconds. |
void |
start(BuildMetrics.Timer timer)
Start the
Stopwatch for the given Timer . |
void |
stop(BuildMetrics.Timer timer)
Stops the
Stopwatch for the given Timer . |
String |
toString() |
public BuildMetrics()
Stopwatch
for each value in Timer
.public void start(BuildMetrics.Timer timer)
Stopwatch
for the given Timer
.timer
- public void stop(BuildMetrics.Timer timer)
Stopwatch
for the given Timer
.timer
- public long getMetricElapsedTime(BuildMetrics.Timer timer, TimeUnit desiredUnit)
timer
elapsed time in the unit specified by desiredUnit
.timer
- desiredUnit
- desiredUnit
public long getMetricMillis(BuildMetrics.Timer timer)
timer
elapsed time in milliseconds.timer
- public int compareTo(BuildMetrics bm)
compareTo
in interface Comparable<BuildMetrics>
Copyright © 2017. All rights reserved.