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

Logger rate limiting #343

Merged
merged 5 commits into from
Nov 14, 2023
Merged

Logger rate limiting #343

merged 5 commits into from
Nov 14, 2023

Conversation

nsavoire
Copy link
Collaborator

@nsavoire nsavoire commented Nov 14, 2023

What does this PR do?

Implement log rate limiting when log level is above debug. Rate limit is set at 100 log/s.

@nsavoire nsavoire force-pushed the nsavoire/logger_rate_limiting branch from 7e8cb11 to 63a5d9b Compare November 14, 2023 14:21
@pr-commenter
Copy link

pr-commenter bot commented Nov 14, 2023

Benchmark results for collatz

Parameters

Baseline Candidate
config baseline candidate
profiler-version ddprof 0.15.0+0b28374c.23298366 ddprof 0.15.0+385b3711.23301422

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 1 metrics, 0 unstable metrics.

See unchanged results
scenario Δ mean execution_time
scenario:ddprof -S bench-collatz --preset cpu_only collatz_runner.sh same

@pr-commenter
Copy link

pr-commenter bot commented Nov 14, 2023

Benchmark results for BadBoggleSolver_run

Parameters

Baseline Candidate
config baseline candidate
profiler-version ddprof 0.15.0+0b28374c.23298366 ddprof 0.15.0+385b3711.23301422

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 1 metrics, 0 unstable metrics.

See unchanged results
scenario Δ mean execution_time
scenario:ddprof -S bench-bad-boggle-solver BadBoggleSolver_run work 1000 same

r1viollet
r1viollet previously approved these changes Nov 14, 2023
Copy link
Collaborator

@r1viollet r1viollet left a comment

Choose a reason for hiding this comment

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

LGTM
A good addition
I think we could still make it more efficient in heavy logging cases, though this is probably only useful in pathological cases that never occur.

include/ratelimiter.hpp Show resolved Hide resolved
namespace ddprof {
void setup_logger(const char *log_mode, const char *log_level);
}
inline constexpr auto kMaxLogPerSecForNonDebug = 100;
Copy link
Collaborator

Choose a reason for hiding this comment

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

ok for 100 👍

Copy link
Collaborator

@r1viollet r1viollet left a comment

Choose a reason for hiding this comment

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

LGTM

r1viollet
r1viollet previously approved these changes Nov 14, 2023
Copy link
Collaborator

@r1viollet r1viollet left a comment

Choose a reason for hiding this comment

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

LGTM

sanchda
sanchda previously approved these changes Nov 14, 2023
Copy link
Collaborator

@sanchda sanchda left a comment

Choose a reason for hiding this comment

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

LGTM--thank you for the improvement!

@nsavoire nsavoire dismissed stale reviews from sanchda and r1viollet via 385b371 November 14, 2023 15:35
@nsavoire nsavoire force-pushed the nsavoire/logger_rate_limiting branch from d2c4947 to 385b371 Compare November 14, 2023 15:35
Copy link
Collaborator

@r1viollet r1viollet left a comment

Choose a reason for hiding this comment

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

LGTM

@nsavoire nsavoire merged commit 58b37ee into main Nov 14, 2023
@nsavoire nsavoire deleted the nsavoire/logger_rate_limiting branch November 14, 2023 22:05
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.

3 participants