com.bigdata.ganglia.IGangliaMessage Maven / Gradle / Ivy
/*
Copyright (C) SYSTAP, LLC 2006-2012. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package com.bigdata.ganglia;
/**
* A ganglia message.
*/
public interface IGangliaMessage {
/** The code for the type of message. */
public GangliaMessageTypeEnum getRecordType();
/**
* The name of the host for which the metric was reported.
*
* Note: When {@link #isSpoof()} reports true
this will be
* ip:host
.
*/
public String getHostName();
/**
* The name of the metric (this needs to be clean for use in a file system
* so the application name of the metric needs to be munged before it is
* saved here).
*/
public String getMetricName();
/**
* Return true
iff this message contains the metadata for a
* metric (the metric declaration).
*
* @see GangliaMessageTypeEnum#METADATA
*/
public boolean isMetricMetadata();
/**
* Return true
iff this message is a request for a metric.
*
* @see GangliaMessageTypeEnum#REQUEST
*/
public boolean isMetricRequest();
/** Return true
if this message represents a metric value. */
public boolean isMetricValue();
/**
* true
iff this is a spoofed message.
*
* Note: Spoof messages format {@link #getHostName()} as
* ip:host
and provide a means to fake metrics for a host which
* is down (or which is not running ganglia).
*
*/
public boolean isSpoof();
}