Soliciting views from the broader pcp community ...
To address the problem Dave's having with derived metrics and some
instability/wrap issues in the underlying instrumentation, I'm proposing
the following additions to the derived metrics features.
1. a new function, floor(x, y) with the value x >= y ? x : y
2. a new function, ceiling(x, y) with the value x <= y ? x : y
And Dave's derived metric definitions would become
mem.util.ncache_clean = floor(mem.util.cache_clean - mem.util.shmem, 0)
mem.util.mmapped = floor(mem.util.mapped - mem.util.shmem, 0)
Thoughts, endorsements, criticisms?
ps of course it would be handy to understand how/why the expression goes
negative, but this proposal provides an acceptable workaround for the
short-term that might even be useful for others.
pps if there are any other candidates for additional functions when
defining derived metrics, now would be a good time to speak so I can
sweep 'em all up with a single round of changes and QA ... doing this is
not hard, just a bit boring.
On Thu, 2010-05-06 at 17:36 -0500, David Wright wrote:
> >
>
> I dont know yet, I was going to look at that but typical is a huge
> wrapped number which I cant tell how far off. I will know more on
> that in the next day. BTW gr_osview on Irix had this problem
> of a wrapped number. thats why I thought it wrapped.
>
> pmchart all of a sudden is showing just the derived and I plan on
> narrowing that down.
>
> Basically I am trying to build the gr_osview rmemc type of stack
> chart and take shmem out of mapped and cache.
>
> #new one I am trying where shmem is split out
> plot color #ffff00 metric mem.util.slab
> plot color #0000ff metric mem.util.bufmem
> plot color #ff0000 metric mem.util.dirty
> plot color #008000 metric mem.util.writeback
> plot color #0080ff metric mem.util.NFS_Unstable
> plot color #aa5500 metric mem.util.ncache_clean
> plot color #666666 metric mem.util.shmem
> plot color #aaff00 metric mem.util.mmapped
> plot color #aa00ff metric mem.util.anonpages
> plot color #aaaa7f metric mem.util.free
>
> chart title "newshm [%h]" style stacking
> plot color #aaff00 metric mem.util.mmapped
> plot color #aa5500 metric mem.util.ncache_clean
> plot color #666666 metric mem.util.shmem
>
> > On Tue, 2010-05-04 at 18:02 -0500, David Wright wrote:
> > > >
> > >
> > > I was looking for a way to avoid a negative.
> > >
> > > pmchart is going funny with my stack chart and flipping to just
> > > the derived.
> > >
> > > mem.util.ncache_clean = mem.util.cache_clean - mem.util.shmem
> > > mem.util.mmapped = mem.util.mapped - mem.util.shmem
> >
> > Does the value of the derived metric go just a little negative (due to
> > some rounding or timing issues in the calculation) or a lot negative
> > (suggesting the semantics of the operand metrics or the derived metric
> > is a little strange)?
> >
> > The only solution within the current expression grammar would be
> > something like a new notnegative(x) function which returns 0 if the
> > value of x is less than zero, else the value of x. But this does seem
> > like something of a hack for a situation that I'm not sure is going to
> > be that common in general.
> >
> >
>
|