Example #1
0
void
collect_info(char *l, struct squid_info *si)
{
    read_a_long_long_value(l, key_info[0],
            &si->mu.mem_total, RIGHT);

    read_a_long_long_value(l, key_info[1],
            &si->mu.mem_free, RIGHT);

    read_a_long_long_value(l, key_info[2],
            &si->mu.mem_size, RIGHT);

    read_a_int_value(l, key_info[3],
            &si->fu.fd_used, RIGHT);

    read_a_int_value(l, key_info[4],
            &si->fu.fd_queue, RIGHT);

    /* here don't confuse the order */
    if (read_a_int_value(l, key_info[6],
                &si->iid.memobjs, LEFT))
    {
        return;
    }

    read_a_int_value(l, key_info[5],
            &si->iid.entries, LEFT);

    read_a_int_value(l, key_info[7],
            &si->iid.hotitems, LEFT);

    read_a_float_value(l, key_float[0],
            &si->sf.responsetime,
            RIGHT, 100);

    read_a_float_value(l, key_float[1],
            &si->sf.meanobjsize,
            RIGHT, 100);
    read_a_float_value(l, key_float[3],
            &si->sf.disk_hit,
            RIGHT, 10);
    read_a_float_value(l, key_float[2],
            &si->sf.mem_hit,
            RIGHT, 10);
    read_a_float_value(l, key_float[4],
            &si->sf.http_hit_rate,
            RIGHT, 10);
    read_a_float_value(l, key_float[5],
            &si->sf.byte_hit_rate,
            RIGHT, 10);
    read_a_float_value(l, key_float[6],
            &si->sf.disk_hit,
            RIGHT, 10);
    read_a_float_value(l, key_float[7],
            &si->sf.responsetime,
            RIGHT, 100000);

}
Example #2
0
void
collect_cnts(char *l, struct squid_counters *sc)
{
    read_a_long_long_value_squid(l, key[0],
            &sc->cc.http_requests, RIGHT);

    read_a_long_long_value(l, key[1],
            &sc->cc.http_hits, RIGHT);

    read_a_long_long_value(l, key[2],
            &sc->cc.http_kbytes_out, RIGHT);

    read_a_long_long_value(l, key[3],
            &sc->cc.http_hit_kbytes_out, RIGHT);
}