Go to the source code of this file.
Classes | |
struct | CacheQueryStats |
struct | _Cache |
struct | _CacheEntry |
struct | RawAccessLogEntry |
struct | _FileIterator |
Typedefs | |
typedef struct _Cache | Cache |
typedef struct _CacheEntry | CacheEntry |
typedef struct _FileIterator | FileIterator |
typedef fr_result(* | FI_READER) (FileIterator *fi) |
Enumerations | |
enum | fr_result { frError = -2 , frMore = -1 , frEof = 0 , frOk = 1 } |
Functions | |
static HttpRequestMethod | methodStrToId (const char *s) |
static void | fileIteratorAdvance (FileIterator *fi) |
static FileIterator * | fileIteratorCreate (const char *fname, FI_READER reader) |
static void | fileIteratorDestroy (FileIterator *fi) |
static void | fileIteratorSetCurTime (FileIterator *fi, time_t ct) |
static CacheEntry * | cacheEntryCreate (const storeSwapLogData *s) |
static void | cacheEntryDestroy (CacheEntry *e) |
static Cache * | cacheCreate (const char *name) |
static void | cacheDestroy (Cache *cache) |
static void | cacheResetDigest (Cache *cache) |
static void | cacheQueryPeer (Cache *cache, const cache_key *key) |
static void | cacheQueryReport (Cache *cache, CacheQueryStats *stats) |
static void | cacheReport (Cache *cache) |
static void | cacheFetch (Cache *cache, const RawAccessLogEntry *e) |
static fr_result | swapStateReader (FileIterator *fi) |
static fr_result | accessLogReader (FileIterator *fi) |
static void | cachePurge (Cache *cache, storeSwapLogData *s, int update_digest) |
static void | cacheStore (Cache *cache, storeSwapLogData *s, int update_digest) |
static void | cacheUpdateStore (Cache *cache, storeSwapLogData *s, int update_digest) |
static int | usage (const char *prg_name) |
int | main (int argc, char *argv[]) |
Variables | |
static time_t | cur_time = -1 |
Typedef Documentation
◆ Cache
Definition at line 27 of file test_cache_digest.cc.
◆ CacheEntry
typedef struct _CacheEntry CacheEntry |
◆ FI_READER
typedef fr_result(* FI_READER) (FileIterator *fi) |
Definition at line 62 of file test_cache_digest.cc.
◆ FileIterator
typedef struct _FileIterator FileIterator |
Definition at line 61 of file test_cache_digest.cc.
Enumeration Type Documentation
◆ fr_result
enum fr_result |
Enumerator | |
---|---|
frError | |
frMore | |
frEof | |
frOk |
Definition at line 57 of file test_cache_digest.cc.
Function Documentation
◆ accessLogReader()
|
static |
Definition at line 376 of file test_cache_digest.cc.
References assert, _FileIterator::entry, _FileIterator::file, frEof, frError, frOk, _FileIterator::inner_time, RawAccessLogEntry::key, Http::METHOD_NONE, methodStrToId(), NULL, storeKeyPublic(), RawAccessLogEntry::timestamp, RawAccessLogEntry::use_icp, xcalloc(), and xisdigit.
Referenced by main().
◆ cacheCreate()
|
static |
Definition at line 208 of file test_cache_digest.cc.
References assert, _Cache::hash, hash_create(), _Cache::name, storeKeyHashCmp, storeKeyHashHash, and xcalloc().
Referenced by main().
◆ cacheDestroy()
|
static |
Definition at line 219 of file test_cache_digest.cc.
References assert, cacheEntryDestroy(), _Cache::digest, hash, _Cache::hash, hash_first(), hash_next(), hash_remove_link(), hashFreeMemory(), and xfree.
Referenced by main().
◆ cacheEntryCreate()
|
static |
Definition at line 188 of file test_cache_digest.cc.
References assert, _CacheEntry::key, _CacheEntry::key_arr, SQUID_MD5_DIGEST_LENGTH, and xcalloc().
Referenced by cacheStore().
◆ cacheEntryDestroy()
|
static |
Definition at line 199 of file test_cache_digest.cc.
Referenced by cacheDestroy(), and cachePurge().
◆ cacheFetch()
|
static |
Definition at line 343 of file test_cache_digest.cc.
References assert, cacheQueryPeer(), RawAccessLogEntry::key, _Cache::req_count, and RawAccessLogEntry::use_icp.
Referenced by main().
◆ cachePurge()
Definition at line 462 of file test_cache_digest.cc.
References assert, _Cache::bad_del_count, cacheEntryDestroy(), _Cache::count, _Cache::digest, _Cache::hash, hash_lookup(), hash_remove_link(), and CacheDigest::remove().
Referenced by cacheUpdateStore(), and main().
◆ cacheQueryPeer()
Definition at line 290 of file test_cache_digest.cc.
References _Cache::digest, CacheQueryStats::false_hit_count, CacheQueryStats::false_miss_count, _Cache::hash, hash_lookup(), NULL, _Cache::peer, _Cache::qstats, CacheQueryStats::query_count, CacheQueryStats::true_hit_count, and CacheQueryStats::true_miss_count.
Referenced by cacheFetch().
◆ cacheQueryReport()
|
static |
Definition at line 311 of file test_cache_digest.cc.
References _Cache::name, _Cache::req_count, Ping::stats, and xpercentInt().
Referenced by main().
◆ cacheReport()
|
static |
Definition at line 334 of file test_cache_digest.cc.
References _Cache::bad_add_count, _Cache::bad_del_count, _Cache::count, _Cache::name, and _Cache::req_count.
Referenced by main().
◆ cacheResetDigest()
|
static |
Definition at line 242 of file test_cache_digest.cc.
References CacheDigest::add(), assert, CacheDigest::count, _Cache::count, _Cache::digest, hash, _Cache::hash, hash_first(), hash_next(), _CacheEntry::key, _Cache::name, and tvSubDsec().
Referenced by main().
◆ cacheStore()
Definition at line 482 of file test_cache_digest.cc.
References CacheDigest::add(), _Cache::bad_add_count, cacheEntryCreate(), _Cache::count, _Cache::digest, _Cache::hash, hash_join(), hash_lookup(), and _CacheEntry::key.
Referenced by cacheUpdateStore(), and main().
◆ cacheUpdateStore()
Definition at line 499 of file test_cache_digest.cc.
References assert, cachePurge(), cacheStore(), SWAP_LOG_ADD, and SWAP_LOG_DEL.
Referenced by main().
◆ fileIteratorAdvance()
|
static |
Definition at line 149 of file test_cache_digest.cc.
References assert, _FileIterator::bad_line_count, _FileIterator::fname, frEof, frError, _FileIterator::inner_time, _FileIterator::line_count, _FileIterator::reader, _FileIterator::time_offset, and _FileIterator::time_warp_count.
Referenced by fileIteratorCreate(), and main().
◆ fileIteratorCreate()
|
static |
Definition at line 107 of file test_cache_digest.cc.
References assert, _FileIterator::file, fileIteratorAdvance(), _FileIterator::fname, _FileIterator::reader, strerror(), and xcalloc().
Referenced by main().
◆ fileIteratorDestroy()
|
static |
Definition at line 127 of file test_cache_digest.cc.
References assert, _FileIterator::entry, _FileIterator::file, _FileIterator::fname, and xfree.
Referenced by main().
◆ fileIteratorSetCurTime()
|
static |
Definition at line 141 of file test_cache_digest.cc.
References assert, _FileIterator::inner_time, and _FileIterator::time_offset.
Referenced by main().
◆ main()
Definition at line 525 of file test_cache_digest.cc.
References accessLogReader(), cacheCreate(), cacheDestroy(), cacheFetch(), cachePurge(), cacheQueryReport(), cacheReport(), cacheResetDigest(), cacheStore(), cacheUpdateStore(), CacheDigest::clone(), cur_time, _Cache::digest, _FileIterator::entry, fileIteratorAdvance(), fileIteratorCreate(), fileIteratorDestroy(), fileIteratorSetCurTime(), _FileIterator::inner_time, _Cache::peer, _Cache::qstats, SWAP_LOG_DEL, swapStateReader(), usage(), xcalloc(), and xfree.
◆ methodStrToId()
|
static |
Definition at line 81 of file test_cache_digest.cc.
References Http::METHOD_CONNECT, Http::METHOD_GET, Http::METHOD_HEAD, Http::METHOD_NONE, Http::METHOD_POST, Http::METHOD_PURGE, Http::METHOD_PUT, and Http::METHOD_TRACE.
Referenced by accessLogReader().
◆ swapStateReader()
|
static |
Definition at line 353 of file test_cache_digest.cc.
References _FileIterator::entry, _FileIterator::file, _FileIterator::fname, frEof, frOk, _FileIterator::inner_time, _FileIterator::line_count, SWAP_LOG_ADD, SWAP_LOG_DEL, and xcalloc().
Referenced by main().
◆ usage()
|
static |
Definition at line 517 of file test_cache_digest.cc.
Referenced by main().
Variable Documentation
◆ cur_time
|
static |
Definition at line 77 of file test_cache_digest.cc.
Referenced by main().