silk.performer
Class SilkPerformer


java.lang.Object

  extended bysilk.performer.SilkPerformer


public final class SilkPerformer
extends java.lang.Object

SilkPerformer is the general class for communication with the controller of a load test that allows to integrate a Java class into the SilkPerformer run-time environment. A SilkPerformer object encapsulates methods and information dedicated to one virtual user implemented as a Java class. Every method that starts with an upper case letter has a complement in BDL, the benchmark description language of Segue's SilkPerformer.

Function overview:

Author:
Gerald Ehmayer
See Also:
FileEx

Field Summary
static int ALL_USERS
          Operation is performed for all users.
static java.lang.String DATE_DEFAULT
          Default date format key.
static java.lang.String DATE_ODBC
          Date format key commonly needed together with ODBC.
static java.lang.String DATE_YYYY_MM_DD
          Date format key for YYYY-MM-DD representation.
static int DIRECTORY_DATA
          Constant to retrieve directory information with GetDirectory.
static int DIRECTORY_HOME
          Constant to retrieve directory information with GetDirectory.
static int DIRECTORY_INCLUDE
          Constant to retrieve directory information with GetDirectory.
static int DIRECTORY_PROJECT
          Constant to retrieve directory information with GetDirectory.
static int DIRECTORY_RESULT
          Constant to retrieve directory information with GetDirectory.
static int DIRECTORY_SOURCE
          Constant to retrieve directory information with GetDirectory.
static int GLOBAL_CANCELED
          User was canceled while waiting for others.
static int GLOBAL_ERROR
          Invalid state of checkpoint.
static int GLOBAL_PASSED
          All users have reached the checkpoint the user was waiting for, it continues execution.
static int GLOBAL_SYNCHRONIZED
          All users have reached the checkpoint the user was waiting for, it was the last one entering the checkpoint and continues execution.
static int GLOBAL_TIMEOUT
          User was tired to wait for others, it continues execution.
static int INFINITE
          Infinite timeout.
static java.lang.String LIB_NAME
          Library name that implements the SilkPerformer native methods.
static java.lang.Object LOCK
          Synchronization object for threads.
static int MEASURE_COUNTER
          Indicates counter measures related settings.
static int MEASURE_COUNTER_CUSTOMCOUNTER
          Indicates a custom counter.
static int MEASURE_KIND_AVERAGE
          Creates an average counter.
static int MEASURE_KIND_SUM
          Creates a sum counter.
static int MEASURE_TIMER
          Indicates timer measures related settings.
static int MEASURE_TIMER_RESPONSETIME
          Indicates a responsetime measure.
static java.lang.String[] MEASURE_USAGE
           
static int MEASURE_USAGE_AVG_COUNTER
          Usage parameter for Measure functions: the Average is displayed as default datasource in perfexp.
static int MEASURE_USAGE_AVGONLY_COUNTER
          Usage parameter for Measure functions: the Average is displayed as default datasource in perfexp.
static int MEASURE_USAGE_EVENT_COUNTER
          Usage parameter for Measure functions: the Count is displayed as default datasource in perfexp.
static int MEASURE_USAGE_SUM_COUNTER
          Usage parameter for Measure functions: the Sum is displayed as default datasource in perfexp (= default).
static int MEASURE_USAGE_SUMONLY_COUNTER
          Usage parameter for Measure functions: the Sum is displayed as default datasource in perfexp.
static int OPT_DISPLAY_ALL
          Indicates the message concerns all display levels.
static int OPT_DISPLAY_DATA
          Indicates data should be printed to the monitor display.
static int OPT_DISPLAY_ERRORS
          Indicates an error message should be printed to the monitor display.
static int OPT_DISPLAY_FUNCTIONS
          Indicates a function specific information should be printed to the monitor display.
static int OPT_DISPLAY_INFO
          Indicates an informational message should be printed to the monitor display.
static int OPT_DISPLAY_NONE
          Indicates a message should not be printed to the monitor display of the controller.
static int OPT_DISPLAY_TIMERS
          Indicates a timer specific information should be printed to the monitor display.
static int OPT_DISPLAY_TRANSACTIONS
          Indicates a transaction specific information should be printed to the monitor display.
static int OPT_THINKTIME_RANDOMWAIT
          Indicates to calculate and use random think times, otherwise the absolute values are used for thinking.
static int OPT_THINKTIME_STRESSTEST
          Indicates to ignore think times.
static int OPT_WRITEDATA_HEX
          A mixed notation (ascii and hex) is used for printing data.
static int OPT_WRITEDATA_HEXONLY
          The data is printed in hexadecimal notation.
static int OPT_WRITEDATA_PRINTABLE
          If the string buffer contains only printable characters, the ASCII representation of the data is printed, otherwise a mixed notation is used.
static int RESULT_FILE_ALL
          Constant that specifies that all resultfiles should be flushed with FlushResultFile.
static int RESULT_FILE_ERR
          Constant that specifies that the .err file should be flushed with FlushResultFile.
static int RESULT_FILE_LOG
          Constant that specifies that the .log file should be flushed with FlushResultFile.
static int RESULT_FILE_RPT
          Constant that specifies that the .rpt file should be flushed with FlushResultFile.
static int RESULT_FILE_TSD
          Constant that specifies that the .tsd file should be flushed with FlushResultFile.
static int RESULT_FILE_WRT
          Constant that specifies that the .wrt file should be flushed with FlushResultFile.
static int RESULT_FILE_XLG
          Constant that specifies that the .xlg file should be flushed with FlushResultFile.
static int SEVERITY_ERROR
          Indicates an error but the user is able to continue.
static int SEVERITY_INFORMATIONAL
          Indicates a state that requires an informational message.
static int SEVERITY_PROCESS_EXIT
          Indicates an error and the current user has to be terminated.
static int SEVERITY_SUCCESS
          Indicates that no errors were found.
static int SEVERITY_TRANS_EXIT
          Indicates an error and the current transaction has to be terminated.
static int SEVERITY_WARNING
          Indicates a state that requires a warning.
static int TEXT_BLACK
           
static int TEXT_BLUE
           
static int TEXT_GRAY
           
static int TEXT_GREEN
           
static int TEXT_MAGENTA
           
static int TEXT_RED
           
static java.lang.String TIMESTAMP_DEFAULT
          Default date/time format key for YYYY-MM-DD HH:MM:SS representation.
static int TIMESTAMP_GMT
          Constant to retrieve timestamp with GetTimeStamp as GMT time.
static int TIMESTAMP_IN_MS
          Constant to retrieve timestamp with GetTimeStamp in milliseconds.
static int TIMESTAMP_IN_SEC
          Constant to retrieve timestamp with GetTimeStamp in seconds.
static int TIMESTAMP_LOCAL
          Constant to retrieve timestamp with GetTimeStamp as local time.
static java.lang.String TIMESTAMP_ODBC
          Default date/time format key commonly needed together with ODBC.
 
Constructor Summary
SilkPerformer()
          Class default constructor.
SilkPerformer(int magic)
           
SilkPerformer(int magic, int context)
          Class constructor specifying a magic number.
 
Method Summary
 void AttachThread()
          Attaches the SilkPerformer runtime to a newly created Java thread.
 void AttributeDelete(java.lang.String attribute)
          Removes an attribute from the global value pool by name.
 byte[] AttributeGetBinary(java.lang.String attribute)
          Retrieves a binary attribute from the global value pool by name.
 boolean AttributeGetBoolean(java.lang.String attribute)
          Retrieves an boolean attribute from the global value pool by name.
 double AttributeGetDouble(java.lang.String attribute)
          Retrieves a double attribute from the global value pool by name.
 int AttributeGetInt(java.lang.String attribute)
          Retrieves an integer attribute from the global value pool by name.
 java.lang.String AttributeGetString(java.lang.String attribute)
          Retrieves a string attribute from the global value pool by name.
 boolean AttributeSetBinary(java.lang.String attribute, byte[] value)
          Sets a binary attribute value.
 boolean AttributeSetBinary(java.lang.String attribute, byte[] value, int len)
          Sets a number of bytes as binary attribute value.
 boolean AttributeSetBoolean(java.lang.String attribute, boolean value)
          Registers a named boolean attribute in the global value pool.
 boolean AttributeSetDouble(java.lang.String attribute, double value)
          Registers a named double attribute in the global value pool.
 boolean AttributeSetInt(java.lang.String attribute, int value)
          Registers a named integer attribute in the global value pool.
 boolean AttributeSetString(java.lang.String attribute, java.lang.String value)
          Registers a named string attribute in the global value pool.
 int CreateErrorCode(int nFacility, int nErrorCode, int nSeverity)
          Internally used for Oracle Forms replay.
 Error ErrorCreate(java.lang.String sFuncName)
          Internally used for Oracle Forms replay.
 Error ErrorCreate(java.lang.String sFuncName, int nApiCallId)
          Internally used for Oracle Forms replay.
 int ErrorLogBegin(java.lang.String sFuncName, int nApiCallId)
          Internally used for Oracle Forms replay.
 void ErrorLogEnd(int hErr)
          Internally used for Oracle Forms replay.
 int ErrorLogGetMaxSeverity(int hErr)
          Internally used for Oracle Forms replay.
 void ErrorLogRaise(int hErr, int iError, java.lang.String sMsg, int nSeverity)
          Internally used for Oracle Forms replay.
 FileEx FileCSVLoad(java.lang.String fileName, java.lang.String separator)
          Reads a file in CSV format (character separated format) into the memory.
 FileEx FileCSVLoad(java.lang.String fileName, java.lang.String separator, java.lang.String delimiter)
          Reads a file in CSV format (character separated format) into the memory.
 FileEx FileCSVLoadGlobal(java.lang.String fileName, java.lang.String separator)
          Reads a file with a global row pointer in CSV format (character separated format) into the memory.
 FileEx FileCSVLoadGlobal(java.lang.String fileName, java.lang.String separator, java.lang.String delimiter)
          Reads a file with a global row pointer in CSV format (character separated format) into the memory.
 FileEx FileFixedLoad(java.lang.String fileName, java.lang.String format)
          Reads a file with fix formatted rows into the memory.
 FileEx FileFixedLoadGlobal(java.lang.String fileName, java.lang.String format)
          Reads a file with a global row pointer and fix formatted rows into the memory.
 boolean FlushResultFile(int flag)
          Flushes the buffer of the specified result file.
 java.lang.String FormatDate(int date, java.lang.String format)
          Formats a date.
 java.lang.String FormatDateTime(int date, int time, java.lang.String format)
          Formats date and time.
 java.lang.String GetAgent()
          Retrieves the name of the agent machine of a user.
 int GetAgentId()
          Retrieves a unique id for the agent of a user.
 int getClock()
          Calculates the native Windows processor time used by the calling process.
 java.lang.String GetController()
          Retrieves the name of the controller machine of a user.
 java.lang.String GetDataFilePath(java.lang.String sFilename)
          The method returns the absolute path to a file in the data files section during the loadtest.
 java.lang.String GetDirectory(int setting)
          Retrieves the directory where specified types of SilkPerformer files are located.
 java.lang.String GetErrorMsg(int errNo)
          Retrieves the description of an error.
 java.lang.String GetFunctionName()
          Returns the name of the currently executing BDL function.
 java.lang.String GetIpAddress()
          Used for Ip spoofing.
 int GetLastError()
          Retrieves the code of the last error that was detected.
 java.lang.String GetLastErrorMsg()
          Retrieves the description of the last error that was detected.
 int GetLoadtest()
          Retrieves the number of the load test generated for the current simulation.
 java.lang.String GetProfile()
          Retrieves the name of the settings profile that the current virtual user uses.
 java.lang.String GetProject()
          Retrieves the name of the project specified in the current workload definition file (.wdf file).
 java.lang.String GetProjectfileName()
          Returns the absolute path the to projectfile in use.
 int GetRuntimes()
          Retrieves the number of users started on the current agent.
 double GetThinkTimeLimit()
          Gets the value of the setting which specifies whether think times should be limited to a certain maximum value.
 long getTickCount()
          Retrieves the number of milliseconds that have elapsed since Windows was started.
 java.lang.String GetTimeStamp(int flag)
          Returns the number of seconds or milliseconds elapsed since midnight (00:00:00), January 1, 1970 likewise as GMT or local time.
 java.lang.String GetTransactionName()
          Returns the name of the currently executing transaction.
 java.lang.String GetUser()
          Retrieves the user name.
 java.lang.String GetUsergroup()
          Retrieves the name of the user group to which the current virtual user belongs.
 int GetUserId()
          Retrieves a unique ID (number) per virtual user within a loadtest.
 int GetUserIdOnAgent()
          Retrieves a unique ID (number) per virtual user on an agent (machine).
 java.lang.String GetWorkload()
          Retrieves the name of the active workload which the current virtual user executes.
 int GlobalResourceEnter(java.lang.String name)
          Defines a resource that can be occupied only by one user.
 int GlobalResourceEnter(java.lang.String name, int count)
          Defines a resource that can be occupied only by a limited number of users.
 int GlobalResourceEnter(java.lang.String name, int count, int timeout)
          Defines a resource that can be occupied only by a limited number of users.
 void GlobalResourceRelease(java.lang.String name)
          Releases a limited usable resource.
 int GlobalVarGet(java.lang.String name, int timeout)
          Retrieves a global integer value accessible for all agents.
 int GlobalVarInc(java.lang.String name, int incVal, int timeout)
          Increments a global integer value accessible for all agents.
 void GlobalVarSet(java.lang.String name, int value, int timeout)
          Sets a global integer value accessible for all agents.
 int GlobalWaitFor(java.lang.String name)
          Defines a checkpoint and blocks the calling user.
 int GlobalWaitFor(java.lang.String name, int count)
          Defines a checkpoint and blocks the calling user.
 int GlobalWaitFor(java.lang.String name, int count, int timeout)
          Defines a checkpoint (= rendezvous) and blocks the calling user.
 void Halt()
          Terminates the current user.
 void Halt(java.lang.String msg)
          Displayes a message and terminates the current user.
 int IncDate(int date, int days)
          Increments a date value.
static void main(java.lang.String[] args)
          Installation check.
 int MeasureInc(java.lang.String name)
          Increments the value of a custom counter by 1.
 int MeasureInc(java.lang.String name, int value)
          Increments the value of a custom counter.
 int MeasureInc(java.lang.String name, int value, int kind)
          Increments the value of a custom counter and aggregates it individually.
 double MeasureIncFloat(java.lang.String name, double value, java.lang.String unit, int usage, int idx)
          Increments custom counter by a float value.
 int MeasurePause(java.lang.String name)
          Pauses a custom time measure with a specified measure name.
 int MeasureResume(java.lang.String name)
          Resumes a prviously paused custom time measure.
 boolean MeasureSetBound(java.lang.String name, int type, int bound, double value)
          Determines the bound value for a specified timer or counter.
 boolean MeasureSetBound(java.lang.String name, int type, int bound, double value, int severity)
          Determines the bound value for a specified timer or counter.
 int MeasureSetTimer(java.lang.String name, int value)
          Sets a value for a custom time measure with a specified measure name.
 boolean MeasureStart(java.lang.String name)
          Starts a custom time measure with a specified measure name.
 boolean MeasureStart(java.lang.String name, int idx)
          Starts a custom time measure with a specified measure name.
 int MeasureStop(java.lang.String name)
          Stops a custom time measure with a specified measure name.
 boolean MeasureTimeseries(int type, boolean yesNo)
          Determines whether to generate measure data or not.
 void Print(java.lang.String msg)
          Prints a message to the run-time monitor window of a user.
 void Print(java.lang.String msg, int option)
          Prints a message to the run-time monitor window in an individual context.
 void Print(java.lang.String msg, int option, int color)
          Prints a message to the run-time monitor window in an individual context and color.
 void RaiseError(int errorCode, java.lang.String sMessage)
          Internally used for Oracle Forms replay.
 void RaiseError(int errorCode, java.lang.String sMessage, int nCustomSeverity)
          Internally used for Oracle Forms replay.
 void RaiseError(int errorCode, java.lang.String sMessage, int nCustomSeverity, int iApiCallId)
          Internally used for Oracle Forms replay.
 void RepMessage(java.lang.String msg, int severity)
          Writes a message to the repository (if enabled) and to the .err file of a user.
 int RndDate(int date, int days)
          Adds a random number of days to a date.
 java.lang.String RndFormatDate(int date, int days, java.lang.String format)
          Adds a random number of days to a date and formats the resulted date.
 int RndUniN(int i, int j)
          Calculates a uniformly distributed random number between a specific boundary.
 void setMultiMode(boolean yesNo)
           
 void SetThinkTimeLimit(boolean enable, double fLimit)
          Specifies whether think times should be limited to a certain maximum value.
 double ThinkTime(double timeSec)
          Blocks execution of the user for some time.
 double ThinkTime(double timeSec, int option)
          Blocks execution of the user for some time.
 void Wait(double seconds)
           
 void Write(java.lang.String txt)
          Writes to the .out file of the current user.
 void WriteData(byte[] data)
          Writes binary data to the .out file of the current user.
 void WriteData(byte[] data, int len)
          Writes binary data to the .out file of the current user.
 void WriteData(byte[] data, int len, int option)
          Writes binary data to the .out file of the current user.
 void WriteErr(java.lang.String txt)
          Writes to the .err file of the current user.
 void Writeln()
          Writes a new line to the .out file of the current user.
 void Writeln(java.lang.String txt)
          Writes to the .out file of the current user appending a new line.
 void WriteLog(java.lang.String txt)
          Writes to the .log file of the current user.
 void WriteLog(java.lang.Throwable ex)
          Writes an exception stack trace to the .log file of the current user.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MEASURE_USAGE_SUM_COUNTER


public static final int MEASURE_USAGE_SUM_COUNTER
Usage parameter for Measure functions: the Sum is displayed as default datasource in perfexp (= default).

See Also:
Constant Field Values

MEASURE_USAGE_AVG_COUNTER


public static final int MEASURE_USAGE_AVG_COUNTER
Usage parameter for Measure functions: the Average is displayed as default datasource in perfexp.

See Also:
Constant Field Values

MEASURE_USAGE_SUMONLY_COUNTER


public static final int MEASURE_USAGE_SUMONLY_COUNTER
Usage parameter for Measure functions: the Sum is displayed as default datasource in perfexp. You cannot choose an other datasource.

See Also:
Constant Field Values

MEASURE_USAGE_EVENT_COUNTER


public static final int MEASURE_USAGE_EVENT_COUNTER
Usage parameter for Measure functions: the Count is displayed as default datasource in perfexp.

See Also:
Constant Field Values

MEASURE_USAGE_AVGONLY_COUNTER


public static final int MEASURE_USAGE_AVGONLY_COUNTER
Usage parameter for Measure functions: the Average is displayed as default datasource in perfexp. You cannot choose another datasource.

See Also:
Constant Field Values

MEASURE_USAGE


public static final java.lang.String[] MEASURE_USAGE

OPT_DISPLAY_NONE


public static final int OPT_DISPLAY_NONE
Indicates a message should not be printed to the monitor display of the controller.

See Also:
Constant Field Values

OPT_DISPLAY_ERRORS


public static final int OPT_DISPLAY_ERRORS
Indicates an error message should be printed to the monitor display.

See Also:
Constant Field Values

OPT_DISPLAY_TRANSACTIONS


public static final int OPT_DISPLAY_TRANSACTIONS
Indicates a transaction specific information should be printed to the monitor display.

See Also:
Constant Field Values

OPT_DISPLAY_TIMERS


public static final int OPT_DISPLAY_TIMERS
Indicates a timer specific information should be printed to the monitor display.

See Also:
Constant Field Values

OPT_DISPLAY_FUNCTIONS


public static final int OPT_DISPLAY_FUNCTIONS
Indicates a function specific information should be printed to the monitor display.

See Also:
Constant Field Values

OPT_DISPLAY_INFO


public static final int OPT_DISPLAY_INFO
Indicates an informational message should be printed to the monitor display.

See Also:
Constant Field Values

OPT_DISPLAY_DATA


public static final int OPT_DISPLAY_DATA
Indicates data should be printed to the monitor display.

See Also:
Constant Field Values

OPT_DISPLAY_ALL


public static final int OPT_DISPLAY_ALL
Indicates the message concerns all display levels.

See Also:
Constant Field Values

OPT_WRITEDATA_PRINTABLE


public static final int OPT_WRITEDATA_PRINTABLE
If the string buffer contains only printable characters, the ASCII representation of the data is printed, otherwise a mixed notation is used.

See Also:
Constant Field Values

OPT_WRITEDATA_HEX


public static final int OPT_WRITEDATA_HEX
A mixed notation (ascii and hex) is used for printing data.

See Also:
Constant Field Values

OPT_WRITEDATA_HEXONLY


public static final int OPT_WRITEDATA_HEXONLY
The data is printed in hexadecimal notation.

See Also:
Constant Field Values

TEXT_BLUE


public static final int TEXT_BLUE
See Also:
Constant Field Values

TEXT_RED


public static final int TEXT_RED
See Also:
Constant Field Values

TEXT_BLACK


public static final int TEXT_BLACK
See Also:
Constant Field Values

TEXT_MAGENTA


public static final int TEXT_MAGENTA
See Also:
Constant Field Values

TEXT_GREEN


public static final int TEXT_GREEN
See Also:
Constant Field Values

TEXT_GRAY


public static final int TEXT_GRAY
See Also:
Constant Field Values

SEVERITY_SUCCESS


public static final int SEVERITY_SUCCESS
Indicates that no errors were found.

See Also:
Constant Field Values

SEVERITY_INFORMATIONAL


public static final int SEVERITY_INFORMATIONAL
Indicates a state that requires an informational message.

See Also:
Constant Field Values

SEVERITY_WARNING


public static final int SEVERITY_WARNING
Indicates a state that requires a warning.

See Also:
Constant Field Values

SEVERITY_ERROR


public static final int SEVERITY_ERROR
Indicates an error but the user is able to continue.

See Also:
Constant Field Values

SEVERITY_TRANS_EXIT


public static final int SEVERITY_TRANS_EXIT
Indicates an error and the current transaction has to be terminated.

See Also:
Constant Field Values

SEVERITY_PROCESS_EXIT


public static final int SEVERITY_PROCESS_EXIT
Indicates an error and the current user has to be terminated.

See Also:
Constant Field Values

MEASURE_TIMER


public static final int MEASURE_TIMER
Indicates timer measures related settings.

See Also:
Constant Field Values

MEASURE_COUNTER


public static final int MEASURE_COUNTER
Indicates counter measures related settings.

See Also:
Constant Field Values

MEASURE_TIMER_RESPONSETIME


public static final int MEASURE_TIMER_RESPONSETIME
Indicates a responsetime measure.

See Also:
Constant Field Values

MEASURE_COUNTER_CUSTOMCOUNTER


public static final int MEASURE_COUNTER_CUSTOMCOUNTER
Indicates a custom counter.

See Also:
Constant Field Values

MEASURE_KIND_SUM


public static final int MEASURE_KIND_SUM
Creates a sum counter.

See Also:
MeasureInc(String,int,int), Constant Field Values

MEASURE_KIND_AVERAGE


public static final int MEASURE_KIND_AVERAGE
Creates an average counter.

See Also:
MeasureInc(String,int,int), Constant Field Values

OPT_THINKTIME_STRESSTEST


public static final int OPT_THINKTIME_STRESSTEST
Indicates to ignore think times.

See Also:
Constant Field Values

OPT_THINKTIME_RANDOMWAIT


public static final int OPT_THINKTIME_RANDOMWAIT
Indicates to calculate and use random think times, otherwise the absolute values are used for thinking.

See Also:
Constant Field Values

DATE_YYYY_MM_DD


public static final java.lang.String DATE_YYYY_MM_DD
Date format key for YYYY-MM-DD representation.

See Also:
Constant Field Values

DATE_DEFAULT


public static final java.lang.String DATE_DEFAULT
Default date format key.

See Also:
Constant Field Values

DATE_ODBC


public static final java.lang.String DATE_ODBC
Date format key commonly needed together with ODBC.

See Also:
Constant Field Values

TIMESTAMP_DEFAULT


public static final java.lang.String TIMESTAMP_DEFAULT
Default date/time format key for YYYY-MM-DD HH:MM:SS representation.

See Also:
Constant Field Values

TIMESTAMP_ODBC


public static final java.lang.String TIMESTAMP_ODBC
Default date/time format key commonly needed together with ODBC.

See Also:
Constant Field Values

GLOBAL_ERROR


public static final int GLOBAL_ERROR
Invalid state of checkpoint.

See Also:
Constant Field Values

GLOBAL_CANCELED


public static final int GLOBAL_CANCELED
User was canceled while waiting for others.

See Also:
Constant Field Values

GLOBAL_TIMEOUT


public static final int GLOBAL_TIMEOUT
User was tired to wait for others, it continues execution.

See Also:
Constant Field Values

GLOBAL_PASSED


public static final int GLOBAL_PASSED
All users have reached the checkpoint the user was waiting for, it continues execution.

See Also:
Constant Field Values

GLOBAL_SYNCHRONIZED


public static final int GLOBAL_SYNCHRONIZED
All users have reached the checkpoint the user was waiting for, it was the last one entering the checkpoint and continues execution.

See Also:
Constant Field Values

DIRECTORY_HOME


public static final int DIRECTORY_HOME
Constant to retrieve directory information with GetDirectory.

See Also:
Constant Field Values

DIRECTORY_RESULT


public static final int DIRECTORY_RESULT
Constant to retrieve directory information with GetDirectory.

See Also:
Constant Field Values

DIRECTORY_DATA


public static final int DIRECTORY_DATA
Constant to retrieve directory information with GetDirectory.

See Also:
Constant Field Values

DIRECTORY_INCLUDE


public static final int DIRECTORY_INCLUDE
Constant to retrieve directory information with GetDirectory.

See Also:
Constant Field Values

DIRECTORY_SOURCE


public static final int DIRECTORY_SOURCE
Constant to retrieve directory information with GetDirectory.

See Also:
Constant Field Values

DIRECTORY_PROJECT


public static final int DIRECTORY_PROJECT
Constant to retrieve directory information with GetDirectory.

See Also:
Constant Field Values

TIMESTAMP_GMT


public static final int TIMESTAMP_GMT
Constant to retrieve timestamp with GetTimeStamp as GMT time.

See Also:
Constant Field Values

TIMESTAMP_LOCAL


public static final int TIMESTAMP_LOCAL
Constant to retrieve timestamp with GetTimeStamp as local time.

See Also:
Constant Field Values

TIMESTAMP_IN_MS


public static final int TIMESTAMP_IN_MS
Constant to retrieve timestamp with GetTimeStamp in milliseconds.

See Also:
Constant Field Values

TIMESTAMP_IN_SEC


public static final int TIMESTAMP_IN_SEC
Constant to retrieve timestamp with GetTimeStamp in seconds.

See Also:
Constant Field Values

RESULT_FILE_ERR


public static final int RESULT_FILE_ERR
Constant that specifies that the .err file should be flushed with FlushResultFile.

See Also:
Constant Field Values

RESULT_FILE_LOG


public static final int RESULT_FILE_LOG
Constant that specifies that the .log file should be flushed with FlushResultFile.

See Also:
Constant Field Values

RESULT_FILE_RPT


public static final int RESULT_FILE_RPT
Constant that specifies that the .rpt file should be flushed with FlushResultFile.

See Also:
Constant Field Values

RESULT_FILE_WRT


public static final int RESULT_FILE_WRT
Constant that specifies that the .wrt file should be flushed with FlushResultFile.

See Also:
Constant Field Values

RESULT_FILE_XLG


public static final int RESULT_FILE_XLG
Constant that specifies that the .xlg file should be flushed with FlushResultFile.

See Also:
Constant Field Values

RESULT_FILE_TSD


public static final int RESULT_FILE_TSD
Constant that specifies that the .tsd file should be flushed with FlushResultFile.

See Also:
Constant Field Values

RESULT_FILE_ALL


public static final int RESULT_FILE_ALL
Constant that specifies that all resultfiles should be flushed with FlushResultFile.

See Also:
Constant Field Values

LOCK


public static final java.lang.Object LOCK
Synchronization object for threads.


LIB_NAME


public static final java.lang.String LIB_NAME
Library name that implements the SilkPerformer native methods.

See Also:
Constant Field Values

INFINITE


public static final int INFINITE
Infinite timeout.

See Also:
Constant Field Values

ALL_USERS


public static final int ALL_USERS
Operation is performed for all users.

See Also:
Constant Field Values
Constructor Detail

SilkPerformer


public SilkPerformer()
              throws java.lang.Exception
Class default constructor.


SilkPerformer


public SilkPerformer(int magic)
              throws java.lang.Exception

SilkPerformer


public SilkPerformer(int magic,
                     int context)
              throws java.lang.Exception
Class constructor specifying a magic number.

Parameters:
magic - Use -1 for testing your user implementation without SilkPerformer run-time (stand-alone).
Method Detail

AttachThread


public void AttachThread()
                  throws java.lang.Exception
Attaches the SilkPerformer runtime to a newly created Java thread. If a SilkPerformer object is used from Java threads call this attach method before invocation of SilkPerformer methods.

Throws:
java.lang.Exception

AttributeSetInt


public boolean AttributeSetInt(java.lang.String attribute,
                               int value)
                        throws SilkPerformerException
Registers a named integer attribute in the global value pool. If the attribute exists it is overridden, otherwise a new value is added.

Parameters:
attribute - Name that identifies the value.
value - The attribute value.
Returns:
true for success.
Throws:
SilkPerformerException
See Also:
AttributeGetInt(String)

AttributeSetBoolean


public boolean AttributeSetBoolean(java.lang.String attribute,
                                   boolean value)
                            throws SilkPerformerException
Registers a named boolean attribute in the global value pool. If the attribute exists it is overridden, otherwise a new value is added.

Parameters:
attribute - Name that identifies the value.
value - The attribute value.
Returns:
true for success.
Throws:
SilkPerformerException
See Also:
AttributeGetBoolean(String)

AttributeSetDouble


public boolean AttributeSetDouble(java.lang.String attribute,
                                  double value)
                           throws SilkPerformerException
Registers a named double attribute in the global value pool. If the attribute exists it is overridden, otherwise a new value is added.

Parameters:
attribute - Name that identifies the value.
value - The attribute value.
Returns:
true for success.
Throws:
SilkPerformerException
See Also:
AttributeGetDouble(String)

AttributeSetString


public boolean AttributeSetString(java.lang.String attribute,
                                  java.lang.String value)
                           throws SilkPerformerException
Registers a named string attribute in the global value pool. If the attribute exists it is overridden, otherwise a new value is added.

Parameters:
attribute - Name that identifies the value.
value - The attribute value.
Returns:
true for success.
Throws:
SilkPerformerException
See Also:
AttributeGetString(String)

AttributeSetBinary


public boolean AttributeSetBinary(java.lang.String attribute,
                                  byte[] value)
                           throws SilkPerformerException
Sets a binary attribute value.

Parameters:
attribute - Name that identifies the value.
value - Binary to set as byte array.
Returns:
true for success.
Throws:
SilkPerformerException
See Also:
AttributeSetBinary(String,byte[],int)

AttributeSetBinary


public boolean AttributeSetBinary(java.lang.String attribute,
                                  byte[] value,
                                  int len)
                           throws SilkPerformerException
Sets a number of bytes as binary attribute value.

Parameters:
attribute - Name that identifies the value.
value - Binary to set as byte array.
len - Number of bytes beginning at the first byte of value to set.
Returns:
true for success.
Throws:
SilkPerformerException
See Also:
AttributeSetBinary(String,byte[])

AttributeGetInt


public int AttributeGetInt(java.lang.String attribute)
                    throws SilkPerformerException
Retrieves an integer attribute from the global value pool by name. If the attribute does not exist an exception is thrown.

Parameters:
attribute - Name that identifies the value.
Returns:
The attribute value.
Throws:
SilkPerformerException
See Also:
AttributeSetInt(String,int)

AttributeGetBoolean


public boolean AttributeGetBoolean(java.lang.String attribute)
                            throws SilkPerformerException
Retrieves an boolean attribute from the global value pool by name. If the attribute does not exist an exception is thrown.

Parameters:
attribute - Name that identifies the value.
Returns:
The attribute value.
Throws:
SilkPerformerException
See Also:
AttributeSetBoolean(String,boolean)

AttributeGetDouble


public double AttributeGetDouble(java.lang.String attribute)
                          throws SilkPerformerException
Retrieves a double attribute from the global value pool by name. If the attribute does not exist an exception is thrown.

Parameters:
attribute - Name that identifies the value.
Returns:
The attribute value.
Throws:
SilkPerformerException
See Also:
AttributeSetDouble(String,double)

AttributeGetString


public java.lang.String AttributeGetString(java.lang.String attribute)
                                    throws SilkPerformerException
Retrieves a string attribute from the global value pool by name. If the attribute does not exist an exception is thrown.

Parameters:
attribute - Name that identifies the value.
Returns:
The attribute value.
Throws:
SilkPerformerException
See Also:
AttributeSetString(String,String)

AttributeGetBinary


public byte[] AttributeGetBinary(java.lang.String attribute)
                          throws SilkPerformerException
Retrieves a binary attribute from the global value pool by name. If the attribute does not exist an exception is thrown.

Parameters:
attribute - Name that identifies the value.
Returns:
The binary as byte array.
Throws:
SilkPerformerException
See Also:
AttributeSetBinary(String,byte[],int)

AttributeDelete


public void AttributeDelete(java.lang.String attribute)
                     throws SilkPerformerException
Removes an attribute from the global value pool by name.

Parameters:
attribute - Name that identifies the value.
Throws:
SilkPerformerException

getTickCount


public long getTickCount()
Retrieves the number of milliseconds that have elapsed since Windows was started. For more details see documentation of GetTickCount() defined in winbase.h.

Returns:
Elapsed time in milliseconds.

getClock


public int getClock()
Calculates the native Windows processor time used by the calling process. For more details see documentation of clock() defined in time.h.

Returns:
Clock value.

Wait


public void Wait(double seconds)
          throws SilkPerformerException
Throws:
SilkPerformerException

MeasureStart


public boolean MeasureStart(java.lang.String name)
                     throws SilkPerformerException
Starts a custom time measure with a specified measure name. The results of the time measurements are reported in the result files and the result database of SilkPerformer.

Parameters:
name - Timer name used to identify the measure.
Returns:
true if successful.
Throws:
SilkPerformerException
See Also:
MeasureStart(String,int)

MeasureStart


public boolean MeasureStart(java.lang.String name,
                            int idx)
                     throws SilkPerformerException
Starts a custom time measure with a specified measure name. The results of the time measurements are reported in the result files and the result database of SilkPerformer.

Parameters:
name - Timer name used to identify the measure.
idx - Index in the timer list, use it for real time monitoring with PerformanceExplorer.
Returns:
true if successful.
Throws:
SilkPerformerException
See Also:
MeasureStart(String), MeasureStop(String), MeasurePause(String), MeasureResume(String), MeasureTimeseries(int,boolean), MeasureSetBound(String,int,int,double)

MeasureStop


public int MeasureStop(java.lang.String name)
                throws SilkPerformerException
Stops a custom time measure with a specified measure name. The results of the time measurements are reported in the result files and the result database of SilkPerformer.

Parameters:
name - Timer name used to identify the measure.
Returns:
Final value of the time measure in 1/1000 seconds.
Throws:
SilkPerformerException
See Also:
MeasureStart(String), MeasurePause(String), MeasureResume(String), MeasureTimeseries(int,boolean), MeasureSetBound(String,int,int,double)

MeasureInc


public int MeasureInc(java.lang.String name,
                      int value,
                      int kind)
               throws SilkPerformerException
Increments the value of a custom counter and aggregates it individually.

Parameters:
name - Counter name used to identify the measure.
value - Increment value.
kind - Aggregate kind of measures in the time interval, see MEASURE_KIND options.
Returns: