Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Enhance request struct and add debug logging #81

Merged
merged 2 commits into from
Aug 8, 2024

Conversation

xiaguan
Copy link
Contributor

@xiaguan xiaguan commented Aug 8, 2024

for wrong usage like this

./bin/cachesim ../data/twitter_cluster52.csv csv lru 1gb 

Output is

../data/twitter_cluster52.csv LRU cache size     1GiB,          1000000 req, miss ratio 0.0000, throughput 2.29 MQPS

Users might find it annoying when there's no error log or anything to go on. It could be helpful to print the first 10 requests to ensure the simulation is reading them correctly.
After this change, output is

[INFO]  08-08-2024 12:59:03 request.h:78   (tid=8459455488): Request: obj_id=0, obj_size=1, ttl=-1, op=invalid
[INFO]  08-08-2024 12:59:03 request.h:78   (tid=8459455488): Request: obj_id=0, obj_size=1, ttl=-1, op=invalid
[INFO]  08-08-2024 12:59:03 request.h:78   (tid=8459455488): Request: obj_id=0, obj_size=1, ttl=-1, op=invalid
[INFO]  08-08-2024 12:59:03 request.h:78   (tid=8459455488): Request: obj_id=0, obj_size=1, ttl=-1, op=invalid
[INFO]  08-08-2024 12:59:03 request.h:78   (tid=8459455488): Request: obj_id=0, obj_size=1, ttl=-1, op=invalid
[INFO]  08-08-2024 12:59:03 request.h:78   (tid=8459455488): Request: obj_id=0, obj_size=1, ttl=-1, op=invalid
[INFO]  08-08-2024 12:59:03 request.h:78   (tid=8459455488): Request: obj_id=0, obj_size=1, ttl=-1, op=invalid
[INFO]  08-08-2024 12:59:03 request.h:78   (tid=8459455488): Request: obj_id=0, obj_size=1, ttl=-1, op=invalid
[INFO]  08-08-2024 12:59:03 request.h:78   (tid=8459455488): Request: obj_id=0, obj_size=1, ttl=-1, op=invalid
[INFO]  08-08-2024 12:59:03 request.h:78   (tid=8459455488): Request: obj_id=0, obj_size=1, ttl=-1, op=invalid
../data/twitter_cluster52.csv LRU cache size     1GiB,          1000000 req, miss ratio 0.0000, throughput 2.29 MQPS

Users will know right away if there's an issue with reading.

@xiaguan xiaguan force-pushed the debug_req_when_read branch 2 times, most recently from 0d5d05f to 71f48b4 Compare August 8, 2024 14:00
@xiaguan
Copy link
Contributor Author

xiaguan commented Aug 8, 2024

Thanks for the suggestion! I've made the updates to my PR.

@xiaguan xiaguan force-pushed the debug_req_when_read branch from 71f48b4 to df94078 Compare August 8, 2024 14:02
@1a1a11a
Copy link
Owner

1a1a11a commented Aug 8, 2024

Great work! You may want to add this to doc :)

@1a1a11a 1a1a11a merged commit 8342380 into 1a1a11a:develop Aug 8, 2024
2 checks passed
@1a1a11a
Copy link
Owner

1a1a11a commented Aug 8, 2024

Thank you!

haochengxia pushed a commit to haochengxia/libCacheSim that referenced this pull request Oct 24, 2024
* feat: Enhance request struct and add debug logging

* doc: add doc about print-head-req
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants