Package com.rackspacecloud.blueflood.CloudFilesBackfiller.gson

Examples of com.rackspacecloud.blueflood.CloudFilesBackfiller.gson.CheckFromJson


                    continue;
                }

                // todo: per-line instrumentation starts here.

                CheckFromJson checkFromJson = gson.fromJson(line, CheckFromJson.class);
                if (!CheckFromJson.isValid(checkFromJson)) {
                    invalidMetricsCounter.inc();
                } else {
                    for (String metricName : checkFromJson.getMetricNames()) {

                        MetricPoint metricPoint = checkFromJson.getMetric(metricName);

                        // Bail out for string metrics
                        if(metricPoint.getType() == String.class) {
                            line = reader.readLine();
                            continue;
                        }

                        Locator metricLocator;
                        if(checkFromJson.getCheckType().contains("remote")) {
                            String longMetricName = String.format("%s.rackspace.monitoring.entities.%s.checks.%s.%s.%s.%s",
                                    checkFromJson.getTenantId(),
                                    checkFromJson.getEntityId(),
                                    checkFromJson.getCheckType(),
                                    checkFromJson.getCheckId(),
                                    checkFromJson.getMonitoringZoneId(),
                                    metricName).trim();
                            metricLocator = Locator.createLocatorFromDbKey(longMetricName);
                        } else {
                            String longMetricName = String.format("%s.rackspace.monitoring.entities.%s.checks.%s.%s.%s",
                                    checkFromJson.getTenantId(),
                                    checkFromJson.getEntityId(),
                                    checkFromJson.getCheckType(),
                                    checkFromJson.getCheckId(),
                                    metricName).trim();
                            metricLocator = Locator.createLocatorFromDbKey(longMetricName);
                        }

                        if (!shardsToBackfill.contains(Util.computeShard(metricLocator.toString()))) {
                            line = reader.readLine();
                            continue;
                        }

                        long timestamp = checkFromJson.getTimestamp();
                        long snappedMillis = Granularity.MIN_5.snapMillis(timestamp);

                        Range rangeOfThisTimestamp = new Range(snappedMillis, snappedMillis + Granularity.MIN_5.milliseconds() - 1);

                        //Do not add timestamps that lie out of range
View Full Code Here

TOP

Related Classes of com.rackspacecloud.blueflood.CloudFilesBackfiller.gson.CheckFromJson

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.