info.ganglia.gmetric4j.gmetric.GMetric.UDPAddressingMode Java Examples

The following examples show how to use info.ganglia.gmetric4j.gmetric.GMetric.UDPAddressingMode. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: GraphDatabaseConfiguration.java    From titan1withtp3.1 with Apache License 2.0 5 votes vote down vote up
private void configureMetricsGangliaReporter() {
    if (configuration.has(GANGLIA_HOST_OR_GROUP)) {
        final String host = configuration.get(GANGLIA_HOST_OR_GROUP);
        final Duration ival = configuration.get(GANGLIA_INTERVAL);
        final Integer port = configuration.get(GANGLIA_PORT);

        final UDPAddressingMode addrMode;
        final String addrModeStr = configuration.get(GANGLIA_ADDRESSING_MODE);
        if (addrModeStr.equalsIgnoreCase("multicast")) {
            addrMode = UDPAddressingMode.MULTICAST;
        } else if (addrModeStr.equalsIgnoreCase("unicast")) {
            addrMode = UDPAddressingMode.UNICAST;
        } else throw new AssertionError();

        final Boolean proto31 = configuration.get(GANGLIA_USE_PROTOCOL_31);

        final int ttl = configuration.get(GANGLIA_TTL);

        final UUID uuid = configuration.has(GANGLIA_UUID)? UUID.fromString(configuration.get(GANGLIA_UUID)):null;

        String spoof = null;
        if (configuration.has(GANGLIA_SPOOF)) spoof = configuration.get(GANGLIA_SPOOF);

        try {
            MetricManager.INSTANCE.addGangliaReporter(host, port, addrMode, ttl, proto31, uuid, spoof, ival);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}
 
Example #2
Source File: GangliaComponentConfiguration.java    From camel-spring-boot with Apache License 2.0 4 votes vote down vote up
public UDPAddressingMode getMode() {
    return mode;
}
 
Example #3
Source File: GangliaComponentConfiguration.java    From camel-spring-boot with Apache License 2.0 4 votes vote down vote up
public void setMode(UDPAddressingMode mode) {
    this.mode = mode;
}