[my reply is very late, hope it is of use to others exploring the
wonders of PCP archives]
On Fri, 9 Jun 2000, Nathan Scott wrote:
>
> On Jun 9, 1:41am, Michal Kara wrote:
> > Subject: Archive interpolation mode question
> > Hello!
> >
> > I have added archive mode to PCPMON. It works fine, but when I use the
> > "interpolation" mode, PCP refuses to fetch first two (or three?) metrics
>
> (i think you mean the first 2/3 values for metrics, not the first
> 2/3 metrics?)
>
> > from the archive. I guess it is because the interpolation algorithm needs
> > few
> > previous values, I just want to be sure.
> >
>
> pfft - which bit of the code in libpcp/src/interp.c didn't you
> understand? (all of it? join the club!!) 8-)
>
> this is truly complex stuff ...
[explanation deleted]
Nathan nailed most of the points, just let me add a few more:
1. For metrics with counter semantics, the value at time t is
computed by linear interpolation from the value closest to
t and <= t, and the value closest to t and >= t.
t
|
----+--+----------|---+------+--- values in the archive at +
^ ^ ^ ^
| | | |
t6 t7 t8 t9
so we'd use t7 and t8 in the example above.
Now the tj are not necessarily equally spaced, and not all
metric-value pairs appear in each tj. Herein in lies much of
the complexity in finding t7 and t8 without excessive searching.
Of course things like random seeking into the archive via
pmSetMode() and reading forwards or backwards are not going to
make it simpler either.
2. Monitoring tools tend to use constant time increments, so the
following might happen for a single metric-value with counter
semantics:
+ the first K monitor times are < the first observation in the archive
So an interpolated value is not available until the (K+1)th
monitor time.
3. Tools consuming counter metrics need 2 samples before they can compute
a result.
So in the example above, the rate is not available until the
(K+2)th monitor time.
Any value >=0 is possible for K ... so having nothing to report
for two, three, ... samples is perfectly possible (especially if
the sample time interval as about the same, or smaller than, the
mean time between observations in the archive.
4. For non-counter metrics the story is similar, but different as
follows:
+ no interpolation
+ instantaneous metrics muyst be bounded like counters before a value
is returned
+ bounding is not required for discrete metrics
> > manpage.
> > P.S.: If it is as I think, it would be nice to leave a note in pmSetMode(3)
>
> this could easily be the subject of a lengthy white paper, i'm sure.
We (er, I mean I), should add this to the PCP tutorial pages, and then
add these to the open source release ... its now on my TODO list.
|