Befor Usage Befor GUI Interface Befor Command Interface
This section presents a list of all Befor API commands and how they are used.
Within the API, this information can be obtained using
help
command.
-
auto
Command
Automates the Beftigre full-tier testing of mobile (Band) and cloud (Befor) tiers. See section 7 of Befor usage for details.
auto auto_script adb_dir reruns interleave
auto_script
:the auto script file (.auto).
adb_dir
:the full path to adb.exe (i.e. Android Debug Bridge).
reruns
:the number of reruns of the experiment.
interleave
:the interleave (in seconds) between reruns.
-
cleanup
Command
Uninstalls all setup files if no argument is supplied,
or deletes the third argument from the server based on the second argument d or f.
cleanup
cleanup -d directory
cleanup -f file
-d directory
:the directory to be deleted from the server.
-f file
:the file with extension to be deleted from the server, e.g. Sample.java.
-
clear
Command
Clears the Befor console.
clear
-
collect
Command
Begins collection of server metrics once the server monitor is launched.
collect
-
editplan
Command
Provides UI useful to edit the jMeter testplan prior to collect
command.
editplan
-
exit
Command
Exits the Befor console.
exit
-
extract
Command
Extracts the test results from logs as .dat files.
extract markerLog powerLog metricsLog
markerLog
:the absolute file name of MarkerLog_123.log, e.g. "C:\App\logs\MarkerLog_123.log"
powerLog
:the absolute file name of PowerLog_123.log, e.g. "C:\App\logs\PowerLog_123.log"
metricsLog
:the absolute file name of MetricsLog_123.log, e.g. "C:\App\logs\MetricsLog_123.log"
The .log files are generated with timestamps appended to their file names. 123 above represents the timestamp.
-
help
Command
Provides Help information for all Befor commands, or for a specific Befor command when passed as argument.
help
help command
command
:a Befor API command.
-
offload
Command
Uploads and/or starts offloadable components based on any of three options; u, s or us.
offload -u zipfile
offload -s mainclass
offload -us zipfile mainclass
-u
:signifies an upload, expecting the following argument to be a zip file.
-s
:signifies a start, expecting the following argument to be a start command.
-us
:combines the functionality of -u and -s.
zipfile
:the zip file to upload, which gets extracted at the server, e.g. "C:\App\zipfile.zip"
mainclass
:the class name used to start an offloaded component by java interpreter; this must include the name of the package too, as per standard programming convention.
Note: there could be a likely case where starting an application requires a library in the class path (used to compile), in that case, ensure that the library's jar(s) is/are uploaded in the zip alongside the classes, then run the application as follows; i.e. including class path in the start command and putting the start command in quotes:
offload -s "-cp .:path/to/lib.jar mainclass"
offload -us zipfile "-cp .:path/to/lib.jar mainclass"
-
params
Command
Sets up parameters for prior connection to the server. It is a required command, and takes 7 arguments in the specified order.
params pemfile ip port user jmeter blport cmport
pemfile
:the .pem file from EC2 server setup.
ip
:the IP address of the server.
port
:the port number for the server connection.
user
:the server registered user.
jmeter
:the absolute path of Apache JMeter home directory, e.g. "C:\App\jmeter"
blport
:the port number for BandwidthLatencyServer and Client.
cmport
:the port number for CPUMemoryServer and Client.
-
plot
Command
Plots graph using the extracted .dat files, it takes one to three logs as arguments in any order.
plot PowerLog
plot PowerLog AppLog
plot PowerLog AppLog CPULog MemLog
PowerLog
:the absolute file name of PowerLog.dat, e.g. "C:\App\results\PowerLog.dat"
AppLog
:the absolute file name of AppLog.dat, e.g. "C:\App\results\AppLog.dat"
CPULog
:the absolute file name of CPULog.dat, e.g. "C:\App\results\CPULog.dat"
MemLog
:the absolute file name of MemLog.dat, e.g. "C:\App\results\MemLog.dat"
-
setup
Command
Installs and copies all necessary files for the test unto the server.
setup
-
simulate
Command
Sets up parameters for the simulation of resource stress and network throttle.
simulate bandwidth bandwidthType latency cpuload memload timeout
bandwidth
:an integer representing the bandwidth.
bandwidthType
:the bandwidth unit type, e.g. bps, kbps or mbps.
latency
:an integer representing the latency in ms.
cpuload
:an integer representing the cpu load.
memload
:an integer representing the memory load.
timeout
:an integer representing the timeout in s for cpu and memory load.
-
start
Command
Starts the server monitors.
start
-
stop
Command
Stops the server monitors.
stop