TimeGraph Applet
TimeGraph is a graphing applet, especially suited to graphing real-world
internet statistics such as network throughput or web hits. Up to 8
datasets can be plotted on the same graph and the graph can be zoomed into
for better examination.
Parameters can also be graphed as deltas, ie. the differences between
consecutive values; it can automatically select the groups with
the highest-valued parameters; and most of its configuration can
be changed without restarting the applet.
Note that it relies on the X index being a timestamp, and only plots
linegraphs. It was designed for use to plot network statistics, but it'd
be useful for any other numeric statistics whose progress over time needs
to be graphed, eg. CPU usage, web hits, temperature, etc.
Using the Applet
Hit the Configure... button to display a window where you can
select each data set to graph, using the following parameters for
each one: the group to graph, the parameter in that group, the
scale to use, and any special treatment the data should get (eg.
plot as deltas, etc.)
Use the Zoom In and Zoom Out buttons to select the area of the
graph you want to view. If you drag an area of the graph before
zooming in, it will zoom in on that area.
Hit Reset if you zoom in too far and couldn't be bothered zooming
out again; it'll reset the graph's ranges to where they were when
you started zooming.
Applet Tag Parameters
- src
the statistics file.
- graph #
which groups and parameters to graph (# = graph number, up to 8).
This parameter takes the following format:
"name[/param][*scale][,delta]"
- name name of group
- param parameter in group (default first)
- scale scale of graph (integer)
- delta plot deltas between consecutive values
- highest
display the groups with the highest values, as
an alternative to using the "graph #" format listed
above.
- delta
use deltas to graph all values.
- markdaytime
differentiate between night and day,
where daytime is between 8 AM and 6 PM.
- markweekend
differentiate between week and weekend.
- usdates
expect US-format dates (mm/dd/yy) instead of (dd/mm/yy).
- memory
used for
dynamic data sources -- only retain this many
of the most recent data points.
The Statistics File Format
Each line represents a single set of statistics at a specific time,
for a number of different "groups" of parameters. Each group represents
one entity, eg. an individual link to another site, and within each
group is a number of different parameters.
The timestamp is separated from the groups by whitespace (one or
more spaces or tabs), and the groups are separated from each other
by whitespace. End-of-line signifies that there's no more statistics
from that point in time.
timestamp group[ group...]{newline}
The timestamp takes the following format:
Eg. 19:20 Sun 17/03/96 . To use US-style dates,
eg. 19:20 Sun 03/17/96 , use the usdates
applet parameter.
Each group looks like:
name="groupname",param=value[,param=value...]
Each group must have a name string parameter, and all the
parameters apart from the name must be numeric, either in
floating-point or integer representations. Scientific notation,
eg. "1e+6", is not supported (because it's not supported by
the JDK StreamTokenizer ;).
Here's the
statistics data file used above,
so you can see the format.
Licensing and Distribution
This software is now free software. Use as you see fit, including hack the
source and so on, but the existing copyright notices must be retained, intact.
Additional notices, to copyright your own modifications, may be added though.
Archives containing the source files, these pages describing the applet,
and pre-built class files, can be downloaded here.
- In Windows .ZIP format: tgsource.zip (110k)
- In UNIX .tar.gz format: TimeGraph.tar.gz (90k)
The Source
I've included a version of the JDK's StreamTokenizer class which fixes
a bug in treating space as a special character; the fixed source
for it is here
. This will (hopefully ;) become unecessary with a future version of the
JDK. The rest of the source is listed below.
- TimeGraph.java
- TimeStatsCanvas.java
- StatsReader.java
- StatsStreamTokenizer.java
- SetupFrame.java
- AboutFrame.java
- ColourButton.java
Note About the Sample Graph
The sample graph above is of IONA's internet link throughput around December
1995.
If You Find TimeGraph Useful
If you find TimeGraph useful, or use it in any interesting projects,
please drop me a line at jmason@iona.com .
Reviews
-
A "very good" review from
JARS .
Last change: Apr 14 1998 jmason