[Haizea] sum operation in accounting module

Borja Sotomayor borja at borjanet.com
Thu Jun 10 14:28:36 CDT 2010


Hi,

> How can I implement sum operation in accounting module? e.g. I want to add
> data of all leases.

Is there any reason why you can't use a counter?

http://haizea.cs.uchicago.edu/manual_single/manual.html#SECTION04230000000000000000

You can increment the counter by some value every time a lease ends;
you can then use the _set_stat_from_counter method to create a final
stat that reports the final value of the counter (the sum of all the
values you incremented by). The LeaseProbe has a few examples of this.

Cheers!
-- 
Borja Sotomayor
PhD Candidate in Computer Science, University of Chicago
http://people.cs.uchicago.edu/~borja/


More information about the Haizea mailing list