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

ReactiveSocket metrics stream #1211

Merged
merged 8 commits into from
May 26, 2016
Merged

Conversation

robertroeser
Copy link
Contributor

Metrics stream implementation in reactive sockets. Takes a 32-bit integer that represents the stream type. Data is streamed as CBOR.

import java.io.ByteArrayOutputStream;
import java.util.stream.Stream;

public class HystrixCollasperMetricsStream extends StreamingSupplier<HystrixCollapserMetrics> {
Copy link
Contributor

Choose a reason for hiding this comment

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

Typo: Collasper -> Collapser

@mattrjacobs
Copy link
Contributor

A couple more questions:

  1. How should this actually get exposed over the network? As an example, if I wanted to use this for hystrix-examples-webapp, I could set up a EventStreamRequestHandler. From that, I can get a Publisher<Payload> by passing in the appropriate enum. But I'm not familiar enough with ReactiveSocket to know how to expose that, and then set up a client on the other side.

  2. The code to convert data types into JSON/CBOR is very similar to hystrix-metric-event-stream. Would it make sense to directly expose a map-like object from hystrix-core, on the assumption that any serializer wants that? If that were exposed, then any given serializer wouldn't care anything about the content of the data, just the field-types.

@robertroeser
Copy link
Contributor Author

1) How should this actually get exposed over the network? As an example, if I wanted to use this for hystrix-examples-webapp, I could set up a EventStreamRequestHandler. From that, I can get a Publisher by passing in the appropriate enum. But I'm not familiar enough with ReactiveSocket to know how to expose that, and then set up a client on the other side.

EventStreamRequestHandler is roughly equivalent to a HttpServlet. When you create an instance of a ReactiveSocket you would give it an instance of this class.

2) The code to convert data types into JSON/CBOR is very similar to hystrix-metric-event-stream. Would it make sense to directly expose a map-like object from hystrix-core, on the assumption that any serializer wants that? If that were exposed, then any given serializer wouldn't care anything about the content of the data, just the field-types.
Sure - add a method on the Metrics objets that gets the metrics as a map?

@mattrjacobs
Copy link
Contributor

mattrjacobs commented May 26, 2016

Merging this, and I'll work on building a client and the data type work outlined in my second point above. Thanks @robertroeser !

@mattrjacobs mattrjacobs merged commit b0ce3b3 into Netflix:master May 26, 2016
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