Pivotal Knowledge Base


How to Open Statistics Archive Files using a Specific Time Zone in Visual Statistics Display


Pivotal GemFire all versions


By default, Visual Statistics Display (VSD) opens statistics in the time zone of the host running VSD. In order to align statistics with log entries, however, it would be preferable to see them in the time zone of the source system. A method for controlling the time zone used by VSD and an example script to (semi-)automate this is presented here.


  1. To open a VSD file with the time zone of the source system, you need to know in which time zone the VSD file was created.

    This information is kept in the stats archive file header and can be extracted using the following:

    $ strings file.gfs | head


    $ strings cacheserver.gfs | head
    :GemFire #build 39140 as of 12/10/2012 14:46:33 PST
    Linux 2.6.18-274.el5
    amd64 localhost
  2. On Unix/Linux systems, you can confirm the availability of the zone by looking in /usr/share/zoneinfo.
  3. Export the specified time zone to the shell and launch VSD:
    $ export TZ=<time zone> vsd

    e.g., for Hong Kong, you would do:

    $ export TZ=Asia/Hong_Kong vsd

Note- Some time zones have short names (e.g. EST, IST) that are not sufficiently unique, so it is generally better to use an equivalent "zoneinfo", region/city identifier.

Scripted Solution:

Below is a script that implements the above procedure. To use, save the script, changing the path of vsd to fit your install, and change the permissions of the script to run it, i.e.:

$ chmod +x startVSD.sh
$ ./startVSD.sh statfile.gfs

---- BEGIN SCRIPT ----

# setting TIMEZONE before launching overrides the automatic setting.
if [ "$TIMEZONE" != "" ]; then
  export TZ=$TIMEZONE
  export TZ=`strings "$@" | head -1`

echo "Using time zone: $TZ"
# use "exec" to start vsd in this same process rather than spawn a new one.
exec Path_to_GemFire/tools/vsd/bin/vsd "$@" &

----- END SCRIPT -----


Powered by Zendesk