Version control is not something you often associate with performance testing scripts. The reasons generally vary. A significant one is the lack of any version control support in commercial toolsets like LoadRunner. Another reason is the perceived short-term shelf life of test scripts. You tend to write them once and throw them away right?
If you work with more agile teams/developers you will probably start to require a lot of re-use out of your scripts, especially when the release cycle increases in terms of frequency. It starts to make sense to use version control and some form of scripting framework.
In this post I’m going to use JMeter as the tool of choice here and I’m going to re-introduce concepts which I normally force upon others whilst contracting. That is, use of Application Simulation Models (ASMs) to hep define the load and use of the Application Performance Index (Apdex) to help present results. I’m also going to use GitHub (or git) as my tool for maintaining version control and implementing a wiki as a dashboard replacement for other test management tools.
Read More
Here’s a simple Ruby script that will parse a remote GC log using Perl for specific date time entries. The scenario in which you might use this script is where you have rather large remote GC logs sitting on another platform like AIX that doesn’t have Ruby installed. It’s useful in the sense you can execute a load test, then just parse the GC log for the entries from the native_stderr.log that represent your test run. YMMV.
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
| # notes: make sure you escape slashes and quotes in the regex
# libs: you will need to install SSH libraries for Ruby from DOS
# set HTTP_PROXY=http://username:password@proxy.local:80
# gem install net-ssh
# gem install net-sftp
require 'net/ssh'
require 'net/sftp'
@HOST = "remote.host"
@USER = "username"
@PASS = "********"
@PATH =
"/opt/websphere/portalserver/6.0/portalserver/native_stderr.log"
@SDATE = "Aug 11 10:0\\d+"
@EDATE = "Aug 11 11:0\\d+"
Net::SSH.start(@HOST, @USER, :password => @PASS) do |ssh|
# parse log
ssh.exec "perl -e '
open(I, \"< #{@PATH}\");
open(O, \"> /tmp/native_stderr.log\");
while(<i>) {
$found = 1 if /#{@SDATE}/;
$found = 0 if /#{@EDATE}/;
print O $_ if $found > 0;
}
close(I);
close(O)'"
end
Net::SFTP.start(@HOST, @USER, :password => @PASS) do |sftp|
# download the truncated log
sftp.download!("/tmp/native_stderr.log", "C:/native_stderr.log")
end |
Read More
If you are a rails fan you will probably recommend using active record instead, but if you just want to hack away at your mysql db from within your Ruby code, you may find this handy…
I’m currently using a wamp box to serve up content for performance metrics. What I needed was a Ruby script which could interrogate data on this installation.
You can download the binary required for this from here. After you install the gem (I do this off-line as my command prompt doesn’t allow me internet access here at work) you may find that you get an error similar to the following:
"NameError: uninitialized constant Mysql"
See what’s happening?
Read More
After getting nowhere with lack luster HP support, I turned to the power of the Open Source community and got a very simple script up and running to remotely monitor Weblogic JVM Performance and JMS queues using JMX and JRuby.
Despite having some initial issues with the code, the author of the jmx4r module turned around a fix inside 24 hours so that I could connect to a Weblogic 9.2 server and look at its domainruntime MBeans. SiteScope can’t handle domainruntimes of these size (short of being told to ‘add more memory’ to a 3GB+ machine!). So exit stage left Mercury, enter stage right JRuby…
Read More
A colleague asked me the other day if it was possible to setup a workstation with just LoadRunner installed and have it automatically carry out a typical user transaction to determine the ‘health’ of the target server. After explaining to him that it would be a clunky approach at best, and currently lacking an installation of HP’s Business Availability Center which could achieve such a thing (Bah, humbug to that) I suggested we write a simple Ruby script, using the ‘watir’ gem which can be periodically called by the existing SiteScope installation.
If you didn’t have SiteScope installed, you could just as easily run this script as a scheduled task within Windows or via cron within a Unix environment, no sweat …
Read More