Package org.apache.oodt.cas.resource.monitor.ganglia.configuration

Examples of org.apache.oodt.cas.resource.monitor.ganglia.configuration.Metric


     * ........
     * </EXTRA_DATA>
     * </METRIC>
     */
    public void testMetricTag() {
        Metric metric = ((((gridConfiguration.get(0)).getHosts()).get(0)).getMetrics()).get(0);
        assertEquals("disk_free", metric.getName());
        assertEquals("307.790", metric.getValue());
        assertEquals("double", metric.getType());
        assertEquals("GB", metric.getUnits());
        assertEquals("143", metric.getTn());
        assertEquals("180", metric.getTmax());
        assertEquals("0", metric.getDmax());
        assertEquals("both", metric.getSlope());
        assertEquals("gmond", metric.getSource());

        //extra data of the metric
        HashMap<String, String> extraData = metric.getExtraData();
        assertEquals("disk", extraData.get(GangliaMetKeys.GROUP));
        assertEquals("Total free disk space", extraData.get(GangliaMetKeys.DESC));
        assertEquals("Disk Space Available", extraData.get(GangliaMetKeys.TITLE));
    }
View Full Code Here


    /**
     * {@inheritDoc}
     */
    public void startElement(String uri, String localName, String name, Attributes atts) throws SAXException {
        if (name.equals(METRIC)) {
            this.currentMetric = new Metric(atts.getValue(NAME), atts.getValue(VAL), atts.getValue(TYPE),
                    atts.getValue(UNITS), atts.getValue(TN), atts.getValue(TMAX), atts.getValue(DMAX),
                    atts.getValue(SLOPE), atts.getValue(SOURCE));
            this.extraData = new HashMap<String, String>();

        } else if (name.equals(EXTRA_ELEMENT)) {
View Full Code Here

     * ........
     * </EXTRA_DATA>
     * </METRIC>
     */
    public void testMetricTag() {
        Metric metric = ((((gridConfiguration.get(0)).getHosts()).get(0)).getMetrics()).get(0);
        assertEquals("disk_free", metric.getName());
        assertEquals("307.790", metric.getValue());
        assertEquals("double", metric.getType());
        assertEquals("GB", metric.getUnits());
        assertEquals("143", metric.getTn());
        assertEquals("180", metric.getTmax());
        assertEquals("0", metric.getDmax());
        assertEquals("both", metric.getSlope());
        assertEquals("gmond", metric.getSource());

        //extra data of the metric
        HashMap<String, String> extraData = metric.getExtraData();
        assertEquals("disk", extraData.get(GangliaMetKeys.GROUP));
        assertEquals("Total free disk space", extraData.get(GangliaMetKeys.DESC));
        assertEquals("Disk Space Available", extraData.get(GangliaMetKeys.TITLE));
    }
View Full Code Here

TOP

Related Classes of org.apache.oodt.cas.resource.monitor.ganglia.configuration.Metric

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.