Repository navigation
Expand file tree
/
Copy pathautoJobSubmitter.bat
More file actions
61 lines (40 loc) · 1.78 KB
/
Copy pathautoJobSubmitter.bat
File metadata and controls
61 lines (40 loc) · 1.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
@ECHO OFF
REM Need to configure SERVER and PASSWORD of the PBS server
SET SERVER="192.168.33.220"
SET PASSWORD="perf@123"
SET PATHTOPUTTY="C:/Program Files/PuTTY/"
SET /P TOTALJOBS="Enter No of Jobs : "
SET CLASSPATH=C:\grinder-3.2\lib\grinder.jar;%CLASSPATH%
SET JAVA_HOME="C:\Program Files\Java\jdk1.6.0_20"
ECHO Java dir is %JAVA_HOME%>%CURRDIR%\JobSubmit.log
PATH=%JAVA_HOME%\bin;%PATH%
SET CURRDIR=%CD%
SET INDEX=1
ECHO Started at %date% %time%>>%CURRDIR%\JobSubmit.log
:START
REM Put 2 sec sleep
PING 1.1.1.1 -n 1 -w 2000 > NUL
%PATHTOPUTTY%plink.exe root@%SERVER% -pw %PASSWORD% -m %PATHTOPUTTY%cmd>%CURRDIR%\JobCount.txt
SET /P CURRJOBS=<%CURRDIR%\JobCount.txt
IF EXIST %CURRDIR%\JobCount.txt (
DEL %CURRDIR%\JobCount.txt
)
SET TIMESTAMP=%date% %time%
IF [%CURRJOBS%] EQU [] (
ECHO Could not connect to %SERVER% at %TIMESTAMP%>>%CURRDIR%\JobSubmit.log
GOTO START
)ELSE (
IF [%CURRJOBS%] LSS [%TOTALJOBS%] (
IF [%INDEX%] GEQ [6] (
SET /A INDEX=1
)
ECHO Started Grinder at %TIMESTAMP% with %CURRJOBS% jobs on PBS using agent%INDEX%.txt users>>%CURRDIR%\JobSubmit.log
REM Run Grinder for 100 thread and 1 run
JAVA -classpath %CLASSPATH% -Dgrinder.agentFile=%INDEX% -Dgrinder.threads=100 -Dgrinder.runs=1 net.grinder.Grinder ..\etc\grinder.properties
SET /A INDEX+=1
ECHO Finished Grinder at %TIMESTAMP% with %CURRJOBS% jobs on PBS>>%CURRDIR%\JobSubmit.log
GOTO START
)ELSE (
ECHO Finished Grinder at %TIMESTAMP% with %CURRJOBS% jobs on PBS>>%CURRDIR%\JobSubmit.log
)
)