8000 log: Add support for pattern-based logging and call line tracing by jasraj · Pull Request #54 · BuaBook/kdb-common · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

log: Add support for pattern-based logging and call line tracing #54

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

Merged
merged 1 commit into from
Feb 21, 2021

Conversation

jasraj
Copy link
Member
@jasraj jasraj commented Feb 8, 2021
  • All string loggers now pad the log level to improve readability
  • Loggers moved into log.loggers.q
  • Re-organisation of logging constants and configuration

Performance Testing

Equivalent Logging

Comparing the new pattern-based logging (increased flexibility) vs the old logger (fixed):

/ model name      : Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz

/ Setup
q) dict:`a`b`c!1 2 3;

/ For new pattern-based logging (matching original logger)
q) .log.cfg.format:"%d %t %l %p %u %h %m"
q) .log.setLogger[]

q) .log.info "A dictionary: ",.Q.s1 dict;                                   / Original
q) .log.info ("A dictionary: {}"; dict);                                    / Parameterised

Results:

Formatter Log Format Iterations ts
Fixed Original 1000 20 4195376
Pattern Original 1000 22 4195376
Fixed Parameterised 1000 21 4195264
Pattern Parameterised 1000 24 4195264

The pattern-based logging has ~10% degradation in performance when logging with the same elements as the original logging.

Call Trace Logging

/ model name      : Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz

/ Setup
q) .test.log:{ .log.info "Logging test" };

/ Original logger pattern
q) .log.cfg.format:"%d %t %l %p %u %h %m"
q) .log.setLogger[]

/ Logger pattern with call trace logging
q) .log.cfg.format:"%d %t %l %p %u %h %T %m"
q) .log.setLogger[]

q) \ts do[1000; .test.log[]; ]

Results:

Call Tracing Iterations ts
NO 1000 12 4195088
YES 1000 28 4195088

Including call-trace logging in the formatting has ~130% degradation in performance

@jasraj jasraj force-pushed the log-pattern-and-debug branch from 16671b7 to 7cc5151 Compare February 8, 2021 21:32
@jasraj jasraj marked this pull request as ready for review February 8, 2021 21:32
@jasraj jasraj changed the title log: Add support for pattern-based logging and function introspection log: Add support for pattern-based logging and call line tracing Feb 8, 2021
 - All string loggers now pad the log level to improve readability
 - Loggers moved into log.loggers.q
 - Re-organisation of logging constants and configuration
@jasraj jasraj force-pushed the log-pattern-and-debug branch from 7cc5151 to 6220b3a Compare February 15, 2021 18:16
@jasraj jasraj merged commit ae3086c into master Feb 21, 2021
@jasraj jasraj deleted the log-pattern-and-debug branch February 21, 2021 21:21
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.

1 participant
0