Dealing with empty aggregates?

Bryn M. Reeves bmr@redhat.com
Thu May 19 14:46:00 GMT 2011


On 05/19/2011 03:36 PM, Frank Ch. Eigler wrote:
> The canonical construct doesn't require a hand-maintained flag:
> 
> probe timer.ms(1000) {
>     if (@count(stuff))
>        printf("Sum of stuff: %d\n", @sum(stuff))
>     else
>        printf("No stuff.")
> }

Exactly what I was looking for, thanks! A count is not especially useful for the
stuff I'm looking at (nfsd operations fwiw) and it didn't occur to me to gate on
count (obvious really since it's the only one defined on an empty aggregate.. duh!).

Cheers,
Bryn.



More information about the Systemtap mailing list