Hi,
Just a progress update.
I've pushed these changes to my multi-archive branch:
git://git.pcp.io/brolley/pcp.git multi-archive
With these changes clients can now read backward across multiple
archives using PM_MODE_BACK. This is in addition to the existing support
for reading forward across multiple archives using PM_MODE_FORW and
PM_MODE_INTERP.
In addition, directories may now be specified in the 'arg' string of
__pmOptAddArchive() and __pmOptAddArchiveList() and thus they are also
supported by all tools using the -a option via pmGetOptions(3). The
current implementation, when a directory is specified is as follows.
Archives are automatically identified within the directory by looking
for files with the suffix .index, .meta, .<number> and .<number>.<cmp>,
where <cmp> is one of the supported compression suffixes. These are the
same suffixes used by __pmLogLoadLabel() to identify the components of
an archive file. At this time directories are not recursively searched
for more archives. Using multiple -a options is also supported with and
without directories.
I've tested manually using pmval(1) for forward traversal in both raw
and interpolation mode and using pmdmplog(1) for backward traversal. qa
is still to come.
Nathan has pointed out to me that pmchart(1) does not use PM_MODE_BACK
for reading backward, but rather uses negative time deltas and
PM_MODE_INTERP. I will be working on ensuring that usage mode works
properly next.
Dave
-------------------------------------------------------------------------------------------------------------
commit 5405160bc955d5376a3ec439c1cc49c94e05246f
Author: Dave Brolley <brolley@xxxxxxxxxx>
Date: Thu Aug 20 16:01:17 2015 -0400
Reading multiple archives in reverse:
When swtching to the previous archive in reverse mode switch to the
end of the final volume of that arhive.
commit 42403d1315b78196b2be0cb442d9ccd6670c1b27
Author: Dave Brolley <brolley@xxxxxxxxxx>
Date: Wed Aug 19 10:36:57 2015 -0400
__pmAddOptArchive(), __pmAdOptArchiveList(): Allow directories to
be specified.
If the specified path is a directory, __pmAddOptArchive() will now
open the directory and search for archives within it. Archives are
detected by the presence of .index, .meta suffixes as well as
numeric suffixes possibly followed by one of the supported compression
suffixes.
The elements of the list provided to __pmAddOptArchiveList() may
also now be directories.
This change also reverts the previous change back to using commas
to separate the names of archives in a list. There is existing
precedent for the use of commas when PM_OPTFLAG_MULTI=true.
commit e3017f4a96439878476b04cc75f24e22a11230b3
Author: Dave Brolley <brolley@xxxxxxxxxx>
Date: Tue Aug 18 09:57:35 2015 -0400
Change multi-archive delimeter to ':' from ','.
commit 00591505de83d1cbb96c0aa51f9ce3ae7bf89067
Author: Dave Brolley <brolley@xxxxxxxxxx>
Date: Mon Aug 17 13:51:31 2015 -0400
Initial implementation of reading multiple archives in reverse.
|