Package org.eurekaj.api.datatypes.basic

Examples of org.eurekaj.api.datatypes.basic.BasicLiveStatistics


        long numMetrics = to15SecPeriod - from15SecPeriod;
        long index = 0;

        List<LiveStatistics> liveStatisticsList = new ArrayList<LiveStatistics>();
        while (index <= numMetrics) {
            liveStatisticsList.add(new BasicLiveStatistics("EurekaJAgent:Memory:Heap:Used", "ACCOUNT", from15SecPeriod + index, new Double(index), ValueType.AGGREGATE.value(), UnitType.N.value(), 1l));
            index++;
        }

        env.getLiveStatissticsDao().storeIncomingStatistics(liveStatisticsList);
View Full Code Here


            BasicMetricHour storedMetricHour = myBucket.fetch("" + guiPath, BasicMetricHour.class).execute();
            if (storedMetricHour == null) {
                storedMetricHour = new BasicMetricHour(guiPath, accountName, hoursSince1970, valueType.toString(), unitType.toString());
            }

            storedMetricHour.addStatistic(new BasicLiveStatistics(guiPath, accountName, timeperiod, valueDouble, valueType.value(), unitType.value(), count));

            myBucket.store("" + guiPath, storedMetricHour).execute();
        } catch (RiakRetryFailedException e) {
            e.printStackTrace()//To change body of catch statement use File | Settings | File Templates.
        }
View Full Code Here

        for (int index = minTimeperiodWithinTheHour; index <= maxTimeperiodWithinTheHour; index++) {
            Long timeperiod = (hoursSince1970 * 240) + index;

            //logger.info("Creating LiveStats for: " + metricHour.getId() + " with value: " + metricHour.getValueAt(index));
            retList.add(new BasicLiveStatistics(metricHour.getGuiPath(), metricHour.getAccountName(), timeperiod, metricHour.getMetrics()[index], metricHour.getValueType(), metricHour.getUnitType(), metricHour.getMeasurementCount()[index]));
        }

        return retList;
    }
View Full Code Here

        BasicMetricHour storedMetricHour = getMetricHour(accountName, guiPath, hoursSince1970);
        if (storedMetricHour == null) {
            storedMetricHour = new BasicMetricHour(guiPath, accountName, hoursSince1970, valueType.toString(), unitType.toString());
        }

        storedMetricHour.addStatistic(new BasicLiveStatistics(guiPath, accountName, timeperiod, valueDouble, valueType.value(), unitType.value(), count));
       
        db.put(bytes(liveStatsBucketKey + accountName + ";" + hoursSince1970 + ";" + guiPath), bytes(gson.toJson(storedMetricHour)));
  }
View Full Code Here

        for (int index = minTimeperiodWithinTheHour; index <= maxTimeperiodWithinTheHour; index++) {
            Long timeperiod = (hoursSince1970 * 240) + index;

            //logger.info("Creating LiveStats for: " + metricHour.getGuiPath() + " at timeperiod: " + metricHour.getHoursSince1970() + " and index: " + index + " with value: " + metricHour.getMetrics()[index]);
            retList.add(new BasicLiveStatistics(metricHour.getGuiPath(), metricHour.getAccountName(), timeperiod, metricHour.getMetrics()[index], metricHour.getValueType(), metricHour.getUnitType(), metricHour.getMeasurementCount()[index]));
        }

        return retList;
    }
View Full Code Here

             
                JSONArray statList = jsonObject.getJSONArray("storeLiveStatistics");
                List<LiveStatistics> liveStatList = new ArrayList<LiveStatistics>();

                for (int index = 0; index < statList.length(); index++) {
                  BasicLiveStatistics liveStatistics = ParseJsonObjects.parseLiveStatistics(statList.getJSONObject(index), accountName);
                    liveStatList.add(liveStatistics);
                   
                    String agent = liveStatistics.getGuiPath().substring(0, liveStatistics.getGuiPath().indexOf(":"));
                    BasicLiveStatistics agentStats = new BasicLiveStatistics();
                    agentStats.setGuiPath(agent + ":Agent Statistics:API Call Count");
                    agentStats.setAccountName(accountName);
                    agentStats.setTimeperiod(liveStatistics.getTimeperiod());
                    agentStats.setUnitType(UnitType.N.value());
                    agentStats.setValueType(ValueType.AGGREGATE.value());
                    agentStats.setValue(1d);
                    agentStats.setCount(1l);
                   
                    liveStatList.add(agentStats);
                }

                //Send to available plugins for processing
View Full Code Here

        return groupedStatistics;
    }

    public static BasicLiveStatistics parseLiveStatistics(JSONObject jsonLiveStatistics, String accountName) {
      BasicLiveStatistics liveStatistics = null;

        if (jsonLiveStatistics.has("guiPath")) {
            liveStatistics = new BasicLiveStatistics();
            liveStatistics.setAccountName(accountName);
            liveStatistics.setGuiPath(parseStringFromJson(jsonLiveStatistics, "guiPath"));
            liveStatistics.setTimeperiod(parseLongFromJson(jsonLiveStatistics, "timeperiod"));
            liveStatistics.setValue(parseDoubleFromJson(jsonLiveStatistics, "value"));
            liveStatistics.setValueType(parseStringFromJson(jsonLiveStatistics, "valueType"));
            liveStatistics.setUnitType(parseStringFromJson(jsonLiveStatistics, "unitType"));
        }

        return liveStatistics;
    }
View Full Code Here

    @Before
    @Ignore
    public void setUp() {
        liveStatisticsList = new ArrayList<LiveStatistics>();

        liveStatisticsList.add(new BasicLiveStatistics("guipath", "ACCOUNT", 1295540055000l / 15000, 6d));
        liveStatisticsList.add(new BasicLiveStatistics("guipath", "ACCOUNT", 1295540070000l / 15000, 8d));
        liveStatisticsList.add(new BasicLiveStatistics("guipath", "ACCOUNT", 1295540085000l / 15000, 7d));

        liveStatisticsList.add(new BasicLiveStatistics("guipath", "ACCOUNT", 1295540100000l / 15000, 9d));
        liveStatisticsList.add(new BasicLiveStatistics("guipath", "ACCOUNT", 1295540115000l / 15000, 11d));
        liveStatisticsList.add(new BasicLiveStatistics("guipath", "ACCOUNT", 1295540130000l / 15000, 7d));

        liveStatisticsList.add(new BasicLiveStatistics("guipath", "ACCOUNT", 1295540145000l / 15000, 12d));
        liveStatisticsList.add(new BasicLiveStatistics("guipath", "ACCOUNT", 1295540160000l / 15000, 8d));
        liveStatisticsList.add(new BasicLiveStatistics("guipath", "ACCOUNT", 1295540175000l / 15000, 10d));

        liveStatisticsList.add(new BasicLiveStatistics("guipath", "ACCOUNT", 1295540190000l / 15000, 12d));
        liveStatisticsList.add(new BasicLiveStatistics("guipath", "ACCOUNT", 1295540205000l / 15000, 11d));
        liveStatisticsList.add(new BasicLiveStatistics("guipath", "ACCOUNT", 1295540220000l / 15000, 7d));

        liveStatisticsList.add(new BasicLiveStatistics("guipath", "ACCOUNT", 1295540235000l / 15000, 9d));
        liveStatisticsList.add(new BasicLiveStatistics("guipath", "ACCOUNT", 1295540250000l / 15000, 11d));
        liveStatisticsList.add(new BasicLiveStatistics("guipath", "ACCOUNT", 1295540265000l / 15000, 10d));

        liveStatisticsList.add(new BasicLiveStatistics("guipath", "ACCOUNT", 1295540280000l / 15000, 12d));
        liveStatisticsList.add(new BasicLiveStatistics("guipath", "ACCOUNT", 1295540295000l / 15000, 8d));
        liveStatisticsList.add(new BasicLiveStatistics("guipath", "ACCOUNT", 1295540310000l / 15000, 10d));

        liveStatisticsList.add(new BasicLiveStatistics("guipath", "ACCOUNT", 1295540325000l / 15000, 9d));
        liveStatisticsList.add(new BasicLiveStatistics("guipath", "ACCOUNT", 1295540340000l / 15000, 11d));
        liveStatisticsList.add(new BasicLiveStatistics("guipath", "ACCOUNT", 1295540355000l / 15000, 7d));

        liveStatisticsList.add(new BasicLiveStatistics("guipath", "ACCOUNT", 1295540370000l / 15000, 9d));
        liveStatisticsList.add(new BasicLiveStatistics("guipath", "ACCOUNT", 1295540385000l / 15000, 9d));
        liveStatisticsList.add(new BasicLiveStatistics("guipath", "ACCOUNT", 1295540400000l / 15000, 11d));

        liveStatisticsList.add(new BasicLiveStatistics("guipath", "ACCOUNT", 1295540415000l / 15000, 7d));
        liveStatisticsList.add(new BasicLiveStatistics("guipath", "ACCOUNT", 1295540430000l / 15000, 9d));
        liveStatisticsList.add(new BasicLiveStatistics("guipath", "ACCOUNT", 1295540445000l / 15000, 9d));

        liveStatisticsList.add(new BasicLiveStatistics("guipath", "ACCOUNT", 1295540460000l / 15000, 11d));
        liveStatisticsList.add(new BasicLiveStatistics("guipath", "ACCOUNT", 1295540475000l / 15000, 7d));
        liveStatisticsList.add(new BasicLiveStatistics("guipath", "ACCOUNT", 1295540490000l / 15000, 10d));

        liveStatisticsList.add(new BasicLiveStatistics("guipath", "ACCOUNT", 1295540505000l / 15000, 9d));
        liveStatisticsList.add(new BasicLiveStatistics("guipath", "ACCOUNT", 1295540520000l / 15000, 10d));
    }
View Full Code Here

TOP

Related Classes of org.eurekaj.api.datatypes.basic.BasicLiveStatistics

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.