Is this time related process accounting stats gathering appropriate?
Posted
by Ceko Cakata
on Stack Overflow
See other posts from Stack Overflow
or by Ceko Cakata
Published on 2010-04-06T17:09:38Z
Indexed on
2010/04/06
17:13 UTC
Read the original article
Hit count: 131
Based on sys/acct.h (V1, not V3) I need to gather some user usage statistics based on a parser that parser the acct file line by line. The parser will run and parse the entire file every N seconds and I need to gather user statistics accumulated since the last run (N seconds back). I'm not sure what will be the most appropriate way to do it based on the info provided by sys/acct.h.
Maybe something like this:
if ((ac_btime + ac_etime) < (current_time - N)) { gather; }
Also comp_t is said to be "floating-point value consisting of a 3-bit, base-8 exponent, and a 13-bit mantissa", but I think u_int16_t is just a unsigned short int. Should I be converting it to long it with the provided formula or not?
© Stack Overflow or respective owner