
Event - type of raw data that needs to get summarized into a bucketBucket - type of data contained in each bucketOutput - type of data emitted to stream subscribers (often is the same as A but does not have to be)public abstract class BucketedCounterStream<Event extends HystrixEvent,Bucket,Output>
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected rx.Observable<Bucket> |
bucketedStream |
protected int |
numBuckets |
protected java.util.concurrent.atomic.AtomicReference<rx.Subscription> |
subscription |
| Modifier | Constructor and Description |
|---|---|
protected |
BucketedCounterStream(HystrixEventStream<Event> inputEventStream,
int numBuckets,
int bucketSizeInMs,
rx.functions.Func2<Bucket,Event,Bucket> appendRawEventToBucket) |
| Modifier and Type | Method and Description |
|---|---|
Output |
getLatest()
Synchronous call to retrieve the last calculated bucket without waiting for any emissions
|
abstract rx.Observable<Output> |
observe()
Return the stream of buckets
|
void |
startCachingStreamValuesIfUnstarted() |
void |
unsubscribe() |
protected final int numBuckets
protected final rx.Observable<Bucket> bucketedStream
protected final java.util.concurrent.atomic.AtomicReference<rx.Subscription> subscription
protected BucketedCounterStream(HystrixEventStream<Event> inputEventStream, int numBuckets, int bucketSizeInMs, rx.functions.Func2<Bucket,Event,Bucket> appendRawEventToBucket)
public abstract rx.Observable<Output> observe()
public void startCachingStreamValuesIfUnstarted()
public Output getLatest()
public void unsubscribe()