Package org.eurekaj.api.datatypes

Examples of org.eurekaj.api.datatypes.GroupedStatistics


            }

            log.info("got chartGroup JSON" + jsonObject.toString());
           
            if (isAdmin(loggedInUser) && (isPut(e) || isPost(e))) {
              GroupedStatistics groupedStatistics = ParseJsonObjects.parseInstrumentationGroup(jsonObject, id, loggedInUser.getAccountName());
                if (groupedStatistics != null && groupedStatistics.getName() != null && groupedStatistics.getName().length() > 0) {
                    getBerkeleyTreeMenuService().persistGroupInstrumentation(groupedStatistics);
                }
                JSONObject topObject = new JSONObject();
                topObject.put("chartGroup", BuildJsonObjectsUtil.generateChartGroupJson(groupedStatistics));
                jsonResponse = topObject.toString();
View Full Code Here


                Long toPeriod = getToPeriod(keyObject);

                List<LiveStatistics> liveList = null;
                String seriesLabel = null;
                Alert alert = null;
                GroupedStatistics groupedStatistics = null;
                XYDataSetCollection valueCollection = new XYDataSetCollection();

                //TODO: This if-else code block needs refactoring. Its not DRY
                if (isAlertChart(id)) {
                    id = id.replaceAll("\\%20", " ").replaceAll("\\%25", "%");
                    String alertName = id.substring(8, id.length());
                    log.info("isAlert! " + alertName);
                    alert = getBerkeleyTreeMenuService().getAlert(alertName, loggedInAccountName);
                    if (alert != null) {
                        chartPath = alert.getGuiPath();
                        seriesLabel = "Alert: " + alert.getAlertName();
                    }

                    liveList = getBerkeleyTreeMenuService().getLiveStatistics(chartPath, loggedInAccountName, fromPeriod, toPeriod);
                    Collections.sort(liveList);
                    valueCollection = ChartUtil.generateChart(liveList, seriesLabel, fromPeriod * 15000, toPeriod * 15000, chartResolution);
                    valueCollection.addDataList(ChartUtil.buildWarningList(alert, AlertStatus.CRITICAL, fromPeriod * 15000, toPeriod * 15000));
                    valueCollection.addDataList(ChartUtil.buildWarningList(alert, AlertStatus.WARNING, fromPeriod * 15000, toPeriod * 15000));

                    log.info("alert: " + alert);
                    log.info("chartPath: " + chartPath);
                } else if (isGroupedStatisticsChart(id)) {
                    id = id.replaceAll("\\%20", " ").replaceAll("\\%25", "%");
                    chartPath = id;
                    String groupName = id.substring(5, id.length());

                    log.info("isGroupedStat! " + groupName);
                    groupedStatistics = getBerkeleyTreeMenuService().getGroupedStatistics(groupName, loggedInAccountName);
                    if (groupedStatistics != null) {
                        log.info("groupedStats: " + groupedStatistics.getName() + " :. " + groupedStatistics.getGroupedPathList().size());
                        seriesLabel = "Grouped Statistics: " + groupedStatistics.getName();
                        for (String gsPath : groupedStatistics.getGroupedPathList()) {
                            log.info("\tgroupedStats Path: " + gsPath);
                            liveList = getBerkeleyTreeMenuService().getLiveStatistics(gsPath, loggedInAccountName, fromPeriod, toPeriod);
                            Collections.sort(liveList);
                            for (XYDataList dataList : ChartUtil.generateChart(liveList, gsPath, fromPeriod * 15000, toPeriod * 15000, chartResolution).getDataList()) {
                                valueCollection.addDataList(dataList);
View Full Code Here

TOP

Related Classes of org.eurekaj.api.datatypes.GroupedStatistics

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.