|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.test.performance.Performance
public class Performance
Helper for performance measurements. Currently provides performance meter creation and checking of measurements. This class is not intended to be subclassed by clients.
Field Summary | |
---|---|
static int |
EXPLAINS_DEGRADATION_COMMENT
A comment kind of a comment that explains a performance degradation. |
Method Summary | |
---|---|
void |
assertPerformance(PerformanceMeter performanceMeter)
Asserts default properties of the measurements captured by the given performance meter. |
void |
assertPerformanceInAbsoluteBand(PerformanceMeter performanceMeter,
Dimension dim,
int lowerBand,
int upperBand)
Asserts that the measurement specified by the dimension captured in the given performance meter is within a certain range with respect to some reference value. |
void |
assertPerformanceInRelativeBand(PerformanceMeter performanceMeter,
Dimension dim,
int lowerPercentage,
int upperPercentage)
Asserts that the measurement specified by the dimension captured in the given performance meter is within a certain range with respect to some reference value. |
PerformanceMeter |
createPerformanceMeter(java.lang.String scenarioId)
Creates a performance meter for the given scenario id. |
static Performance |
getDefault()
Returns the singleton of Performance |
java.lang.String |
getDefaultScenarioId(junit.framework.TestCase test)
Returns a default scenario id for the given test. |
java.lang.String |
getDefaultScenarioId(junit.framework.TestCase test,
java.lang.String id)
Returns a default scenario id for the given test and id. |
PerformanceMeter |
getNullPerformanceMeter()
Returns the null performance meter singleton. |
void |
setComment(PerformanceMeter pm,
int commentKind,
java.lang.String commentText)
Set a comment for the scenario represented by the given PerformanceMeter. |
void |
tagAsGlobalSummary(PerformanceMeter pm,
java.lang.String shortName,
Dimension dimension)
Mark the scenario represented by the given PerformanceMeter to be included into the global and the component performance summary. |
void |
tagAsGlobalSummary(PerformanceMeter pm,
java.lang.String shortName,
Dimension[] dimensions)
Mark the scenario represented by the given PerformanceMeter to be included into the global and the component performance summary. |
void |
tagAsSummary(PerformanceMeter pm,
java.lang.String shortName,
Dimension dimension)
Mark the scenario represented by the given PerformanceMeter to be included into the component performance summary. |
void |
tagAsSummary(PerformanceMeter pm,
java.lang.String shortName,
Dimension[] dimensions)
Mark the scenario represented by the given PerformanceMeter to be included into the component performance summary. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int EXPLAINS_DEGRADATION_COMMENT
Method Detail |
---|
public static Performance getDefault()
Performance
Performance
public void assertPerformance(PerformanceMeter performanceMeter)
performanceMeter
- the performance meter
java.lang.RuntimeException
- if the properties do not holdpublic void assertPerformanceInRelativeBand(PerformanceMeter performanceMeter, Dimension dim, int lowerPercentage, int upperPercentage)
performanceMeter
- the performance meterdim
- the Dimension to checklowerPercentage
- a negative number indicating the percentage the measured value is allowed to be smaller than some reference valueupperPercentage
- a positive number indicating the percentage the measured value is allowed to be greater than some reference value
java.lang.RuntimeException
- if the properties do not holdpublic void assertPerformanceInAbsoluteBand(PerformanceMeter performanceMeter, Dimension dim, int lowerBand, int upperBand)
performanceMeter
- the performance meterdim
- the Dimension to checklowerBand
- a negative number indicating the absolute amount the measured value is allowed to be smaller than some reference valueupperBand
- a positive number indicating the absolute amount the measured value is allowed to be greater than some reference value
java.lang.RuntimeException
- if the properties do not holdpublic PerformanceMeter createPerformanceMeter(java.lang.String scenarioId)
scenarioId
- the scenario id
java.lang.IllegalArgumentException
- if a performance meter for the given
scenario id has already been createdpublic PerformanceMeter getNullPerformanceMeter()
public java.lang.String getDefaultScenarioId(junit.framework.TestCase test)
test.getName()
is not
null
.
test
- the test
public java.lang.String getDefaultScenarioId(junit.framework.TestCase test, java.lang.String id)
test.getName()
is
not null
. The id distinguishes multiple scenarios in
the same test.
test
- the testid
- the id
public void tagAsGlobalSummary(PerformanceMeter pm, java.lang.String shortName, Dimension dimension)
pm
- the PerformanceMetershortName
- a short (shorter than 40 characters) descriptive name of the scenariodimension
- the dimension to show in the summarypublic void tagAsGlobalSummary(PerformanceMeter pm, java.lang.String shortName, Dimension[] dimensions)
pm
- the PerformanceMetershortName
- a short (shorter than 40 characters) descriptive name of the scenariodimensions
- an array of dimensions to show in the summarypublic void tagAsSummary(PerformanceMeter pm, java.lang.String shortName, Dimension dimension)
pm
- the PerformanceMetershortName
- a short (shorter than 40 characters) descriptive name of the scenariodimension
- the dimension to show in the summarypublic void tagAsSummary(PerformanceMeter pm, java.lang.String shortName, Dimension[] dimensions)
pm
- the PerformanceMetershortName
- a short (shorter than 40 characters) descriptive name of the scenariodimensions
- an array of dimensions to show in the summarypublic void setComment(PerformanceMeter pm, int commentKind, java.lang.String commentText)
pm
- the PerformanceMetercommentKind
- kind of comment. Must be EXPLAINS_DEGRADATION_COMMENT to have an effect.commentText
- the comment (shorter than 400 characters)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |