SicsLogger

Search SINQ Wiki:
SINQ LIN

SINQ Wiki
- Main Page
- Search SINQ Wiki
- Sample Environment
- Probenumg. Intern
- Troubleshooting SICS

This Page
- Page Info
- Printer Friendly

Referenced by
NewFeaturesInSICS

Wiki Info
- Unused pages
- Undefined pages
- RecentChanges
- Page Index
- System Info
- JSPWiki Docu
- SandBox
- OneMinuteWiki
- Create a New Page




JSPWiki v2.0.52


Logger - yet an other Variable Logging Utility

The Logger (logger.c)

The logger is a utility to write the history of object parameters. For all drivers based on pardef it is automatically switched on. The data is logged typically every 5 seconds to a file, but only changes are stored in order to save disk space. The file specification for the logfiles is:

<logger base path>/<variable name>/MM-DD.log

Files older than one year will be overwritten. The variable name is the object name for the basic value of the object or <object name>.<parameter name> for the parameters. Important parameter names might be configured to have a more descriptive name.

Syntax of the Log Files

First there is a header line, containing the date and some additional information:

isdst
0/1 when daylight saving time is in effect or not
period
the minimal interval between logged values
exact
0: plot points should be connected with a straight line, 1: plot curves should have only horizontal and vertical lines

For every logger entry, there is one line, containing the time, a tab as separation and a value, (which may be a text or number). There may also be lines starting with a hash symbol, which may contain the same information as in the header line, or just a comment.

#2005-10-30 00:00:00 isdst 1 period 5 exact 0
00:00:00        100.72
00:00:05        100.73
00:01:10        100.73
00:01:15        100.74
00:01:20        100.73

      ...                                   many lines omitted

02:59:55        100.56
#isdst 0                                    change of daylight saving time
02:00:00        100.58

      ...                                   many lines omitted

07:55:00        100.58                      the server was shut down after writing this line
#period 5 exact 0 isdst 0                   the server restarts at 8:30
07:55:05                                    the shutdown time and an empty value
08:30:00        99.95                       the first logged value after startup

The Log Reader (logreader.c)

There is also a utility to read the logged data through the SICS server. The command syntax is:

   graph <start time> <end time> np <number of points> <variable> <variable> ...
   graph <start time> <end time> text <variable> <variable> ...
where

<start time> <end time>
start and end time in seconds. Negative or small values (lower than one year) are relative to the actual time. Large values are treated as unix time values (seconds since 1970-01-01:00:00:00 UTC).
<number of points>
the maximal number of points to be read. If the the number of points is less than the interval duration divided by the logging period, the data is compressed.
<variable>
the variable name or object parameter name (<object>.<parameter>).

The second form with the keyword text does not compress, and is mainly used for text variables.

The returned list has the following syntax:

  • first line: the actual time in unix format (relative times are related to this value)
  • then, for every variable
    • variable header:
      *<variable name> exact <exact flag>
    • first datapoint:
      <unix time> <value>
    • further datapoints (may appear many times, up to the number of points specified):
      <seconds since last datapoint> <value>
  • end mark:
    *<compressed> <overflow>
<compressed> is 0, if no compression appeared, 1 else
<overflow> should be 0, else an internal error occur (might be removed later)



Printer Friendly  Page Info
This page last changed on 15-Sep-2005 07:53:08 UTC by MarkusZolliker.