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

Add metrics for WatchDocuments and enhance pushpull metrics #1008

Merged
merged 4 commits into from
Sep 11, 2024

Conversation

emplam27
Copy link
Contributor

@emplam27 emplam27 commented Sep 10, 2024

What this PR does / why we need it:

Add project label and hostname label in pushpull metric

  • Previously, pushpull metrics could not be separated by project and hostname.
  • now, metrics are separated for yorkie dashboard.

Add event count and payload bytes of watch document metric.

  • the event count is increased when client occurred watch document events.
  • the payload bytes is increased when client occurred watch document events especially broadcast event.
  • all metrics is labeled by project info, hostname and doc event type.

Which issue(s) this PR fixes:

Address #984

Special notes for your reviewer:

Does this PR introduce a user-facing change?:


Additional documentation:


Checklist:

  • Added relevant tests or not required
  • Didn't break anything

Summary by CodeRabbit

  • New Features

    • Introduced a method to easily retrieve the length of the payload in document events.
    • Enhanced metrics tracking for document events, including new methods for monitoring payload sizes.
  • Improvements

    • Improved metrics logging with additional context (hostname and project) for better analysis.
    • Enhanced clarity and context management in document watching functionalities.
  • Bug Fixes

    • Refined response handling in document watching to improve readability and debugging.

- the event count is increased when client occurred watch document events.
- the payload bytes is increased when client occurred watch document events especially broadcast event.
- all metrics is labeled by project info, hostname and doc event type.
@emplam27 emplam27 self-assigned this Sep 10, 2024
Copy link

coderabbitai bot commented Sep 10, 2024

Caution

Review failed

The pull request is closed.

Walkthrough

The pull request introduces enhancements to metrics tracking and functionality within the server's document handling and event processing systems. Key changes include the addition of a new method for calculating payload lengths, improved metrics logging with contextual parameters, and the introduction of new labels for Prometheus metrics. These modifications provide better tracking and analysis of document events and operations, facilitating improved monitoring capabilities.

Changes

File Path Change Summary
api/types/event.go Added PayloadLen method to DocEventBody struct to calculate payload length.
server/packs/packs.go Modified PushPull function metrics to include hostname and project parameters for tracking.
server/profiling/prometheus/metrics.go Updated Metrics struct to use CounterVec for enhanced labeling; added new metrics for document events.
server/rpc/yorkie_server.go Renamed connection metrics methods and modified unwatchDoc to accept context.Context.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant Server
    participant Metrics

    Client->>Server: Request document watch
    Server->>Metrics: AddWatchDocumentConnections(hostname, project)
    Metrics-->>Server: Acknowledge tracking
    Server-->>Client: Send watch response

    Client->>Server: Request document unwatch
    Server->>Metrics: RemoveWatchDocumentConnections(hostname, project)
    Metrics-->>Server: Acknowledge removal
    Server-->>Client: Send unwatch response
Loading

🐇 In the meadow where rabbits play,
New metrics hop in, brightening the day.
Payloads measured, events in sight,
Tracking our changes, all feels just right!
With each little hop, our data will grow,
In the world of metrics, we’ll steal the show! 🌼


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 using 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.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration 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

@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: 0

Outside diff range, codebase verification and nitpick comments (4)
server/profiling/prometheus/metrics.go (1)

364-379: LGTM, but address the long line issue.

The code changes are approved.

The AddWatchDocumentEventPayloadBytes function enhances the ability to categorize and filter metrics based on the hostname, project, and docEventType labels, providing more detailed tracking of event payload bytes in document watch stream connections.

However, please address the long line issue flagged by the static analysis tool at line 365 to improve code readability. Consider breaking the line into multiple lines or extracting the labels into a separate variable.

Tools
golangci-lint

365-365: line is 138 characters

(lll)

server/rpc/yorkie_server.go (3)

Line range hint 433-483: Metrics changes LGTM! Refactor the long line.

The changes related to metrics tracking, such as renaming the methods to plural forms (AddWatchDocumentConnections, RemoveWatchDocumentConnections) and adding new metrics (AddWatchDocumentEventPayloadBytes), are improvements that provide better insights into the system's performance.

However, line 483 exceeds the line length limit. Please refactor it to improve readability.

-s.backend.Metrics.AddWatchDocumentEventPayloadBytes(s.backend.Config.Hostname, project, event.Type, event.Body.PayloadLen())
+s.backend.Metrics.AddWatchDocumentEventPayloadBytes(
+    s.backend.Config.Hostname,
+    project,
+    event.Type,
+    event.Body.PayloadLen(),
+)

586-586: Refactor the long line.

Line 586 exceeds the line length limit. Please refactor it to improve readability.

-s.backend.Metrics.AddWatchDocumentEventPayloadBytes(s.backend.Config.Hostname, projects.From(ctx), types.DocumentWatchedEvent, 0)
+s.backend.Metrics.AddWatchDocumentEventPayloadBytes(
+    s.backend.Config.Hostname,
+    projects.From(ctx),
+    types.DocumentWatchedEvent,
+    0,
+)
Tools
golangci-lint

586-586: line is 130 characters

(lll)


Line range hint 659-673: Metrics changes LGTM! Refactor the long line.

The changes related to metrics tracking, such as adding new metrics (AddWatchDocumentEventPayloadBytes), are improvements that provide better insights into the system's performance.

However, line 673 exceeds the line length limit. Please refactor it to improve readability.

-s.backend.Metrics.AddWatchDocumentEventPayloadBytes(s.backend.Config.Hostname, project, docEventType, len(req.Msg.Payload))
+s.backend.Metrics.AddWatchDocumentEventPayloadBytes(
+    s.backend.Config.Hostname,
+    project,
+    docEventType,
+    len(req.Msg.Payload),
+)
Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 3e49afb and 874ef57.

Files selected for processing (4)
  • api/types/event.go (1 hunks)
  • server/packs/packs.go (1 hunks)
  • server/profiling/prometheus/metrics.go (7 hunks)
  • server/rpc/yorkie_server.go (7 hunks)
Additional context used
golangci-lint
server/profiling/prometheus/metrics.go

365-365: line is 138 characters

(lll)

server/rpc/yorkie_server.go

483-483: line is 127 characters

(lll)


586-586: line is 130 characters

(lll)


611-611: line is 132 characters

(lll)


673-673: line is 124 characters

(lll)

Additional comments not posted (12)
api/types/event.go (1)

31-32: LGTM!

The code changes are approved.

server/packs/packs.go (1)

84-85: LGTM!

The code changes are approved.

The addition of hostname and project parameters to the metrics methods enhances the ability to categorize and filter metrics based on these labels, providing more detailed tracking of metrics associated with specific projects and hostnames.

Also applies to: 93-94, 106-114, 116-125, 126-135, 137-146, 154-162

server/profiling/prometheus/metrics.go (9)

59-65: LGTM!

The code changes are approved.

The updates to the Metrics struct, including the replacement of several existing prometheus.Counter types with prometheus.CounterVec and the addition of new fields for tracking document watch events, enhance the metrics' capability to provide insights into the system's performance and behavior by allowing for more detailed categorization and tracking of events and operations.

Also applies to: 68-70, 106-125, 126-135, 137-146, 154-162, 193-214


232-237: LGTM!

The code changes are approved.

The addition of hostname and project parameters to the AddPushPullReceivedChanges function enhances the ability to categorize and filter metrics based on these labels, providing more detailed tracking of metrics associated with specific projects and hostnames.


242-247: LGTM!

The code changes are approved.

The addition of hostname and project parameters to the AddPushPullSentChanges function enhances the ability to categorize and filter metrics based on these labels, providing more detailed tracking of metrics associated with specific projects and hostnames.


252-257: LGTM!

The code changes are approved.

The addition of hostname and project parameters to the AddPushPullReceivedOperations function enhances the ability to categorize and filter metrics based on these labels, providing more detailed tracking of metrics associated with specific projects and hostnames.


262-267: LGTM!

The code changes are approved.

The addition of hostname and project parameters to the AddPushPullSentOperations function enhances the ability to categorize and filter metrics based on these labels, providing more detailed tracking of metrics associated with specific projects and hostnames.


277-282: LGTM!

The code changes are approved.

The addition of hostname and project parameters to the AddPushPullSnapshotBytes function enhances the ability to categorize and filter metrics based on these labels, providing more detailed tracking of metrics associated with specific projects and hostnames.


336-342: LGTM!

The code changes are approved.

The addition of hostname and project parameters to the AddWatchDocumentConnections function enhances the ability to categorize and filter metrics based on these labels, providing more detailed tracking of metrics associated with specific projects and hostnames.


345-352: LGTM!

The code changes are approved.

The addition of hostname and project parameters to the RemoveWatchDocumentConnections function enhances the ability to categorize and filter metrics based on these labels, providing more detailed tracking of metrics associated with specific projects and hostnames.


354-362: LGTM!

The code changes are approved.

The AddWatchDocumentEvents function enhances the ability to categorize and filter metrics based on the hostname, project, and docEventType labels, providing more detailed tracking of events in document watch stream connections.

server/rpc/yorkie_server.go (1)

592-595: LGTM!

The addition of the context.Context parameter to the unwatchDoc function is an improvement as it allows for better context propagation and cancellation.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Go Benchmark

Benchmark suite Current: 46bcc1a Previous: 874ef57 Ratio
BenchmarkDocument/constructor_test 1501 ns/op 1337 B/op 24 allocs/op 1502 ns/op 1337 B/op 24 allocs/op 1.00
BenchmarkDocument/constructor_test - ns/op 1501 ns/op 1502 ns/op 1.00
BenchmarkDocument/constructor_test - B/op 1337 B/op 1337 B/op 1
BenchmarkDocument/constructor_test - allocs/op 24 allocs/op 24 allocs/op 1
BenchmarkDocument/status_test 1117 ns/op 1305 B/op 22 allocs/op 958.6 ns/op 1305 B/op 22 allocs/op 1.17
BenchmarkDocument/status_test - ns/op 1117 ns/op 958.6 ns/op 1.17
BenchmarkDocument/status_test - B/op 1305 B/op 1305 B/op 1
BenchmarkDocument/status_test - allocs/op 22 allocs/op 22 allocs/op 1
BenchmarkDocument/equals_test 7630 ns/op 7273 B/op 132 allocs/op 8839 ns/op 7273 B/op 132 allocs/op 0.86
BenchmarkDocument/equals_test - ns/op 7630 ns/op 8839 ns/op 0.86
BenchmarkDocument/equals_test - B/op 7273 B/op 7273 B/op 1
BenchmarkDocument/equals_test - allocs/op 132 allocs/op 132 allocs/op 1
BenchmarkDocument/nested_update_test 16688 ns/op 12138 B/op 262 allocs/op 16836 ns/op 12139 B/op 262 allocs/op 0.99
BenchmarkDocument/nested_update_test - ns/op 16688 ns/op 16836 ns/op 0.99
BenchmarkDocument/nested_update_test - B/op 12138 B/op 12139 B/op 1.00
BenchmarkDocument/nested_update_test - allocs/op 262 allocs/op 262 allocs/op 1
BenchmarkDocument/delete_test 22342 ns/op 15363 B/op 341 allocs/op 22791 ns/op 15363 B/op 341 allocs/op 0.98
BenchmarkDocument/delete_test - ns/op 22342 ns/op 22791 ns/op 0.98
BenchmarkDocument/delete_test - B/op 15363 B/op 15363 B/op 1
BenchmarkDocument/delete_test - allocs/op 341 allocs/op 341 allocs/op 1
BenchmarkDocument/object_test 8559 ns/op 6817 B/op 120 allocs/op 8679 ns/op 6817 B/op 120 allocs/op 0.99
BenchmarkDocument/object_test - ns/op 8559 ns/op 8679 ns/op 0.99
BenchmarkDocument/object_test - B/op 6817 B/op 6817 B/op 1
BenchmarkDocument/object_test - allocs/op 120 allocs/op 120 allocs/op 1
BenchmarkDocument/array_test 29008 ns/op 11946 B/op 276 allocs/op 29192 ns/op 11946 B/op 276 allocs/op 0.99
BenchmarkDocument/array_test - ns/op 29008 ns/op 29192 ns/op 0.99
BenchmarkDocument/array_test - B/op 11946 B/op 11946 B/op 1
BenchmarkDocument/array_test - allocs/op 276 allocs/op 276 allocs/op 1
BenchmarkDocument/text_test 30481 ns/op 14715 B/op 469 allocs/op 30685 ns/op 14715 B/op 469 allocs/op 0.99
BenchmarkDocument/text_test - ns/op 30481 ns/op 30685 ns/op 0.99
BenchmarkDocument/text_test - B/op 14715 B/op 14715 B/op 1
BenchmarkDocument/text_test - allocs/op 469 allocs/op 469 allocs/op 1
BenchmarkDocument/text_composition_test 28878 ns/op 18422 B/op 484 allocs/op 28800 ns/op 18422 B/op 484 allocs/op 1.00
BenchmarkDocument/text_composition_test - ns/op 28878 ns/op 28800 ns/op 1.00
BenchmarkDocument/text_composition_test - B/op 18422 B/op 18422 B/op 1
BenchmarkDocument/text_composition_test - allocs/op 484 allocs/op 484 allocs/op 1
BenchmarkDocument/rich_text_test 80580 ns/op 38476 B/op 1148 allocs/op 81024 ns/op 38476 B/op 1148 allocs/op 0.99
BenchmarkDocument/rich_text_test - ns/op 80580 ns/op 81024 ns/op 0.99
BenchmarkDocument/rich_text_test - B/op 38476 B/op 38476 B/op 1
BenchmarkDocument/rich_text_test - allocs/op 1148 allocs/op 1148 allocs/op 1
BenchmarkDocument/counter_test 17482 ns/op 10722 B/op 244 allocs/op 17798 ns/op 10722 B/op 244 allocs/op 0.98
BenchmarkDocument/counter_test - ns/op 17482 ns/op 17798 ns/op 0.98
BenchmarkDocument/counter_test - B/op 10722 B/op 10722 B/op 1
BenchmarkDocument/counter_test - allocs/op 244 allocs/op 244 allocs/op 1
BenchmarkDocument/text_edit_gc_100 1275598 ns/op 870962 B/op 16753 allocs/op 1285570 ns/op 870949 B/op 16752 allocs/op 0.99
BenchmarkDocument/text_edit_gc_100 - ns/op 1275598 ns/op 1285570 ns/op 0.99
BenchmarkDocument/text_edit_gc_100 - B/op 870962 B/op 870949 B/op 1.00
BenchmarkDocument/text_edit_gc_100 - allocs/op 16753 allocs/op 16752 allocs/op 1.00
BenchmarkDocument/text_edit_gc_1000 49517633 ns/op 50535490 B/op 181710 allocs/op 49792580 ns/op 50536338 B/op 181710 allocs/op 0.99
BenchmarkDocument/text_edit_gc_1000 - ns/op 49517633 ns/op 49792580 ns/op 0.99
BenchmarkDocument/text_edit_gc_1000 - B/op 50535490 B/op 50536338 B/op 1.00
BenchmarkDocument/text_edit_gc_1000 - allocs/op 181710 allocs/op 181710 allocs/op 1
BenchmarkDocument/text_split_gc_100 1893091 ns/op 1528808 B/op 15605 allocs/op 1863562 ns/op 1528819 B/op 15604 allocs/op 1.02
BenchmarkDocument/text_split_gc_100 - ns/op 1893091 ns/op 1863562 ns/op 1.02
BenchmarkDocument/text_split_gc_100 - B/op 1528808 B/op 1528819 B/op 1.00
BenchmarkDocument/text_split_gc_100 - allocs/op 15605 allocs/op 15604 allocs/op 1.00
BenchmarkDocument/text_split_gc_1000 111081221 ns/op 135076795 B/op 182185 allocs/op 111342303 ns/op 135077881 B/op 182206 allocs/op 1.00
BenchmarkDocument/text_split_gc_1000 - ns/op 111081221 ns/op 111342303 ns/op 1.00
BenchmarkDocument/text_split_gc_1000 - B/op 135076795 B/op 135077881 B/op 1.00
BenchmarkDocument/text_split_gc_1000 - allocs/op 182185 allocs/op 182206 allocs/op 1.00
BenchmarkDocument/text_delete_all_10000 16237859 ns/op 10182113 B/op 40673 allocs/op 16086684 ns/op 10183904 B/op 40679 allocs/op 1.01
BenchmarkDocument/text_delete_all_10000 - ns/op 16237859 ns/op 16086684 ns/op 1.01
BenchmarkDocument/text_delete_all_10000 - B/op 10182113 B/op 10183904 B/op 1.00
BenchmarkDocument/text_delete_all_10000 - allocs/op 40673 allocs/op 40679 allocs/op 1.00
BenchmarkDocument/text_delete_all_100000 298504322 ns/op 142683036 B/op 411708 allocs/op 287158914 ns/op 142677448 B/op 411669 allocs/op 1.04
BenchmarkDocument/text_delete_all_100000 - ns/op 298504322 ns/op 287158914 ns/op 1.04
BenchmarkDocument/text_delete_all_100000 - B/op 142683036 B/op 142677448 B/op 1.00
BenchmarkDocument/text_delete_all_100000 - allocs/op 411708 allocs/op 411669 allocs/op 1.00
BenchmarkDocument/text_100 222684 ns/op 120037 B/op 5081 allocs/op 216529 ns/op 120037 B/op 5081 allocs/op 1.03
BenchmarkDocument/text_100 - ns/op 222684 ns/op 216529 ns/op 1.03
BenchmarkDocument/text_100 - B/op 120037 B/op 120037 B/op 1
BenchmarkDocument/text_100 - allocs/op 5081 allocs/op 5081 allocs/op 1
BenchmarkDocument/text_1000 2395237 ns/op 1169026 B/op 50085 allocs/op 2347773 ns/op 1169023 B/op 50085 allocs/op 1.02
BenchmarkDocument/text_1000 - ns/op 2395237 ns/op 2347773 ns/op 1.02
BenchmarkDocument/text_1000 - B/op 1169026 B/op 1169023 B/op 1.00
BenchmarkDocument/text_1000 - allocs/op 50085 allocs/op 50085 allocs/op 1
BenchmarkDocument/array_1000 1266275 ns/op 1091393 B/op 11832 allocs/op 1256686 ns/op 1091453 B/op 11832 allocs/op 1.01
BenchmarkDocument/array_1000 - ns/op 1266275 ns/op 1256686 ns/op 1.01
BenchmarkDocument/array_1000 - B/op 1091393 B/op 1091453 B/op 1.00
BenchmarkDocument/array_1000 - allocs/op 11832 allocs/op 11832 allocs/op 1
BenchmarkDocument/array_10000 13141617 ns/op 9800379 B/op 120299 allocs/op 13254373 ns/op 9799926 B/op 120296 allocs/op 0.99
BenchmarkDocument/array_10000 - ns/op 13141617 ns/op 13254373 ns/op 0.99
BenchmarkDocument/array_10000 - B/op 9800379 B/op 9799926 B/op 1.00
BenchmarkDocument/array_10000 - allocs/op 120299 allocs/op 120296 allocs/op 1.00
BenchmarkDocument/array_gc_100 154913 ns/op 132700 B/op 1260 allocs/op 154990 ns/op 132728 B/op 1261 allocs/op 1.00
BenchmarkDocument/array_gc_100 - ns/op 154913 ns/op 154990 ns/op 1.00
BenchmarkDocument/array_gc_100 - B/op 132700 B/op 132728 B/op 1.00
BenchmarkDocument/array_gc_100 - allocs/op 1260 allocs/op 1261 allocs/op 1.00
BenchmarkDocument/array_gc_1000 1451383 ns/op 1159141 B/op 12877 allocs/op 1457162 ns/op 1159141 B/op 12876 allocs/op 1.00
BenchmarkDocument/array_gc_1000 - ns/op 1451383 ns/op 1457162 ns/op 1.00
BenchmarkDocument/array_gc_1000 - B/op 1159141 B/op 1159141 B/op 1
BenchmarkDocument/array_gc_1000 - allocs/op 12877 allocs/op 12876 allocs/op 1.00
BenchmarkDocument/counter_1000 210526 ns/op 193081 B/op 5771 allocs/op 208931 ns/op 193081 B/op 5771 allocs/op 1.01
BenchmarkDocument/counter_1000 - ns/op 210526 ns/op 208931 ns/op 1.01
BenchmarkDocument/counter_1000 - B/op 193081 B/op 193081 B/op 1
BenchmarkDocument/counter_1000 - allocs/op 5771 allocs/op 5771 allocs/op 1
BenchmarkDocument/counter_10000 2197500 ns/op 2087981 B/op 59778 allocs/op 2196593 ns/op 2087996 B/op 59778 allocs/op 1.00
BenchmarkDocument/counter_10000 - ns/op 2197500 ns/op 2196593 ns/op 1.00
BenchmarkDocument/counter_10000 - B/op 2087981 B/op 2087996 B/op 1.00
BenchmarkDocument/counter_10000 - allocs/op 59778 allocs/op 59778 allocs/op 1
BenchmarkDocument/object_1000 1457120 ns/op 1428142 B/op 9849 allocs/op 1445136 ns/op 1428118 B/op 9849 allocs/op 1.01
BenchmarkDocument/object_1000 - ns/op 1457120 ns/op 1445136 ns/op 1.01
BenchmarkDocument/object_1000 - B/op 1428142 B/op 1428118 B/op 1.00
BenchmarkDocument/object_1000 - allocs/op 9849 allocs/op 9849 allocs/op 1
BenchmarkDocument/object_10000 15437380 ns/op 12168409 B/op 100568 allocs/op 15229325 ns/op 12167169 B/op 100566 allocs/op 1.01
BenchmarkDocument/object_10000 - ns/op 15437380 ns/op 15229325 ns/op 1.01
BenchmarkDocument/object_10000 - B/op 12168409 B/op 12167169 B/op 1.00
BenchmarkDocument/object_10000 - allocs/op 100568 allocs/op 100566 allocs/op 1.00
BenchmarkDocument/tree_100 1061066 ns/op 943702 B/op 6101 allocs/op 1036989 ns/op 943702 B/op 6101 allocs/op 1.02
BenchmarkDocument/tree_100 - ns/op 1061066 ns/op 1036989 ns/op 1.02
BenchmarkDocument/tree_100 - B/op 943702 B/op 943702 B/op 1
BenchmarkDocument/tree_100 - allocs/op 6101 allocs/op 6101 allocs/op 1
BenchmarkDocument/tree_1000 78862637 ns/op 86460444 B/op 60115 allocs/op 75935430 ns/op 86460380 B/op 60115 allocs/op 1.04
BenchmarkDocument/tree_1000 - ns/op 78862637 ns/op 75935430 ns/op 1.04
BenchmarkDocument/tree_1000 - B/op 86460444 B/op 86460380 B/op 1.00
BenchmarkDocument/tree_1000 - allocs/op 60115 allocs/op 60115 allocs/op 1
BenchmarkDocument/tree_10000 9654353082 ns/op 8580667584 B/op 600211 allocs/op 9453226510 ns/op 8580660272 B/op 600206 allocs/op 1.02
BenchmarkDocument/tree_10000 - ns/op 9654353082 ns/op 9453226510 ns/op 1.02
BenchmarkDocument/tree_10000 - B/op 8580667584 B/op 8580660272 B/op 1.00
BenchmarkDocument/tree_10000 - allocs/op 600211 allocs/op 600206 allocs/op 1.00
BenchmarkDocument/tree_delete_all_1000 79258738 ns/op 87510466 B/op 75266 allocs/op 77686870 ns/op 87511005 B/op 75267 allocs/op 1.02
BenchmarkDocument/tree_delete_all_1000 - ns/op 79258738 ns/op 77686870 ns/op 1.02
BenchmarkDocument/tree_delete_all_1000 - B/op 87510466 B/op 87511005 B/op 1.00
BenchmarkDocument/tree_delete_all_1000 - allocs/op 75266 allocs/op 75267 allocs/op 1.00
BenchmarkDocument/tree_edit_gc_100 4001902 ns/op 4146923 B/op 15141 allocs/op 3854048 ns/op 4147807 B/op 15141 allocs/op 1.04
BenchmarkDocument/tree_edit_gc_100 - ns/op 4001902 ns/op 3854048 ns/op 1.04
BenchmarkDocument/tree_edit_gc_100 - B/op 4146923 B/op 4147807 B/op 1.00
BenchmarkDocument/tree_edit_gc_100 - allocs/op 15141 allocs/op 15141 allocs/op 1
BenchmarkDocument/tree_edit_gc_1000 319633478 ns/op 383746726 B/op 154869 allocs/op 308716340 ns/op 383747112 B/op 154859 allocs/op 1.04
BenchmarkDocument/tree_edit_gc_1000 - ns/op 319633478 ns/op 308716340 ns/op 1.04
BenchmarkDocument/tree_edit_gc_1000 - B/op 383746726 B/op 383747112 B/op 1.00
BenchmarkDocument/tree_edit_gc_1000 - allocs/op 154869 allocs/op 154859 allocs/op 1.00
BenchmarkDocument/tree_split_gc_100 2644884 ns/op 2412591 B/op 11125 allocs/op 2564905 ns/op 2412509 B/op 11125 allocs/op 1.03
BenchmarkDocument/tree_split_gc_100 - ns/op 2644884 ns/op 2564905 ns/op 1.03
BenchmarkDocument/tree_split_gc_100 - B/op 2412591 B/op 2412509 B/op 1.00
BenchmarkDocument/tree_split_gc_100 - allocs/op 11125 allocs/op 11125 allocs/op 1
BenchmarkDocument/tree_split_gc_1000 194517648 ns/op 222251421 B/op 122004 allocs/op 185618715 ns/op 222249102 B/op 121990 allocs/op 1.05
BenchmarkDocument/tree_split_gc_1000 - ns/op 194517648 ns/op 185618715 ns/op 1.05
BenchmarkDocument/tree_split_gc_1000 - B/op 222251421 B/op 222249102 B/op 1.00
BenchmarkDocument/tree_split_gc_1000 - allocs/op 122004 allocs/op 121990 allocs/op 1.00
BenchmarkRPC/client_to_server 346546897 ns/op 17682816 B/op 169231 allocs/op 348103783 ns/op 16593624 B/op 169202 allocs/op 1.00
BenchmarkRPC/client_to_server - ns/op 346546897 ns/op 348103783 ns/op 1.00
BenchmarkRPC/client_to_server - B/op 17682816 B/op 16593624 B/op 1.07
BenchmarkRPC/client_to_server - allocs/op 169231 allocs/op 169202 allocs/op 1.00
BenchmarkRPC/client_to_client_via_server 632995776 ns/op 32378312 B/op 324161 allocs/op 640784350 ns/op 34045184 B/op 324561 allocs/op 0.99
BenchmarkRPC/client_to_client_via_server - ns/op 632995776 ns/op 640784350 ns/op 0.99
BenchmarkRPC/client_to_client_via_server - B/op 32378312 B/op 34045184 B/op 0.95
BenchmarkRPC/client_to_client_via_server - allocs/op 324161 allocs/op 324561 allocs/op 1.00
BenchmarkRPC/attach_large_document 1335032167 ns/op 1896314792 B/op 8840 allocs/op 1370152717 ns/op 1919873608 B/op 8873 allocs/op 0.97
BenchmarkRPC/attach_large_document - ns/op 1335032167 ns/op 1370152717 ns/op 0.97
BenchmarkRPC/attach_large_document - B/op 1896314792 B/op 1919873608 B/op 0.99
BenchmarkRPC/attach_large_document - allocs/op 8840 allocs/op 8873 allocs/op 1.00
BenchmarkRPC/adminCli_to_server 559986852 ns/op 35966724 B/op 289549 allocs/op 550455462 ns/op 35966036 B/op 289555 allocs/op 1.02
BenchmarkRPC/adminCli_to_server - ns/op 559986852 ns/op 550455462 ns/op 1.02
BenchmarkRPC/adminCli_to_server - B/op 35966724 B/op 35966036 B/op 1.00
BenchmarkRPC/adminCli_to_server - allocs/op 289549 allocs/op 289555 allocs/op 1.00
BenchmarkLocker 64.1 ns/op 16 B/op 1 allocs/op 64.39 ns/op 16 B/op 1 allocs/op 1.00
BenchmarkLocker - ns/op 64.1 ns/op 64.39 ns/op 1.00
BenchmarkLocker - B/op 16 B/op 16 B/op 1
BenchmarkLocker - allocs/op 1 allocs/op 1 allocs/op 1
BenchmarkLockerParallel 39.24 ns/op 0 B/op 0 allocs/op 39.31 ns/op 0 B/op 0 allocs/op 1.00
BenchmarkLockerParallel - ns/op 39.24 ns/op 39.31 ns/op 1.00
BenchmarkLockerParallel - B/op 0 B/op 0 B/op 1
BenchmarkLockerParallel - allocs/op 0 allocs/op 0 allocs/op 1
BenchmarkLockerMoreKeys 155 ns/op 15 B/op 0 allocs/op 145.3 ns/op 15 B/op 0 allocs/op 1.07
BenchmarkLockerMoreKeys - ns/op 155 ns/op 145.3 ns/op 1.07
BenchmarkLockerMoreKeys - B/op 15 B/op 15 B/op 1
BenchmarkLockerMoreKeys - allocs/op 0 allocs/op 0 allocs/op 1
BenchmarkChange/Push_10_Changes 3636127 ns/op 118047 B/op 1215 allocs/op 3644411 ns/op 118236 B/op 1215 allocs/op 1.00
BenchmarkChange/Push_10_Changes - ns/op 3636127 ns/op 3644411 ns/op 1.00
BenchmarkChange/Push_10_Changes - B/op 118047 B/op 118236 B/op 1.00
BenchmarkChange/Push_10_Changes - allocs/op 1215 allocs/op 1215 allocs/op 1
BenchmarkChange/Push_100_Changes 14395672 ns/op 571450 B/op 6586 allocs/op 14303508 ns/op 570143 B/op 6585 allocs/op 1.01
BenchmarkChange/Push_100_Changes - ns/op 14395672 ns/op 14303508 ns/op 1.01
BenchmarkChange/Push_100_Changes - B/op 571450 B/op 570143 B/op 1.00
BenchmarkChange/Push_100_Changes - allocs/op 6586 allocs/op 6585 allocs/op 1.00
BenchmarkChange/Push_1000_Changes 117055777 ns/op 5316742 B/op 63078 allocs/op 116977747 ns/op 5347681 B/op 63079 allocs/op 1.00
BenchmarkChange/Push_1000_Changes - ns/op 117055777 ns/op 116977747 ns/op 1.00
BenchmarkChange/Push_1000_Changes - B/op 5316742 B/op 5347681 B/op 0.99
BenchmarkChange/Push_1000_Changes - allocs/op 63078 allocs/op 63079 allocs/op 1.00
BenchmarkChange/Pull_10_Changes 2944019 ns/op 103116 B/op 1018 allocs/op 2984957 ns/op 102883 B/op 1018 allocs/op 0.99
BenchmarkChange/Pull_10_Changes - ns/op 2944019 ns/op 2984957 ns/op 0.99
BenchmarkChange/Pull_10_Changes - B/op 103116 B/op 102883 B/op 1.00
BenchmarkChange/Pull_10_Changes - allocs/op 1018 allocs/op 1018 allocs/op 1
BenchmarkChange/Pull_100_Changes 4414220 ns/op 268228 B/op 3489 allocs/op 4420783 ns/op 267850 B/op 3489 allocs/op 1.00
BenchmarkChange/Pull_100_Changes - ns/op 4414220 ns/op 4420783 ns/op 1.00
BenchmarkChange/Pull_100_Changes - B/op 268228 B/op 267850 B/op 1.00
BenchmarkChange/Pull_100_Changes - allocs/op 3489 allocs/op 3489 allocs/op 1
BenchmarkChange/Pull_1000_Changes 8774972 ns/op 1495487 B/op 29869 allocs/op 8851407 ns/op 1492198 B/op 29862 allocs/op 0.99
BenchmarkChange/Pull_1000_Changes - ns/op 8774972 ns/op 8851407 ns/op 0.99
BenchmarkChange/Pull_1000_Changes - B/op 1495487 B/op 1492198 B/op 1.00
BenchmarkChange/Pull_1000_Changes - allocs/op 29869 allocs/op 29862 allocs/op 1.00
BenchmarkSnapshot/Push_3KB_snapshot 16840450 ns/op 714586 B/op 6587 allocs/op 17085850 ns/op 713215 B/op 6588 allocs/op 0.99
BenchmarkSnapshot/Push_3KB_snapshot - ns/op 16840450 ns/op 17085850 ns/op 0.99
BenchmarkSnapshot/Push_3KB_snapshot - B/op 714586 B/op 713215 B/op 1.00
BenchmarkSnapshot/Push_3KB_snapshot - allocs/op 6587 allocs/op 6588 allocs/op 1.00
BenchmarkSnapshot/Push_30KB_snapshot 119953178 ns/op 5561765 B/op 63078 allocs/op 121177145 ns/op 5655982 B/op 63082 allocs/op 0.99
BenchmarkSnapshot/Push_30KB_snapshot - ns/op 119953178 ns/op 121177145 ns/op 0.99
BenchmarkSnapshot/Push_30KB_snapshot - B/op 5561765 B/op 5655982 B/op 0.98
BenchmarkSnapshot/Push_30KB_snapshot - allocs/op 63078 allocs/op 63082 allocs/op 1.00
BenchmarkSnapshot/Pull_3KB_snapshot 6503603 ns/op 923963 B/op 15524 allocs/op 6520531 ns/op 923461 B/op 15525 allocs/op 1.00
BenchmarkSnapshot/Pull_3KB_snapshot - ns/op 6503603 ns/op 6520531 ns/op 1.00
BenchmarkSnapshot/Pull_3KB_snapshot - B/op 923963 B/op 923461 B/op 1.00
BenchmarkSnapshot/Pull_3KB_snapshot - allocs/op 15524 allocs/op 15525 allocs/op 1.00
BenchmarkSnapshot/Pull_30KB_snapshot 15200430 ns/op 7157662 B/op 150116 allocs/op 15256779 ns/op 7157880 B/op 150120 allocs/op 1.00
BenchmarkSnapshot/Pull_30KB_snapshot - ns/op 15200430 ns/op 15256779 ns/op 1.00
BenchmarkSnapshot/Pull_30KB_snapshot - B/op 7157662 B/op 7157880 B/op 1.00
BenchmarkSnapshot/Pull_30KB_snapshot - allocs/op 150116 allocs/op 150120 allocs/op 1.00
BenchmarkSync/memory_sync_10_test 7938 ns/op 1286 B/op 38 allocs/op 6900 ns/op 1286 B/op 38 allocs/op 1.15
BenchmarkSync/memory_sync_10_test - ns/op 7938 ns/op 6900 ns/op 1.15
BenchmarkSync/memory_sync_10_test - B/op 1286 B/op 1286 B/op 1
BenchmarkSync/memory_sync_10_test - allocs/op 38 allocs/op 38 allocs/op 1
BenchmarkSync/memory_sync_100_test 49443 ns/op 9013 B/op 296 allocs/op 51321 ns/op 8642 B/op 273 allocs/op 0.96
BenchmarkSync/memory_sync_100_test - ns/op 49443 ns/op 51321 ns/op 0.96
BenchmarkSync/memory_sync_100_test - B/op 9013 B/op 8642 B/op 1.04
BenchmarkSync/memory_sync_100_test - allocs/op 296 allocs/op 273 allocs/op 1.08
BenchmarkSync/memory_sync_1000_test 554778 ns/op 75699 B/op 2207 allocs/op 590747 ns/op 73993 B/op 2098 allocs/op 0.94
BenchmarkSync/memory_sync_1000_test - ns/op 554778 ns/op 590747 ns/op 0.94
BenchmarkSync/memory_sync_1000_test - B/op 75699 B/op 73993 B/op 1.02
BenchmarkSync/memory_sync_1000_test - allocs/op 2207 allocs/op 2098 allocs/op 1.05
BenchmarkSync/memory_sync_10000_test 7302172 ns/op 737633 B/op 20285 allocs/op 7250593 ns/op 746753 B/op 20441 allocs/op 1.01
BenchmarkSync/memory_sync_10000_test - ns/op 7302172 ns/op 7250593 ns/op 1.01
BenchmarkSync/memory_sync_10000_test - B/op 737633 B/op 746753 B/op 0.99
BenchmarkSync/memory_sync_10000_test - allocs/op 20285 allocs/op 20441 allocs/op 0.99
BenchmarkTextEditing 5182335820 ns/op 3901898224 B/op 18743133 allocs/op 5286678476 ns/op 3901937088 B/op 18743228 allocs/op 0.98
BenchmarkTextEditing - ns/op 5182335820 ns/op 5286678476 ns/op 0.98
BenchmarkTextEditing - B/op 3901898224 B/op 3901937088 B/op 1.00
BenchmarkTextEditing - allocs/op 18743133 allocs/op 18743228 allocs/op 1.00
BenchmarkTree/10000_vertices_to_protobuf 3434955 ns/op 6262996 B/op 70025 allocs/op 3666561 ns/op 6262996 B/op 70025 allocs/op 0.94
BenchmarkTree/10000_vertices_to_protobuf - ns/op 3434955 ns/op 3666561 ns/op 0.94
BenchmarkTree/10000_vertices_to_protobuf - B/op 6262996 B/op 6262996 B/op 1
BenchmarkTree/10000_vertices_to_protobuf - allocs/op 70025 allocs/op 70025 allocs/op 1
BenchmarkTree/10000_vertices_from_protobuf 153323836 ns/op 442171650 B/op 290052 allocs/op 161253482 ns/op 442172638 B/op 290039 allocs/op 0.95
BenchmarkTree/10000_vertices_from_protobuf - ns/op 153323836 ns/op 161253482 ns/op 0.95
BenchmarkTree/10000_vertices_from_protobuf - B/op 442171650 B/op 442172638 B/op 1.00
BenchmarkTree/10000_vertices_from_protobuf - allocs/op 290052 allocs/op 290039 allocs/op 1.00
BenchmarkTree/20000_vertices_to_protobuf 7866777 ns/op 12716975 B/op 140028 allocs/op 7816492 ns/op 12716918 B/op 140028 allocs/op 1.01
BenchmarkTree/20000_vertices_to_protobuf - ns/op 7866777 ns/op 7816492 ns/op 1.01
BenchmarkTree/20000_vertices_to_protobuf - B/op 12716975 B/op 12716918 B/op 1.00
BenchmarkTree/20000_vertices_to_protobuf - allocs/op 140028 allocs/op 140028 allocs/op 1
BenchmarkTree/20000_vertices_from_protobuf 700103595 ns/op 1697272344 B/op 580088 allocs/op 689704450 ns/op 1697271976 B/op 580043 allocs/op 1.02
BenchmarkTree/20000_vertices_from_protobuf - ns/op 700103595 ns/op 689704450 ns/op 1.02
BenchmarkTree/20000_vertices_from_protobuf - B/op 1697272344 B/op 1697271976 B/op 1.00
BenchmarkTree/20000_vertices_from_protobuf - allocs/op 580088 allocs/op 580043 allocs/op 1.00
BenchmarkTree/30000_vertices_to_protobuf 12320707 ns/op 19318327 B/op 210030 allocs/op 12504859 ns/op 19318336 B/op 210031 allocs/op 0.99
BenchmarkTree/30000_vertices_to_protobuf - ns/op 12320707 ns/op 12504859 ns/op 0.99
BenchmarkTree/30000_vertices_to_protobuf - B/op 19318327 B/op 19318336 B/op 1.00
BenchmarkTree/30000_vertices_to_protobuf - allocs/op 210030 allocs/op 210031 allocs/op 1.00
BenchmarkTree/30000_vertices_from_protobuf 1647020785 ns/op 3752043928 B/op 870046 allocs/op 1670053024 ns/op 3752052408 B/op 870049 allocs/op 0.99
BenchmarkTree/30000_vertices_from_protobuf - ns/op 1647020785 ns/op 1670053024 ns/op 0.99
BenchmarkTree/30000_vertices_from_protobuf - B/op 3752043928 B/op 3752052408 B/op 1.00
BenchmarkTree/30000_vertices_from_protobuf - allocs/op 870046 allocs/op 870049 allocs/op 1.00

This comment was automatically generated by workflow using github-action-benchmark.

Copy link

codecov bot commented Sep 11, 2024

Codecov Report

Attention: Patch coverage is 23.33333% with 23 lines in your changes missing coverage. Please review.

Project coverage is 50.75%. Comparing base (3e49afb) to head (46bcc1a).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
server/rpc/yorkie_server.go 25.00% 21 Missing ⚠️
api/types/event.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1008      +/-   ##
==========================================
- Coverage   50.80%   50.75%   -0.06%     
==========================================
  Files          73       74       +1     
  Lines       10865    10888      +23     
==========================================
+ Hits         5520     5526       +6     
- Misses       4796     4813      +17     
  Partials      549      549              

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

Copy link
Member

@hackerwins hackerwins left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution.

@hackerwins hackerwins changed the title Add event metric for watch document & Add labels for pushpull metric Add metrics for watch document events and enhance pushpull metrics Sep 11, 2024
@hackerwins hackerwins changed the title Add metrics for watch document events and enhance pushpull metrics Add metrics for WatchDocuments and enhance pushpull metrics Sep 11, 2024
@hackerwins hackerwins merged commit 9e36425 into main Sep 11, 2024
5 checks passed
@hackerwins hackerwins deleted the feat-watch-metric-exchange branch September 11, 2024 02:52
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