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 method to get snapshot of in/out msgs/bytes stats #165

Merged
merged 1 commit into from
Jul 26, 2019

Conversation

wallyqs
Copy link
Member

@wallyqs wallyqs commented Jul 26, 2019

Adds a simple helper to get inbound/outbound stats from the client similar to the Go client.

      NATS.start("demo.nats.io") do |nats|
        # Snapshot the stats from either of the callbacks
        nats.subscribe("foo") {
          # {:in_msgs=>1, :out_msgs=>1, :in_bytes=>5, :out_bytes=>5}
          p nats.stats
        }
        nats.publish("foo", "world")
      end

Signed-off-by: Waldemar Quevedo wally@synadia.com

Signed-off-by: Waldemar Quevedo <wally@synadia.com>
Copy link
Member

@derekcollison derekcollison left a comment

Choose a reason for hiding this comment

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

LGTM

@wallyqs wallyqs merged commit 8fe54b5 into master Jul 26, 2019
@wallyqs wallyqs deleted the stats-snapshot branch July 26, 2019 23:17
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