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

Scribe log messages should have millisecond level timestamp #36

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

rajubairishetti
Copy link

Sample log : [Wed Aug 13 15:59:14 2014 486] "throttle denying request for queue size <31681> with a batch of" " <1> messages for [benchmark_collector] category. It would exceed max queue size <30000>"

@@ -64,7 +64,10 @@ const std::string scribeversion("2.2");
time(&now); \
ctime_r(&now, dbgtime); \
dbgtime[24] = '\0'; \
fprintf(stderr,"[%s] " #format_string " \n", dbgtime,##__VA_ARGS__); \
struct timeval tv; \
gettimeofday(&tv, NULL); \

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This introduces one extra call. Try the following:

  • first call gettimeofday()
  • take tv.sec and pass it to ctime_r()
  • together print sec and millisec parts

@satish-mittal
Copy link

The time format printed now is quite confusing (the millisecond is appearing separately after year). Can we explore some other format that allows seconds and milliseconds to appear together?

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.

None yet

2 participants