public class Measurement extends Object
Reporter
.
It is typically a combination of multiple Measuremen Units
.
The way they are combined is the matter of a particular Reporter
implementation.Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_RESULT
The default result name.
|
Constructor and Description |
---|
Measurement(long percentage,
long time,
long iteration)
Creates a new instance of Measurement.
|
Modifier and Type | Method and Description |
---|---|
Object |
get()
Gets a default result from the result map.
|
Object |
get(String name)
Gets the result with the given name.
|
Map<String,Object> |
getAll()
Gets the map with the measured results.
|
long |
getIteration()
Gets the number of iteration to which the
Measurement is related. |
long |
getPercentage()
Gets the percentage value of progress of the scenario execution.
|
long |
getTime()
Gets the time of the scenario execution in milliseconds.
|
void |
remove(String name)
Removes the result stored under the given
name from the results map. |
void |
set(Object result)
Puts the default result in the result map.
|
void |
set(String name,
Object result)
Puts the
result in the result map with a given name used as a key. |
void |
setAll(Map<String,Object> newResults)
Puts all the results from the result map into the measurement.
|
String |
toString() |
public static final String DEFAULT_RESULT
public Measurement(long percentage, long time, long iteration)
percentage
- The current progress of the scenario execution in percents.time
- The current time of the scenario execution.iteration
- The current iteration of the scenario execution.public long getPercentage()
public long getTime()
public long getIteration()
Measurement
is related.public Map<String,Object> getAll()
public Object get()
DEFAULT_RESULT
key.public Object get(String name)
name
- The name of the result to get.public void set(String name, Object result)
result
in the result map with a given name
used as a key.name
- The name of the result.result
- The result value.public void set(Object result)
DEFAULT_RESULT
key.result
- The default result value.public void remove(String name)
name
from the results map.name
- The name of the result to be removed.public void setAll(Map<String,Object> newResults)
newResults
- New results to be added.Copyright © 2010–2017 PerfCake Community. All rights reserved.