public final class InProcessTelemetryChannel extends java.lang.Object implements TelemetryChannel
TelemetryChannel
The channel holds two main entities:
A buffer for incoming Telemetry instances
A transmitter
The buffer is stores incoming telemetry instances. Every new buffer starts a timer.
When the timer expires, or when the buffer is 'full' (whichever happens first), the
transmitter will pick up that buffer and will handle its sending to the server. For example,
a transmitter will be responsible for compressing, sending and activate a policy in case of failures.
The model here is:
Use application threads to populate the buffer
Use channel's threads to send buffers to the server
Created by gupele on 12/17/2014.| Constructor and Description |
|---|
InProcessTelemetryChannel() |
InProcessTelemetryChannel(java.util.Map<java.lang.String,java.lang.String> nameAndValues)
This Ctor will query the 'namesAndValues' map for data to initialize itself
It will ignore data that is not of its interest, this Ctor is useful for building an instance from configuration
|
InProcessTelemetryChannel(java.lang.String endpointAddress,
boolean developerMode)
Ctor
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
isDeveloperMode()
Gets value indicating whether this channel is in developer mode.
|
void |
send(Telemetry telemetry)
Sends a Telemetry instance through the channel.
|
void |
setDeveloperMode(boolean developerMode)
Sets value indicating whether this channel is in developer mode.
|
void |
stop(long timeout,
java.util.concurrent.TimeUnit timeUnit)
Stops on going work
|
public InProcessTelemetryChannel()
public InProcessTelemetryChannel(java.lang.String endpointAddress,
boolean developerMode)
endpointAddress - Must be empty string or a valid uri, else an exception will be throwndeveloperMode - True will behave in a 'non-production' mode to ease the debuggingpublic InProcessTelemetryChannel(java.util.Map<java.lang.String,java.lang.String> nameAndValues)
nameAndValues - - The data passed as name and value pairspublic boolean isDeveloperMode()
isDeveloperMode in interface TelemetryChannelpublic void setDeveloperMode(boolean developerMode)
setDeveloperMode in interface TelemetryChanneldeveloperMode - True or falsepublic void send(Telemetry telemetry)
send in interface TelemetryChanneltelemetry - The Telemetry item to send.public void stop(long timeout,
java.util.concurrent.TimeUnit timeUnit)
stop in interface TelemetryChanneltimeout - Time to try and stoptimeUnit - The units of the 'timeout' parameter