Re: [squid-users] TCP_DISK_HIT = TCP_HIT - TCP_MEM_HIT ?

From: Henrik Nordstrom <[email protected]>
Date: Sun, 12 Nov 2006 16:17:59 +0100

sön 2006-11-12 klockan 13:30 +0100 skrev Joel CARNAT:

> so I was wondering if I was not mistaking thinking:
> SQUID-MIB::cacheHttpHits = LOG/TCP_HIT + LOG/TCP_MEM_HIT

Yes, and a bit more..

int
isTcpHit(log_type code)
{
    /* this should be a bitmap for better optimization */
    if (code == LOG_TCP_HIT)
        return 1;
    if (code == LOG_TCP_IMS_HIT)
        return 1;
    if (code == LOG_TCP_REFRESH_FAIL_HIT)
        return 1;
    if (code == LOG_TCP_REFRESH_HIT)
        return 1;
    if (code == LOG_TCP_NEGATIVE_HIT)
        return 1;
    if (code == LOG_TCP_MEM_HIT)
        return 1;
    if (code == LOG_TCP_OFFLINE_HIT)
        return 1;
    return 0;
}

It's a bit of an approximation as there is no exact hit/miss semantics
in HTTP caches. The cache validations lives somewhere between hit/miss.

Regards
Henrik

Received on Sun Nov 12 2006 - 08:18:04 MST

This archive was generated by hypermail pre-2.1.9 : Fri Dec 01 2006 - 12:00:03 MST