Coder Social home page Coder Social logo

gangliaapi4j's Introduction

GangliaAPI for JAVA:

The Ganglia API is a small standalone java application that takes XML data from a number of Ganglia gmetad processes and presents a useful API of the most recently received data.

This is designed to be part of our wider monitoring and metrics framework.

What I want to say

The ganglia gmetad API leaves something to be desired. It polls the gmetad thread to get current cluster metrics, keeping the latest results in memory.

Requirements and assumptions:

You need to add "org.dom4j" package to your project if you want to recompile.

Usage and exmple code:

public static void main(String [] args){

	RemoteReader httpAccess = new RemoteReader();
	
	String input =httpAccess.SendRequest();
	
	MetricsRetrieve metricsRetrive = new MetricsRetrieve();
	
	metricsRetrive.Parse(input);
	
	System.out.print(metricsRetrive.getClusterNumber());
	
	List<Metric> metrics = metricsRetrive.getMetricsByNameInCluster("jassion", "localhost");
	
	for(Metric metric  : metrics){
		
		System.out.println("name:  "+metric.getName());
		
		System.out.println("value: "+metric.getValue());
		
		System.out.println("type: "+metric.getType());
		
	}
	
	return ;
	
}

RemoteReader try to connect the remote gmetad thread by predefined ip and port(default is 27.0.0.1:8651) which depends on your gnaglia setting. MetricsRetrieve analysis the raw input data and encapsulate them in the form of Metric struct.

If you have any problems about my code, please feel free to contact me: [email protected]

gangliaapi4j's People

Contributors

yncxcw avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.