Playback

Playing back one or more files

There are actually 2 reasons for playing back a file, one being to generate plottable files and the other is to simply examine the data in the same format as you would see if running collectl interactively. The following discussion applies to both cases, the only real difference is that to generate plot files you include the switches -P and -f.

You tell collectl to play back one or more files using -p followed by any combination of one or more files separated with commas or whitespace, noting you may need to quote the string, especially if the name(s) contain wild-card characters. The files will be played back as if a single file, with monotonically increasing sample numbers for each unique source system. It should be noted that if these files contain samples of different subsystems the resultant stream will contain data elements for all, zero filling as appropriate. When this occurs, a message will be displayed if -m has been specified.

As already mentioned, collectl will generate plot format if requested with -P, writing the output to multiple output files as appropriate. Filtering options such as --from and --thru to specify beginning and ending dates/times can also be used.

If you do choose to use the --from or --thru switches keep several things in mind:

Collectl then processes the files in the order specified, noting if multiple files are explicitly specified and are out of order, unexpected results may be produced.

Collectl always needs data from a base interval from which to begin calculating changes in counters and that interval is never displayed. Therefore when you specify a starting time, collectl attempts to read a sample from a previous interval. When mulitple files are processed collectl is smart enough to know if they are contiguous to use the last set of data from one file as the base interval for the next file. However if they are not configuous a new base level must be taken for the new file and its first record skipped. This can be confusing and probably not even that important but consider 2 files generated contigously:

If you have 2 non-contiguous files you will see the same results whether you process them one at a time or together using a wild card, that is no first record for either.

Important Tip
Perhaps the most important thing to keep in mind is that when you play back a file, collectl will use the same switches as were specified during collection. In other words if you collect cpu, disk and network data using -scdn, when you play it back you will get cpu, disk and network summary data either displayed on the terminal or written to a file. However, you could just have easily chosen a different subsystem specification such as -scND in which case you'd still get CPU summary data but now you'd get network and disk detail data. This feature can be extremely useful especially when combined with different output formatting switches such as -o and/or --verbose.
updated Feb 21, 2011