erlang/otp — pull request #384 by dvaergiller (2014-05-27 12:54:05+00:00)
Title: Observer adjustable time axis

# Motivation

When using the performance graphs in Observer for a long time
period, information may be lost due to the narrow time frame in which
data is kept and plotted.

# Proposed solution

A simple settings dialog box was added where the user may enter the
preferred length of the time axis in minutes and seconds. The
performance graphs update their time axis accordingly.

The interval of the time marker positioning adjusts to different
time axis lengths so that a reasonable number of markers are being
rendered.

Finally, the labels of the time markers show either minutes only,
seconds only, or both. This is decided based on the time marker
intervals. This way, the labels always show enough information but no
more.

# Possible problems

If the time axis is very long, the current method of storing and
rendering the data may become resource-heavy. An upper limit has been
considered, but that is probably best left to the user to decide.

# Implementation details

A settings field was added to the state record of the performance
graph module. The settings field is a record with currently only one
setting: graph_time, which is by default set to 60 (the previously
hard-coded value). Each part of the code where the time axis length of
60 was hard-coded was changed to use the current setting instead.

The dialog box is set to trigger a callback function which reads a new
value from text fields, calculates the new graph_time value and sends
a message back to the module to update settings accordingly.

The time marker code was rewritten to select an interval from a list
in decreasing order until an interval is found which is short enough
to show at least 5 time markers.