MCPcopy Create free account
hub / github.com/acl-dev/acl / get

Function get

lib_acl_cpp/samples/mem_cache/main.cpp:16–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14}
15
16static void get(const char* addr, int id, int num)
17{
18 acl::mem_cache client(addr);
19 acl::string buf, key;
20 int i;
21
22 client.set_prefix(__key);
23
24 for (i = 0; i < num; i++)
25 {
26 key.format("key:%d:%d", id, i);
27 if (client.get(key.c_str(), buf) == false)
28 break;
29 if (i <= 100)
30 printf("GET: %s, %s\n", key.c_str(), buf.c_str());
31 if (i % 10000 == 0)
32 {
33 char tmp[256];
34 snprintf(tmp, sizeof(tmp), "GET, i: %d, num: %d", i, num);
35 ACL_METER_TIME(tmp);
36 }
37 }
38 printf("OVER: total: %d\n", i);
39}
40
41static void mod(const char* addr, int id, int num)
42{

Callers 15

mysql_getMethod · 0.50
pgsql_getMethod · 0.50
http_get.cppFile · 0.50
http_get.cppFile · 0.50
runMethod · 0.50
runMethod · 0.50
setMethod · 0.50
getMethod · 0.50
initMethod · 0.50
hsclient.cppFile · 0.50
operator []Method · 0.50
operator[]Method · 0.50

Calls 3

formatMethod · 0.45
getMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected