Playback and Plot Files

Playing back one or more files

You tell collectl to play back one or more files using -p following by any combination of one or more files separated with commas or whitespace if the string is quoted. They 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. Collectl can also record them in plot format to multiple output files as appropriate. Filtering options such as -b and -e to specify beginning and ending times can also be used.

If you do choose to use a begin time switch keep several things in mind. Collectl processes the files in the order specified, skipping records until it finds the first interval >= the begin time and reports all remaining records until it reaches the end time. If files are listed out of time sequence you may end up reporting on data prior to the begin time.

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 this must be repeated for each, so keep this in mind - if 2 files contain 4 samples each, you will only see 6 intervals.

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 collectl 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.

Creation of Plot Files from Raw Files

These rules apply whether playing back one or multiple files.

The first thing collectl does is examine the raw file header to get the source host name and creation date. There will always be a new set of data generated for each unique combination of host and creation date. Note that depending on the subsystems chosen there may be multiple output files generated. This also means a single raw file that spans multiple dates will result in a single set of data.

By default, the name of the plot file contains only the date and a test is made to see if a file with that name already exists. If not, it is created in append mode. This means that multiple raw data files for the same host on the same date will result in a single set of data. However, if that file already exists, collectl will NOT process any data, and request you specify -oc to tell it to perform the first open in create mode so that subsequent files can be appended. If you specify -oa all files will be appended to the original one which may not be what you want. Collectl cannot read your mind so to be safe, be explicit. If you want to generate a unique set of data files for each raw file use -ou which causes the time to be included in file names, resulting in a unique output file name for each raw file.