Package com.springsource.insight.util

Examples of com.springsource.insight.util.DataPoint


            return;
        }

        mb.add(MAIL_SIZE_METRIC, PointType.GAUGE);
        int time = TimeUtil.nanosToSeconds(trace.getRange().getStart());
        DataPoint responseSizePoint = new DataPoint(time, contentSize.doubleValue());
        mb.add(responseSizePoint, MAIL_SIZE_METRIC);
    }
View Full Code Here


                put(AbstractMetricsGenerator.EXECUTION_TIME, PointType.GAUGE);
            }
        };
        assertEquals("Mismatched number of keys - " + keys, suffixes.size(), keys.size());

        DataPoint expValue = DataPoint.dataPointFromRange(range);
        for (Map.Entry<String, PointType> se : suffixes.entrySet()) {
            String sfx = se.getKey();
            String keyName = baseName + "." + sfx;
            assertTrue("Missing " + keyName + " from " + keys, keys.contains(keyName));

            PointType expType = se.getValue(), actType = mb.getMetricType(keyName);
            assertEquals("Mismatched type for " + keyName, expType, actType);

            List<IDataPoint> dpList = mb.getPoints(keyName);
            assertEquals("Mismatched points size for " + keyName + " - " + dpList, 1, ListUtil.size(dpList));

            IDataPoint dp = dpList.get(0);
            assertEquals("Mismatched timestamp for " + keyName, expValue.getTime(), dp.getTime());

            switch (actType) {
                case COUNTER:
                    assertEquals("Mismatched value for " + keyName, 1.0d, dp.getValue(), 0.000001d);
                    break;

                case GAUGE:
                    assertEquals("Mismatched value for " + keyName, expValue.getValue(), dp.getValue(), 0.000001d);
                    break;

                default:
                    fail("Unknown value type for " + keyName + ": " + actType);
            }
View Full Code Here

        // Add the response size data point
        OperationMap response = op.get("response", OperationMap.class);
        Number contentSize = (response == null) ? null : response.get("contentSize", Number.class);
        if (contentSize != null) {    // OK if missing since collected only if extra information
            DataPoint responseSizePoint = new DataPoint(time, contentSize.doubleValue());
            mb.add(ENDPOINT_RESPONSE_SIZE, PointType.GAUGE);
            mb.add(responseSizePoint, ENDPOINT_RESPONSE_SIZE);
        }

        // Add the request size data point
        OperationMap request = op.get("request", OperationMap.class);
        Number contentLength = (request == null) ? null : request.get("contentLength", Number.class);
        if (contentLength != null) {    // OK if missing since collected only if extra information
            DataPoint requestSizePoint = new DataPoint(time, contentLength.doubleValue());
            mb.add(ENDPOINT_REQUEST_SIZE, PointType.GAUGE);
            mb.add(requestSizePoint, ENDPOINT_REQUEST_SIZE);
        }

        if (mb.isEmpty()) {
View Full Code Here

TOP

Related Classes of com.springsource.insight.util.DataPoint

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.