class Graphite extends ServiceImpl implements EventTrackingService
| Modifier and Type | Field and Description |
|---|---|
(package private) java.lang.String |
apiKey |
(package private) java.lang.String |
host |
(package private) int |
port |
context, utils| Constructor and Description |
|---|
Graphite(android.content.Context context) |
| Modifier and Type | Method and Description |
|---|---|
(package private) void |
closeSocket(java.net.Socket socket)
Close the given Socket object, checking for null
|
void |
enable(java.lang.String url)
Enable this service.
|
ServiceType |
getServiceType()
Returns on of
ServiceType that corresponds to this service. |
(package private) long |
getTimeStamp()
Return unix epoch for the current time
|
boolean |
isEnabled()
This service is enabled
|
void |
logEvent(android.content.Context context,
java.lang.String event)
Send data to graphite in the format "metric_path value timestamp\n".
|
(package private) void |
sendData(java.lang.String graphiteEvent)
Start new background thread to send data with.
|
(package private) java.net.Socket |
sendDataOverSocket(java.lang.String graphiteEvent)
Create new
DataOutputStream to send data over. |
(package private) void |
sendUdpData(java.lang.String graphiteEvent)
Send data to Graphite server.
|
public void enable(java.lang.String url)
public boolean isEnabled()
public ServiceType getServiceType()
ServiceType that corresponds to this service.getServiceType in interface ServiceServiceType.public void logEvent(android.content.Context context,
java.lang.String event)
logEvent in interface EventTrackingServicecontext - Context.event - Event to track. This will be sent to the service represented by this class.long getTimeStamp()
void sendData(java.lang.String graphiteEvent)
graphiteEvent - Event data to send to graphite.void sendUdpData(java.lang.String graphiteEvent)
graphiteEvent - Event data to send to graphite.java.net.Socket sendDataOverSocket(java.lang.String graphiteEvent)
throws java.io.IOException
DataOutputStream to send data over.graphiteEvent - Event data to send to graphite.Socket object. Should be closed after calling this method.java.io.IOException - propagates if there was a network issue.void closeSocket(java.net.Socket socket)
socket - socket to close.