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.
- 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 Hongkong localhost :GemFire 220.127.116.11 #build 39140 as of 12/10/2012 14:46:33 PST Linux 2.6.18-274.el5 amd64 localhost ...
- On Unix/Linux systems, you can confirm the availability of the zone by looking in
- 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.
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 ----
#!/bin/bash # setting TIMEZONE before launching overrides the automatic setting. if [ "$TIMEZONE" != "" ]; then export TZ=$TIMEZONE else export TZ=`strings "$@" | head -1` fi 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 -----