Cache Analysis Service
#Airbnb #Medium #Coding #Onsite
Question
Given a list of records (as a csv file), analyze the hit rate of each key group (e.g., "user_1" key belongs to "user" key group). There are two different types of operations:
get: getting value of a single key.
getkq: getting values of multiple keys (noop indicates the end of either "getkq" request or response)
The status of the response is either "ok" (cache hit) or "nokey" (cache miss).
conn_id
magic_code
op_code
status
key
1
req
get
-
user_1
1
resp
get
ok
-
2
req
get
-
listing_1
2
resp
get
nokey
-
1
req
getkq
-
user_1
1
req
getkq
-
listing_2
1
req
noop
-
-
1
resp
getkq
ok
user_1
1
resp
noop
ok
-
The output of the above example should look something like:
listing: 0% (0/2)
user: 100% (2/2)
Last updated
Was this helpful?