com.yammer.metrics.reporting
Class GangliaMessage

java.lang.Object
  extended by com.yammer.metrics.reporting.GangliaMessage

public class GangliaMessage
extends Object

Encapsulates logic for creating and sending a Ganglia message


Method Summary
 GangliaMessage addInt(int value)
          Puts an integer into the buffer as 4 bytes, big-endian.
 GangliaMessage addString(String value)
          Puts a string into the buffer by first writing the size of the string as an int, followed by the bytes of the string, padded if necessary to a multiple of 4.
 void send()
          Creates and sends a new DatagramPacket
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

send

public void send()
          throws SocketException,
                 IOException
Creates and sends a new DatagramPacket

Throws:
SocketException
IOException

addInt

public GangliaMessage addInt(int value)
Puts an integer into the buffer as 4 bytes, big-endian.

Parameters:
value - the integer to write to the buffer
Returns:

addString

public GangliaMessage addString(String value)
Puts a string into the buffer by first writing the size of the string as an int, followed by the bytes of the string, padded if necessary to a multiple of 4.

Parameters:
value - the message to write to the buffer
Returns:


Copyright © 2011. All Rights Reserved.