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

v3: Updates to fiberlog benchmarks and documentation #3059

Merged
merged 2 commits into from
Jul 5, 2024

Conversation

gaby
Copy link
Member

@gaby gaby commented Jul 3, 2024

Description

  • Added missing Benchmarks for fiberlog
  • Added missing Parallel benchmarks for fiberlog
  • Renamed some of the cors benchmarks to have consistent names
  • Rewrote the docs for log.md.

Related to #3048

Changes introduced

List the new features or adjustments introduced in this pull request. Provide details on benchmarks, documentation updates, changelog entries, and if applicable, the migration guide.

  • Benchmarks: Describe any performance benchmarks and improvements related to the changes.
  • Documentation Update: Detail the updates made to the documentation and links to the changed files.

Type of change

  • Documentation update (changes to documentation)
  • Code consistency (non-breaking change which improves code reliability and robustness)

@gaby gaby requested a review from a team as a code owner July 3, 2024 04:11
@gaby gaby requested review from sixcolors, ReneWerner87 and efectn and removed request for a team July 3, 2024 04:11
Copy link
Contributor

coderabbitai bot commented Jul 3, 2024

Walkthrough

The recent updates focus on improving the Fiber library's logging and testing functionalities. Changes to the logging documentation clarify concepts, usage, and configuration. In the benchmark tests, the addition of parallel execution support showcases an effort to enhance the evaluation of logging performance. Updated function names in various benchmark tests ensure better consistency and readability.

Changes

File Change Summary
docs/api/log.md Refined descriptions of logging functionalities, usage, and configuration for better clarity.
log/default_test.go Function Benchmark_LogfKeyAndValuesParallel renamed to Benchmark_LogfKeyAndValues_Parallel.
log/fiberlog_test.go Added new benchmarks for DefaultLogger, SetLogger, and SetLevel with parallel execution support.
middleware/cors/cors_test.go Updated benchmark function names to include underscores for consistency and better readability.

Poem

In Fiber's core where loggers gleam,
Enhancements now with structured theme,
Parallel tests, benchmarks align,
Logging clear in every line.
A rabbit's joy in changes swift,
Makes Fiber's code a sweeter gift.
🌟⚙️📜

Tip

AI model upgrade

gpt-4o model for reviews and chat is now live

OpenAI claims that this model is better at understanding and generating code than the previous models. Please join our Discord Community to provide any feedback or to report any issues.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

codecov bot commented Jul 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.01%. Comparing base (6108475) to head (fd7f315).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3059      +/-   ##
==========================================
- Coverage   83.04%   83.01%   -0.03%     
==========================================
  Files         115      115              
  Lines        8315     8315              
==========================================
- Hits         6905     6903       -2     
- Misses       1077     1078       +1     
- Partials      333      334       +1     
Flag Coverage Δ
unittests 83.01% <ø> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Outside diff range and nitpick comments (3)
docs/api/log.md (3)

Line range hint 83-93: Fix markdown issues.

The changes improve clarity, but there are markdown issues.

- For projects that require a simple, global logging function to print messages at any time, Fiber provides a global log.
+ For projects that require a simple, global logging function to print messages at any time, Fiber provides a global log.

### Global log

Line range hint 116-127: Fix markdown issues.

The changes improve clarity, but there are markdown issues.

- log.SetLevel sets the minimum level of logs that will be output. The default log level is LevelTrace.
+ `log.SetLevel` sets the minimum level of logs that will be output. The default log level is `LevelTrace`.

### Set Level

Line range hint 130-142: Fix markdown issues.

The changes improve clarity, but there are markdown issues.

- log.SetOutput sets the output destination of the logger. By default, the logger outputs logs to the console.
+ `log.SetOutput` sets the output destination of the logger. By default, the logger outputs logs to the console.

### Set output
Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 6108475 and fd7f315.

Files selected for processing (4)
  • docs/api/log.md (10 hunks)
  • log/default_test.go (1 hunks)
  • log/fiberlog_test.go (1 hunks)
  • middleware/cors/cors_test.go (6 hunks)
Files skipped from review due to trivial changes (2)
  • log/default_test.go
  • middleware/cors/cors_test.go
Additional context used
LanguageTool
docs/api/log.md

[grammar] ~47-~47: You’ve repeated a verb. Did you mean to only write one of them?
Context: ... Please use it with caution. ### Basic Logging Logs of different levels can be directly pri...

(REPEATED_VERBS)


[grammar] ~60-~60: You’ve repeated a verb. Did you mean to only write one of them?
Context: ...he system is down.") ``` ### Formatted Logging Logs of different levels can be formatted be...

(REPEATED_VERBS)

Markdownlint
docs/api/log.md

44-44: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines

(MD022, blanks-around-headings)


47-47: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines

(MD022, blanks-around-headings)


60-60: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines

(MD022, blanks-around-headings)


71-71: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines

(MD022, blanks-around-headings)


82-82: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines

(MD022, blanks-around-headings)


115-115: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines

(MD022, blanks-around-headings)

Additional comments not posted (10)
log/fiberlog_test.go (6)

73-79: LGTM!

The Benchmark_DefaultSystemLogger function is correctly implemented.


81-92: LGTM!

The Benchmark_SetLogger function is correctly implemented.


94-140: LGTM!

The Benchmark_Fiberlog_SetLevel function is correctly implemented and covers multiple test cases.


142-150: LGTM!

The Benchmark_DefaultSystemLogger_Parallel function is correctly implemented.


152-165: LGTM!

The Benchmark_SetLogger_Parallel function is correctly implemented.


167-215: LGTM!

The Benchmark_Fiberlog_SetLevel_Parallel function is correctly implemented and covers multiple test cases.

docs/api/log.md (4)

8-10: LGTM!

The introductory changes improve clarity and completeness.


169-176: LGTM!

The changes improve clarity and completeness.


156-166: Fix markdown issues.

The changes improve clarity, but there are markdown issues.

- The following example will write the logs to both test.log and stdout:
+ The following example will write the logs to both `test.log` and `stdout`:

### Writing logs to both console and file

Likely invalid or redundant comment.


71-72: Fix markdown issues.

The changes improve clarity, but there are markdown issues.

- Print a message with key-value pairs. If the key and value are not paired correctly, the log will output KEYVALS UNPAIRED.
+ Print a message with key-value pairs. If the key and value are not paired correctly, the log will output `KEYVALS UNPAIRED`.

### Key-Value Logging

Likely invalid or redundant comment.

Tools
Markdownlint

71-71: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines

(MD022, blanks-around-headings)

docs/api/log.md Show resolved Hide resolved
docs/api/log.md Show resolved Hide resolved
@gaby gaby added this to the v3 milestone Jul 4, 2024
@ReneWerner87 ReneWerner87 merged commit 04528f7 into main Jul 5, 2024
15 of 16 checks passed
@gaby gaby deleted the logger-benchmarks branch July 5, 2024 12:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants