Class Lib
- java.lang.Object
-
- com.dkfqs.measuringagent.javascript.executor.Lib
-
public class Lib extends java.lang.ObjectA library with methods which can be called from JavaScript and supports also the All Purpose Interface.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringERROR_SEVERITY_ERRORError severity 'error': After the error has occurred then the simulated aborts the execution of the current session loop and starts the execution of the next session loop.static java.lang.StringERROR_SEVERITY_FATALError severity 'fatal': After the error has occurred then the simulated user aborts any further execution of the test, which means that the test has ended for this simulated user.static java.lang.StringERROR_SEVERITY_WARNINGError severity 'warning': After the error has occurred then the simulated user continues with the execution of the current session loop.static java.lang.StringSTATISTIC_TYPE_AVERAGE_AND_CURRENT_VALUEAn average and current value statistic.static java.lang.StringSTATISTIC_TYPE_CUMULATIVE_COUNTER_LONGA cumulative long counter statistic.static java.lang.StringSTATISTIC_TYPE_EFFICIENCY_RATIO_PERCENTAn efficiency ratio percent value statistic.static java.lang.StringSTATISTIC_TYPE_SAMPLE_EVENT_TIME_CHARTA chart with samples of event timestamp and (measured) long value..static java.lang.StringSTATISTIC_TYPE_THROUGHPUT_TIME_CHARTA chart of a throughput per second.java.io.FilestopTestjobFileAll Purpose Interface: used to check if the testjob must be stopped.java.io.FilesuspendTestjobFileAll Purpose Interface: used to check if the testjob must be suspended.
-
Constructor Summary
Constructors Constructor Description Lib(com.dkfqs.measuringagent.javascript.JavaScriptRhinoTestJobExecutorContext testJobExecutorContext, com.dkfqs.measuringagent.javascript.executor.RhinoExecutorThread rhinoExecutorThread, com.dkfqs.measuringagent.javascript.executor.ExecutorConsoleLog executorConsoleLog, int simulatedUserNumber)Create a new instance - per simulated user.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAverageDeltaAndCurrentValue(long statisticId, long currentValue)All Purpose Interface: Add one delta value to the average and set the current value for a 'average-and-current-value' statistic.voidaddAverageDeltaAndCurrentValue(long statisticId, long sumValuesDelta, long numValuesDelta, long currentValue)All Purpose Interface: Add delta values to the average and set the current value for a 'average-and-current-value' statistic.voidaddAverageDeltaAndCurrentValue(long statisticId, long sumValuesDelta, long numValuesDelta, long currentValue, long currentValueTimestamp)All Purpose Interface: Add delta values to the average and set the current value for a 'average-and-current-value' statistic.voidaddCounterLong(long statisticId, long value)All Purpose Interface: Increment the counter of a declared 'cumulative-counter-long' statistic.voidaddEfficiencyRatioDelta(long statisticId, long efficiencyDeltaValue, long inefficiencyDeltaValue)All Purpose Interface: Add efficiency ratio delta values to a 'efficiency-ratio-percent' statistic.voidaddError(long statisticId, java.lang.String errorSubject, java.lang.String errorSeverity, java.lang.String errorType, java.lang.String errorLog, java.lang.String errorContext)All Purpose Interface: Add an error to the test result.voidaddSampleError(long statisticId, java.lang.String errorSubject, java.lang.String errorSeverity, java.lang.String errorType, java.lang.String errorLog, java.lang.String errorContext)All Purpose Interface: Add an error to a declared statistic (for sample-event-time-chart statistics only, when measuring of a data sample did fail).voidaddSampleValue(long statisticId, long value)All Purpose Interface: Add a measured long value to a statistic.voidaddTestResultAnnotationExecEvent(int negativeEventId, java.lang.String eventText)All Purpose Interface: Add an annotation event to the test result.voidaddThroughputDelta(long statisticId, double deltaValue)All Purpose Interface: Add a measured delta value to a throughput statistic.voidappendLineToOutputFile(java.lang.String fileName, java.lang.String line)Append a line to an output file.voiddeclareAverageAndCurrentValueStatistic(long statisticId, java.lang.String statisticTitle, java.lang.String unitText)All Purpose Interface: Declare a new 'average and current value' statistic.longdeclareAverageAndCurrentValueStatistic(java.lang.String statisticTitle, java.lang.String unitText)All Purpose Interface: Declare a new 'average and current value' statistic.voiddeclareCumulativeCounterLongStatistic(long statisticId, java.lang.String statisticTitle, java.lang.String unitText)All Purpose Interface: Declare a new 'cumulative counter long' statistic.longdeclareCumulativeCounterLongStatistic(java.lang.String statisticTitle, java.lang.String unitText)All Purpose Interface: Declare a new 'cumulative counter long' statistic.voiddeclareEfficiencyRatioPercentStatistic(long statisticId, java.lang.String statisticTitle, java.lang.String unitText)All Purpose Interface: Declare a new 'efficiency ratio percent' statistic.longdeclareEfficiencyRatioPercentStatistic(java.lang.String statisticTitle, java.lang.String unitText)All Purpose Interface: Declare a new 'efficiency ratio percent' statistic.voiddeclareSampleEventTimeChartStatistic(long statisticId, java.lang.String statisticTitle, java.lang.String yAxisTitle, java.lang.String unitText)All Purpose Interface: Declare a new 'sample event time chart' statistic.voiddeclareSampleEventTimeChartStatistic(long statisticId, java.lang.String statisticTitle, java.lang.String yAxisTitle, java.lang.String unitText, boolean isPartOfMeasureSessionTime)All Purpose Interface: Declare a new 'sample event time chart' statistic.voiddeclareSampleEventTimeChartStatistic(long statisticId, java.lang.String statisticTitle, java.lang.String yAxisTitle, java.lang.String unitText, boolean addToSummaryStatistic, java.lang.String backgroundColor)All Purpose Interface: Declare a new 'sample event time chart' statistic.voiddeclareSampleEventTimeChartStatistic(long statisticId, java.lang.String statisticTitle, java.lang.String yAxisTitle, java.lang.String unitText, boolean addToSummaryStatistic, java.lang.String backgroundColor, boolean isPartOfMeasureSessionTime)All Purpose Interface: Declare a new 'sample event time chart' statistic.longdeclareSampleEventTimeChartStatistic(java.lang.String statisticTitle, java.lang.String yAxisTitle, java.lang.String unitText)All Purpose Interface: Declare a new 'sample event time chart' statistic.longdeclareSampleEventTimeChartStatistic(java.lang.String statisticTitle, java.lang.String yAxisTitle, java.lang.String unitText, boolean isPartOfMeasureSessionTime)All Purpose Interface: Declare a new 'sample event time chart' statistic.voiddeclareStatistic(long statisticId, java.lang.String statisticType, java.lang.String statisticTitle, java.lang.String statisticSubtitle, java.lang.String yAxisTitle, java.lang.String unitText, int sortPosition, boolean addToSummaryStatistic, java.lang.String backgroundColor)All Purpose Interface: Declare a new statistic (field isPartOfMeasureSessionTime = false).voiddeclareStatistic(long statisticId, java.lang.String statisticType, java.lang.String statisticTitle, java.lang.String statisticSubtitle, java.lang.String yAxisTitle, java.lang.String unitText, int sortPosition, boolean addToSummaryStatistic, java.lang.String backgroundColor, boolean isPartOfMeasureSessionTime)All Purpose Interface: Declare a new statistic.voiddeclareThroughputTimeChartStatistic(long statisticId, java.lang.String statisticTitle, java.lang.String yAxisTitle, java.lang.String unitText)All Purpose Interface: Declare a new 'throughput time chart' statistic.longdeclareThroughputTimeChartStatistic(java.lang.String statisticTitle, java.lang.String yAxisTitle, java.lang.String unitText)All Purpose Interface: Declare a new 'throughput time chart' statistic.intgetCurrentTestDuration()Get the current test duration in seconds.java.util.List<java.lang.String>getInputFileNamesList()Get a unsorted list of all input file names.java.lang.String[]getInputFileNextLineTokens(java.lang.String fileName)Get the next line from an input file and split it into tokens - This method is thread safe.booleanisTestJobStopTriggered()All Purpose Interface: Get if the a stop of the test job is triggered.java.lang.StringreadFileFromTestDirectoryB64(java.lang.String fileName)Read a file from the test sub directory of the test job and convert the file content to base64 format.java.lang.StringreadFileToStringFromTestDirectory(java.lang.String fileName)Read a file to string from the test sub directory of the test job.voidregisterExecuteEnd()All Purpose Interface: Register that a simulated user has ended the test.voidregisterExecuteResume()All Purpose Interface: Register that a simulated user resume the execution of the test.voidregisterExecuteStart()All Purpose Interface: Register that a simulated user has started the test.voidregisterExecuteSuspend()All Purpose Interface: Register that a simulated user suspend the execution of the test.voidregisterLoopFailed()All Purpose Interface: Register that a session loop has failed.voidregisterLoopPassed(long loopTime)All Purpose Interface: Register that a session loop has passed.longregisterLoopStart()All Purpose Interface: Register the start of a session loop.voidregisterSampleStart(long statisticId)All Purpose Interface: Register that the measuring of a long value sample has startedvoidsharedUserMapClear()Clear the shared user map.java.lang.StringsharedUserMapGet(java.lang.String key)Get from the shared user map the value of a specific key.booleansharedUserMapHas(java.lang.String key)Get if the shared user map contains a specific key.JsonArraysharedUserMapKeys()Get a JSON array as string of all keys of the shared user map.voidsharedUserMapRemove(java.lang.String key)Remove a key with its value from the shared user map.voidsharedUserMapSet(java.lang.String key, java.lang.String value)Add or update an entry in the shared user map with a specified key and a value.voidsleep(long millis)Causes the currently executing thread to sleep for the specified number of milliseconds.voidwaitSuspendResumeTestJob()All Purpose Interface: Check if the test job is suspended and wait until the testjob is resumed, or if the max test duration is reached.voidwriteAndClearConsoleLog()Write the JavaScript console log of this simulated user to the JavaScriptRhinoTestJobExecutor main log, and clear the JavaScript console log.
-
-
-
Field Detail
-
STATISTIC_TYPE_SAMPLE_EVENT_TIME_CHART
public static final java.lang.String STATISTIC_TYPE_SAMPLE_EVENT_TIME_CHART
A chart with samples of event timestamp and (measured) long value..- See Also:
- Constant Field Values
-
STATISTIC_TYPE_THROUGHPUT_TIME_CHART
public static final java.lang.String STATISTIC_TYPE_THROUGHPUT_TIME_CHART
A chart of a throughput per second.- See Also:
- Constant Field Values
-
STATISTIC_TYPE_CUMULATIVE_COUNTER_LONG
public static final java.lang.String STATISTIC_TYPE_CUMULATIVE_COUNTER_LONG
A cumulative long counter statistic.- See Also:
- Constant Field Values
-
STATISTIC_TYPE_EFFICIENCY_RATIO_PERCENT
public static final java.lang.String STATISTIC_TYPE_EFFICIENCY_RATIO_PERCENT
An efficiency ratio percent value statistic.- See Also:
- Constant Field Values
-
STATISTIC_TYPE_AVERAGE_AND_CURRENT_VALUE
public static final java.lang.String STATISTIC_TYPE_AVERAGE_AND_CURRENT_VALUE
An average and current value statistic.- See Also:
- Constant Field Values
-
ERROR_SEVERITY_WARNING
public static final java.lang.String ERROR_SEVERITY_WARNING
Error severity 'warning': After the error has occurred then the simulated user continues with the execution of the current session loop. Error color = yellow.- See Also:
- Constant Field Values
-
ERROR_SEVERITY_ERROR
public static final java.lang.String ERROR_SEVERITY_ERROR
Error severity 'error': After the error has occurred then the simulated aborts the execution of the current session loop and starts the execution of the next session loop. Error color = red.- See Also:
- Constant Field Values
-
ERROR_SEVERITY_FATAL
public static final java.lang.String ERROR_SEVERITY_FATAL
Error severity 'fatal': After the error has occurred then the simulated user aborts any further execution of the test, which means that the test has ended for this simulated user. Error color = black.- See Also:
- Constant Field Values
-
stopTestjobFile
public final java.io.File stopTestjobFile
All Purpose Interface: used to check if the testjob must be stopped.
-
suspendTestjobFile
public final java.io.File suspendTestjobFile
All Purpose Interface: used to check if the testjob must be suspended.
-
-
Constructor Detail
-
Lib
public Lib(com.dkfqs.measuringagent.javascript.JavaScriptRhinoTestJobExecutorContext testJobExecutorContext, com.dkfqs.measuringagent.javascript.executor.RhinoExecutorThread rhinoExecutorThread, com.dkfqs.measuringagent.javascript.executor.ExecutorConsoleLog executorConsoleLog, int simulatedUserNumber) throws java.io.FileNotFoundExceptionCreate a new instance - per simulated user.- Parameters:
testJobExecutorContext- the test job executor contextrhinoExecutorThread- the Rhino executor thread of this simulated userexecutorConsoleLog- the console logsimulatedUserNumber- the simulated user number (1..n)- Throws:
java.io.FileNotFoundException- if the statistic output file of the simulated user cannot be created or opened
-
-
Method Detail
-
sleep
public void sleep(long millis) throws JavaScriptRhinoTestException, java.lang.InterruptedExceptionCauses the currently executing thread to sleep for the specified number of milliseconds.- Parameters:
millis- the number of milliseconds- Throws:
JavaScriptRhinoTestException- if millis is > (3600L * 1000L * 2L) = 2 hours, or if millis is less than zerojava.lang.InterruptedException- if the sleep was interrupted
-
sharedUserMapSet
public void sharedUserMapSet(java.lang.String key, java.lang.String value)Add or update an entry in the shared user map with a specified key and a value. This method is thread-save.- Parameters:
key- the keyvalue- the value
-
sharedUserMapHas
public boolean sharedUserMapHas(java.lang.String key)
Get if the shared user map contains a specific key. This method is thread-save.- Parameters:
key- the key- Returns:
- true if the shared user map contains the specific key
-
sharedUserMapGet
public java.lang.String sharedUserMapGet(java.lang.String key)
Get from the shared user map the value of a specific key. This method is thread-save.- Parameters:
key- the key- Returns:
- the value of the specific key, or null if the key not exists in the map
-
sharedUserMapRemove
public void sharedUserMapRemove(java.lang.String key)
Remove a key with its value from the shared user map. Nothing happens if the key not exists in the map. This method is thread-save.- Parameters:
key- the key
-
sharedUserMapClear
public void sharedUserMapClear()
Clear the shared user map. This method is thread-save.
-
sharedUserMapKeys
public JsonArray sharedUserMapKeys()
Get a JSON array as string of all keys of the shared user map. This method is thread-save.- Returns:
- a JSON array as string of all keys of the shared user map
-
readFileToStringFromTestDirectory
public java.lang.String readFileToStringFromTestDirectory(java.lang.String fileName) throws JavaScriptRhinoTestExceptionRead a file to string from the test sub directory of the test job.- Parameters:
fileName- the file name- Returns:
- the content of the whole file as string
- Throws:
JavaScriptRhinoTestException- if reading the file fails
-
readFileFromTestDirectoryB64
public java.lang.String readFileFromTestDirectoryB64(java.lang.String fileName) throws JavaScriptRhinoTestExceptionRead a file from the test sub directory of the test job and convert the file content to base64 format.- Parameters:
fileName- the file name- Returns:
- the content of the file in base64 format
- Throws:
JavaScriptRhinoTestException- if reading the file fails
-
appendLineToOutputFile
public void appendLineToOutputFile(java.lang.String fileName, java.lang.String line) throws JavaScriptRhinoTestExceptionAppend a line to an output file. The file is created if it does not exist. This method is thread-safe.- Parameters:
fileName- the file nameline- the line to write- Throws:
JavaScriptRhinoTestException- if writing the file fails
-
getInputFileNamesList
public java.util.List<java.lang.String> getInputFileNamesList()
Get a unsorted list of all input file names.- Returns:
- a unsorted list of all input file names
-
getInputFileNextLineTokens
public java.lang.String[] getInputFileNextLineTokens(java.lang.String fileName) throws JavaScriptRhinoTestExceptionGet the next line from an input file and split it into tokens - This method is thread safe.- Parameters:
fileName- the file name of the input file- Returns:
- the tokens of the line, or null if ('cyclic read' is disabled AND 'end of file' is reached)
- Throws:
JavaScriptRhinoTestException- if the input file is undefined
-
getCurrentTestDuration
public int getCurrentTestDuration()
Get the current test duration in seconds.- Returns:
- the current test duration in seconds, or -1 if the test was not started
-
isTestJobStopTriggered
public boolean isTestJobStopTriggered()
All Purpose Interface: Get if the a stop of the test job is triggered.- Returns:
- true if the a stop of the test job is triggered
-
waitSuspendResumeTestJob
public void waitSuspendResumeTestJob() throws java.lang.InterruptedExceptionAll Purpose Interface: Check if the test job is suspended and wait until the testjob is resumed, or if the max test duration is reached.- Throws:
java.lang.InterruptedException- if the current thread is interrupted
-
registerExecuteStart
public void registerExecuteStart()
All Purpose Interface: Register that a simulated user has started the test.
-
registerExecuteSuspend
public void registerExecuteSuspend()
All Purpose Interface: Register that a simulated user suspend the execution of the test.
-
registerExecuteResume
public void registerExecuteResume()
All Purpose Interface: Register that a simulated user resume the execution of the test.
-
registerExecuteEnd
public void registerExecuteEnd()
All Purpose Interface: Register that a simulated user has ended the test.
-
registerLoopStart
public long registerLoopStart()
All Purpose Interface: Register the start of a session loop.- Returns:
- the unix time when the loop is started.
- See Also:
registerLoopPassed(long),registerLoopFailed()
-
registerLoopPassed
public void registerLoopPassed(long loopTime)
All Purpose Interface: Register that a session loop has passed.- Parameters:
loopTime- The time it takes to execute the loop in milliseconds
-
registerLoopFailed
public void registerLoopFailed()
All Purpose Interface: Register that a session loop has failed.
-
declareSampleEventTimeChartStatistic
public long declareSampleEventTimeChartStatistic(java.lang.String statisticTitle, java.lang.String yAxisTitle, java.lang.String unitText)All Purpose Interface: Declare a new 'sample event time chart' statistic.- Parameters:
statisticTitle- the title shown in the UIyAxisTitle- the Y-axis title of the diagram shown in the UI, or an empty string = not shown in the UIunitText- the text for the measured unit shown in the UI, or an empty string = not shown in the UI- Returns:
- a new statistic id
- See Also:
STATISTIC_TYPE_SAMPLE_EVENT_TIME_CHART
-
declareSampleEventTimeChartStatistic
public long declareSampleEventTimeChartStatistic(java.lang.String statisticTitle, java.lang.String yAxisTitle, java.lang.String unitText, boolean isPartOfMeasureSessionTime)All Purpose Interface: Declare a new 'sample event time chart' statistic.- Parameters:
statisticTitle- the title shown in the UIyAxisTitle- the Y-axis title of the diagram shown in the UI, or an empty string = not shown in the UIunitText- the text for the measured unit shown in the UI, or an empty string = not shown in the UIisPartOfMeasureSessionTime- if true then the statistic is part of the measured session time- Returns:
- a new statistic id
- Since:
- Measuring Agent V4.5.17 and Portal Server V4.8.66
- See Also:
STATISTIC_TYPE_SAMPLE_EVENT_TIME_CHART
-
declareSampleEventTimeChartStatistic
public void declareSampleEventTimeChartStatistic(long statisticId, java.lang.String statisticTitle, java.lang.String yAxisTitle, java.lang.String unitText)All Purpose Interface: Declare a new 'sample event time chart' statistic.- Parameters:
statisticId- the unique ID of the statisticstatisticTitle- the title shown in the UIyAxisTitle- the Y-axis title of the diagram shown in the UI, or an empty string = not shown in the UIunitText- the text for the measured unit shown in the UI, or an empty string = not shown in the UI- See Also:
STATISTIC_TYPE_SAMPLE_EVENT_TIME_CHART
-
declareSampleEventTimeChartStatistic
public void declareSampleEventTimeChartStatistic(long statisticId, java.lang.String statisticTitle, java.lang.String yAxisTitle, java.lang.String unitText, boolean isPartOfMeasureSessionTime)All Purpose Interface: Declare a new 'sample event time chart' statistic.- Parameters:
statisticId- the unique ID of the statisticstatisticTitle- the title shown in the UIyAxisTitle- the Y-axis title of the diagram shown in the UI, or an empty string = not shown in the UIunitText- the text for the measured unit shown in the UI, or an empty string = not shown in the UIisPartOfMeasureSessionTime- if true then the statistic is part of the measured session time- Since:
- Measuring Agent V4.5.17 and Portal Server V4.8.66
- See Also:
STATISTIC_TYPE_SAMPLE_EVENT_TIME_CHART
-
declareSampleEventTimeChartStatistic
public void declareSampleEventTimeChartStatistic(long statisticId, java.lang.String statisticTitle, java.lang.String yAxisTitle, java.lang.String unitText, boolean addToSummaryStatistic, java.lang.String backgroundColor)All Purpose Interface: Declare a new 'sample event time chart' statistic.- Parameters:
statisticId- the unique ID of the statisticstatisticTitle- the title shown in the UIyAxisTitle- the Y-axis title of the diagram shown in the UI, or an empty string = not shown in the UIunitText- the text for the measured unit shown in the UI, or an empty string = not shown in the UIaddToSummaryStatistic- if true = add the number of passed/failed/pending samples to the summary statisticbackgroundColor- the background color either as #hex-triplet or as bootstrap class, or an empty string = no special background color- See Also:
STATISTIC_TYPE_SAMPLE_EVENT_TIME_CHART
-
declareSampleEventTimeChartStatistic
public void declareSampleEventTimeChartStatistic(long statisticId, java.lang.String statisticTitle, java.lang.String yAxisTitle, java.lang.String unitText, boolean addToSummaryStatistic, java.lang.String backgroundColor, boolean isPartOfMeasureSessionTime)All Purpose Interface: Declare a new 'sample event time chart' statistic.- Parameters:
statisticId- the unique ID of the statisticstatisticTitle- the title shown in the UIyAxisTitle- the Y-axis title of the diagram shown in the UI, or an empty string = not shown in the UIunitText- the text for the measured unit shown in the UI, or an empty string = not shown in the UIaddToSummaryStatistic- if true = add the number of passed/failed/pending samples to the summary statisticbackgroundColor- the background color either as #hex-triplet or as bootstrap class, or an empty string = no special background colorisPartOfMeasureSessionTime- if true then the statistic is part of the measured session time- Since:
- Measuring Agent V4.5.17 and Portal Server V4.8.66
- See Also:
STATISTIC_TYPE_SAMPLE_EVENT_TIME_CHART
-
declareCumulativeCounterLongStatistic
public long declareCumulativeCounterLongStatistic(java.lang.String statisticTitle, java.lang.String unitText)All Purpose Interface: Declare a new 'cumulative counter long' statistic.- Parameters:
statisticTitle- the title shown in the UIunitText- the text for the measured unit shown in the UI, or an empty string = not shown in the UI- Returns:
- an new statistic id
- See Also:
STATISTIC_TYPE_CUMULATIVE_COUNTER_LONG
-
declareCumulativeCounterLongStatistic
public void declareCumulativeCounterLongStatistic(long statisticId, java.lang.String statisticTitle, java.lang.String unitText)All Purpose Interface: Declare a new 'cumulative counter long' statistic.- Parameters:
statisticId- the unique ID of the statisticstatisticTitle- the title shown in the UIunitText- the text for the measured unit shown in the UI, or an empty string = not shown in the UI- See Also:
STATISTIC_TYPE_CUMULATIVE_COUNTER_LONG
-
declareThroughputTimeChartStatistic
public long declareThroughputTimeChartStatistic(java.lang.String statisticTitle, java.lang.String yAxisTitle, java.lang.String unitText)All Purpose Interface: Declare a new 'throughput time chart' statistic.- Parameters:
statisticTitle- the title shown in the UIyAxisTitle- the Y-axis title of the diagram shown in the UI, or an empty string = not shown in the UIunitText- the text for the measured unit shown in the UI, or an empty string = not shown in the UI- Returns:
- an new statistic id
- See Also:
STATISTIC_TYPE_THROUGHPUT_TIME_CHART
-
declareThroughputTimeChartStatistic
public void declareThroughputTimeChartStatistic(long statisticId, java.lang.String statisticTitle, java.lang.String yAxisTitle, java.lang.String unitText)All Purpose Interface: Declare a new 'throughput time chart' statistic.- Parameters:
statisticId- the unique ID of the statisticstatisticTitle- the title shown in the UIyAxisTitle- the Y-axis title of the diagram shown in the UI, or an empty string = not shown in the UIunitText- the text for the measured unit shown in the UI, or an empty string = not shown in the UI- See Also:
STATISTIC_TYPE_THROUGHPUT_TIME_CHART
-
declareAverageAndCurrentValueStatistic
public long declareAverageAndCurrentValueStatistic(java.lang.String statisticTitle, java.lang.String unitText)All Purpose Interface: Declare a new 'average and current value' statistic.- Parameters:
statisticTitle- the title shown in the UIunitText- the text for the measured unit shown in the UI, or an empty string = not shown in the UI- Returns:
- an new statistic id
- See Also:
STATISTIC_TYPE_AVERAGE_AND_CURRENT_VALUE
-
declareAverageAndCurrentValueStatistic
public void declareAverageAndCurrentValueStatistic(long statisticId, java.lang.String statisticTitle, java.lang.String unitText)All Purpose Interface: Declare a new 'average and current value' statistic.- Parameters:
statisticId- the unique ID of the statisticstatisticTitle- the title shown in the UIunitText- the text for the measured unit shown in the UI, or an empty string = not shown in the UI- See Also:
STATISTIC_TYPE_AVERAGE_AND_CURRENT_VALUE
-
declareEfficiencyRatioPercentStatistic
public long declareEfficiencyRatioPercentStatistic(java.lang.String statisticTitle, java.lang.String unitText)All Purpose Interface: Declare a new 'efficiency ratio percent' statistic.- Parameters:
statisticTitle- the title shown in the UIunitText- the text for the measured unit shown in the UI, or an empty string = not shown in the UI- Returns:
- an new statistic id
- See Also:
STATISTIC_TYPE_EFFICIENCY_RATIO_PERCENT
-
declareEfficiencyRatioPercentStatistic
public void declareEfficiencyRatioPercentStatistic(long statisticId, java.lang.String statisticTitle, java.lang.String unitText)All Purpose Interface: Declare a new 'efficiency ratio percent' statistic.- Parameters:
statisticId- the unique ID of the statisticstatisticTitle- the title shown in the UIunitText- the text for the measured unit shown in the UI, or an empty string = not shown in the UI- See Also:
STATISTIC_TYPE_EFFICIENCY_RATIO_PERCENT
-
declareStatistic
public void declareStatistic(long statisticId, java.lang.String statisticType, java.lang.String statisticTitle, java.lang.String statisticSubtitle, java.lang.String yAxisTitle, java.lang.String unitText, int sortPosition, boolean addToSummaryStatistic, java.lang.String backgroundColor)All Purpose Interface: Declare a new statistic (field isPartOfMeasureSessionTime = false).- Parameters:
statisticId- the unique ID of the statisticstatisticType- the type of the statisticstatisticTitle- the title shown in the UIstatisticSubtitle- the subtitle shown in the UI, or an empty string = not shown in the UIyAxisTitle- the Y-axis title of the diagram shown in the UI, or an empty string = not shown in the UIunitText- the text for the measured unit shown in the UI, or an empty string = not shown in the UIsortPosition- the UI sort position (sorting order: from small to large positions)addToSummaryStatistic- if true = add the number of passed/failed/pending samples to the summary statisticbackgroundColor- the background color either as #hex-triplet or as bootstrap class, or an empty string = no special background color- See Also:
STATISTIC_TYPE_SAMPLE_EVENT_TIME_CHART,STATISTIC_TYPE_THROUGHPUT_TIME_CHART,STATISTIC_TYPE_CUMULATIVE_COUNTER_LONG,STATISTIC_TYPE_EFFICIENCY_RATIO_PERCENT,STATISTIC_TYPE_AVERAGE_AND_CURRENT_VALUE
-
declareStatistic
public void declareStatistic(long statisticId, java.lang.String statisticType, java.lang.String statisticTitle, java.lang.String statisticSubtitle, java.lang.String yAxisTitle, java.lang.String unitText, int sortPosition, boolean addToSummaryStatistic, java.lang.String backgroundColor, boolean isPartOfMeasureSessionTime)All Purpose Interface: Declare a new statistic.- Parameters:
statisticId- the unique ID of the statisticstatisticType- the type of the statisticstatisticTitle- the title shown in the UIstatisticSubtitle- the subtitle shown in the UI, or an empty string = not shown in the UIyAxisTitle- the Y-axis title of the diagram shown in the UI, or an empty string = not shown in the UIunitText- the text for the measured unit shown in the UI, or an empty string = not shown in the UIsortPosition- the UI sort position (sorting order: from small to large positions)addToSummaryStatistic- if true = add the number of passed/failed/pending samples to the summary statisticbackgroundColor- the background color either as #hex-triplet or as bootstrap class, or an empty string = no special background colorisPartOfMeasureSessionTime- if true then the statistic is part of the measured session time- Since:
- Measuring Agent V4.5.17 and Portal Server V4.8.66
- See Also:
STATISTIC_TYPE_SAMPLE_EVENT_TIME_CHART,STATISTIC_TYPE_THROUGHPUT_TIME_CHART,STATISTIC_TYPE_CUMULATIVE_COUNTER_LONG,STATISTIC_TYPE_EFFICIENCY_RATIO_PERCENT,STATISTIC_TYPE_AVERAGE_AND_CURRENT_VALUE
-
registerSampleStart
public void registerSampleStart(long statisticId)
All Purpose Interface: Register that the measuring of a long value sample has started- Parameters:
statisticId- the unique ID of the statistic- See Also:
addSampleValue(long, long),addSampleError(long, String, String, String, String, String),STATISTIC_TYPE_SAMPLE_EVENT_TIME_CHART
-
addSampleValue
public void addSampleValue(long statisticId, long value)All Purpose Interface: Add a measured long value to a statistic.- Parameters:
statisticId- the unique ID of the statisticvalue- the measured long value- See Also:
registerSampleStart(long),STATISTIC_TYPE_SAMPLE_EVENT_TIME_CHART
-
addSampleError
public void addSampleError(long statisticId, java.lang.String errorSubject, java.lang.String errorSeverity, java.lang.String errorType, java.lang.String errorLog, java.lang.String errorContext)All Purpose Interface: Add an error to a declared statistic (for sample-event-time-chart statistics only, when measuring of a data sample did fail).- Parameters:
statisticId- the unique ID of the statisticerrorSubject- the subject of the error. Note that multiple errors which contains the same subject can be grouped.errorSeverity- the error severity: 'warning' or 'error' or 'fatal'errorType- the (optional) type of the error which reflects why the error did occur. Note that multiple errors which contains the same error type can be grouped.errorLog- the (optional) error logerrorContext- the (optional) error context that describes the circumstances under which the error occurred. It's recommended to pass a JSON object as string.- See Also:
ERROR_SEVERITY_WARNING,ERROR_SEVERITY_ERROR,ERROR_SEVERITY_FATAL,registerSampleStart(long),STATISTIC_TYPE_SAMPLE_EVENT_TIME_CHART
-
addCounterLong
public void addCounterLong(long statisticId, long value)All Purpose Interface: Increment the counter of a declared 'cumulative-counter-long' statistic.- Parameters:
statisticId- the unique ID of the statisticvalue- the value by which the counter is incremented- See Also:
STATISTIC_TYPE_CUMULATIVE_COUNTER_LONG
-
addThroughputDelta
public void addThroughputDelta(long statisticId, double deltaValue)All Purpose Interface: Add a measured delta value to a throughput statistic.- Parameters:
statisticId- the unique ID of the statisticdeltaValue- the measured delta value- See Also:
STATISTIC_TYPE_THROUGHPUT_TIME_CHART
-
addEfficiencyRatioDelta
public void addEfficiencyRatioDelta(long statisticId, long efficiencyDeltaValue, long inefficiencyDeltaValue)All Purpose Interface: Add efficiency ratio delta values to a 'efficiency-ratio-percent' statistic.- Parameters:
statisticId- the unique ID of the statisticefficiencyDeltaValue- the efficiency delta value to addinefficiencyDeltaValue- the inefficiency delta value to add- See Also:
STATISTIC_TYPE_EFFICIENCY_RATIO_PERCENT
-
addAverageDeltaAndCurrentValue
public void addAverageDeltaAndCurrentValue(long statisticId, long currentValue)All Purpose Interface: Add one delta value to the average and set the current value for a 'average-and-current-value' statistic.- Parameters:
statisticId- the unique ID of the statisticcurrentValue- the current value, or -1 if no such data is available- See Also:
STATISTIC_TYPE_AVERAGE_AND_CURRENT_VALUE
-
addAverageDeltaAndCurrentValue
public void addAverageDeltaAndCurrentValue(long statisticId, long sumValuesDelta, long numValuesDelta, long currentValue)All Purpose Interface: Add delta values to the average and set the current value for a 'average-and-current-value' statistic.- Parameters:
statisticId- the unique ID of the statisticsumValuesDelta- the sum of delta values to add to the averagenumValuesDelta- the number of delta values to add to the averagecurrentValue- the current value, or -1 if no such data is available- See Also:
STATISTIC_TYPE_AVERAGE_AND_CURRENT_VALUE
-
addAverageDeltaAndCurrentValue
public void addAverageDeltaAndCurrentValue(long statisticId, long sumValuesDelta, long numValuesDelta, long currentValue, long currentValueTimestamp)All Purpose Interface: Add delta values to the average and set the current value for a 'average-and-current-value' statistic.- Parameters:
statisticId- the unique ID of the statisticsumValuesDelta- the sum of delta values to add to the averagenumValuesDelta- the number of delta values to add to the averagecurrentValue- the current value, or -1 if no such data is availablecurrentValueTimestamp- the Unix-like timestamp of the current value, or -1 if no such data is available- See Also:
STATISTIC_TYPE_AVERAGE_AND_CURRENT_VALUE
-
addError
public void addError(long statisticId, java.lang.String errorSubject, java.lang.String errorSeverity, java.lang.String errorType, java.lang.String errorLog, java.lang.String errorContext)All Purpose Interface: Add an error to the test result. Note: do not call this method for sample-event-time-chart statistics, call instead in such a case addSampleError.- Parameters:
statisticId- the unique ID of the statistic, or -1 if this error is not bound to any statisticerrorSubject- the subject of the error. Note that multiple errors which contains the same subject can be grouped.errorSeverity- the error severity: 'warning' or 'error' or 'fatal'errorType- the (optional) type of the error which reflects why the error did occur. Note that multiple errors which contains the same error type can be grouped.errorLog- the (optional) error logerrorContext- the (optional) error context that describes the circumstances under which the error occurred. It's recommended to pass a JSON object as string.- See Also:
ERROR_SEVERITY_WARNING,ERROR_SEVERITY_ERROR,ERROR_SEVERITY_FATAL,addSampleError(long, String, String, String, String, String)
-
addTestResultAnnotationExecEvent
public void addTestResultAnnotationExecEvent(int negativeEventId, java.lang.String eventText) throws JavaScriptRhinoTestExceptionAll Purpose Interface: Add an annotation event to the test result.- Parameters:
negativeEventId- the (negative) event id, valid range: -1 .. -999999eventText- the event text- Throws:
JavaScriptRhinoTestException- if the (negative) event id is out of range
-
writeAndClearConsoleLog
public void writeAndClearConsoleLog()
Write the JavaScript console log of this simulated user to the JavaScriptRhinoTestJobExecutor main log, and clear the JavaScript console log.- See Also:
JavaScriptRhinoTestJobExecutor
-
-