Toad World® Forums

Benchmark Automation


Does anyone know of a way to execute a Benchmark factory load from a script? Ideally I would like to be able to invoke a script on my system that will start the benchmark. Then maybe do some additional operation, like execute a database backup while under load. Once the benchmark is complete I would also like the script to be able to grab the results, apply a set of rules, and execute another benchmark job based on those results.

Is this possible with Benchmark Factory?




Is it just a single job, or multiple jobs? But basically, here is a snippit of code, I can send you the entire script (poorly commented). The script I wrote basically starts a bunch of agents and job combinations on a bunch of servers, but this little chucnk of code is the key.

Set oBMF = CreateObject(“BFactory4.Application”,AgentServerName) 'assuming that the machine that you are running the script from and the machine with the agent are two different servers. If it is the same, then you can leave out the ,AgentServerName
For Each oJob In oBMFApp.Jobs
If oJob.Name = “NameOfJob” Then
End If

then you can monitor the status of the agent with this chunk of code

Set oBMF = CreateObject(“BFactory4.Application”,AgentServerName
For Each oBFJob in oBMF.Jobs
Do Until oBFJob.Status <> 2 'I beleive 2 means job is running.
WScript.Sleep(18000) '3 minutes = 18000 1000=1 Second
Exit For


Thanks this is helpful, and I would appreciate seeing the full script.

Based on my reading it looks like there is no specification of a job file, so it would pick whatever was last in use. If that is the case I think I should be able to do some things in the job loop to pick the job I need to run based on previous results.

My original idea was to use multiple job files, but I don’t think that is critical.

Do you know of a reference guide that would show the various members and methods of the oBMF object?




It’s the name of the job in BMF. So if you have 5 jobs, job1, jbo2,job3,job4, submited to the queue (when you finish creating the job, and submit it, choose the option NOT to run the job, but just submit it). You would then place in that script, the submited job name. Unfortunatly, the library for the object is not exposed, one the key developers came out on site to help me, and he showed me this little chunk of script. But I am sure he is watching this thread, and will chime in soon. I will prep the script to send to you, I just need to clean it up a little, give me a couple hours.


Thanks. I’ll look forward to seeing it.


I think this should do it. It’s the basics of it, anything else has pretty much just post, and pre processing, sneding e-mails, restoring databases, etc…
bmfrun.txt (2.73 KB)


Thanks Adam,

I’ll start looking at this in my environment.

Benchmark Factory Developers - Can any of you comment on if any reference material is available to show the objects and methods that are available?




We do not have any documention describing the COM interface since this is an unsupported feature, but I will try to put something together and post it.



I would appreciate any information that you can provide.

John Moran


Any known way to do this sort of thing in PowerShell?