Tips & Tricks

Adding dates to vmstat logs

One of the problems I have with vmstat is that it doesn't have the option to output timestamps (the way iostat does).

As a result, if you have vmstat logs and you don't know exactly when it was run or at what interval it was collecting data, then it makes the data less meaningful or makes it a hassle to track down the information.

It is easy enough to add the date, using a simple shell script. Create a file, add_date.sh, containing the following:

#!/bin/bash

while read data; do
        echo `date '+%m/%d/%Y %H:%M:%S'` $data
done

Java Memory Leaks

Finding (and fixing) memory leaks in java can sometimes be a tricky process. I recently had to do some analysis on a leaking application and hit a snag.

My game plan was to do the following:

  • Capture heap dumps with jmap
  • Analyze dump with jhat

Along the way, I ran into a problem with jmap and discovered a couple new tools.

Regular Expressions in LoadRunner

Dmitry Motevich posted a challenge for getting regular expressions working in LoadRunner. Regular expressions in C isn't pretty, but here it is:

Edit LoadRunner scripts in Eclipse

LoadRunner Vugen can hardly be described as a true IDE, since it is missing a lot of features you would expect, such as: outline of functions, search for references and declarations, code formatting, etc.

It is possible to edit scripts using a real IDE (e.g. Eclipse) with some significant advantages and disadvantages. Here's how...

LoadRunner: Anatomy of a Script

When you record and save a LoadRunner script in Vugen, there are a number of files that are created. Here's what they are, and what they do and identification of the files you can safely delete..

LoadRunner: Creating a custom dll

Using LoadRunner's lr_load_dll() function, it is possible to roll your own dll's and use custom functions in your LoadRunner scripts. Here's how.

Syndicate content