Package org.wso2.carbon.bam.common.dataobjects.stats

Examples of org.wso2.carbon.bam.common.dataobjects.stats.SummaryStatistic


            if (qd == null) {
                spm.addYearDimension(loYear);
                qd = spm.getYearDimension(loYear);
            }

            SummaryStatistic stat = spm.getServiceStatYearlySummary(this.getService().getId(), loYear, hiYear);
            if (stat != null) {
                stat.setTypeId(this.getService().getId());
                stat.setTimeDimensionId(qd.getId());
                SummaryPersistenceManager.getInstance().addServiceStatYearlySummary(stat);
            }
        } catch (BAMException e) {
            if (log.isErrorEnabled()) {
                log.error("Error while running yearly summary generator for service: " + getService().getName()
View Full Code Here


  public SummaryStatistic getOperationStatHourlySummary(int opId, BAMCalendar startTime, BAMCalendar endTime)
      throws BAMException {
        BAMServiceSummaryDSClient serviceSummaryDSClient = null;
    try {
            serviceSummaryDSClient = BAMUtil.getBAMServiceSummaryDSClient();
            SummaryStatistic stat = serviceSummaryDSClient.getOperationStatHourlySummary(opId, startTime, endTime);

            BAMCalendar prevHourStartTime = BAMCalendar.getInstance(startTime);
            prevHourStartTime.add(BAMCalendar.HOUR_OF_DAY, -24);
            BAMCalendar prevHourEndTime = BAMCalendar.getInstance(endTime);
            prevHourEndTime.add(BAMCalendar.HOUR_OF_DAY, -1);

            SummaryStatistic maxStatThisHour = serviceSummaryDSClient.getOperationMaxCounts(opId, startTime, endTime);
            SummaryStatistic maxStatPrevHour = serviceSummaryDSClient.getOperationMaxCounts(opId, prevHourStartTime, prevHourEndTime);

            int val;
            val = maxStatThisHour.getReqCount() - maxStatPrevHour.getReqCount();
            stat.setReqCount(val >= 0 ? val : maxStatThisHour.getReqCount());

            if (maxStatThisHour.getReqCount() <= 0) {
              stat.setAllZeros();
            } else {
            val = maxStatThisHour.getResCount() - maxStatPrevHour.getResCount();
            stat.setResCount(val >= 0 ? val : maxStatThisHour.getResCount());

            val = maxStatThisHour.getFaultCount() - maxStatPrevHour.getFaultCount();
            stat.setFaultCount(val >= 0? val : maxStatThisHour.getFaultCount());
            }
      return stat;
    } catch (Exception e) {
      throw new BAMException("Could not retrieve hourly summary for operation: " + opId
View Full Code Here

            if (hd == null) {
                spm.addHourDimension(loHour);
                hd = spm.getHourDimension(loHour);
            }

            SummaryStatistic stat = spm.getServerStatHourlySummary(this.getServer().getId(), loHour, hiHour);
            if (stat != null) {
                stat.setTypeId(this.getServer().getId());
                stat.setTimeDimensionId(hd.getId());
                SummaryPersistenceManager.getInstance().addServerStatHourlySummary(stat);
            }


            TimeRange retention = BAMPersistenceManager.getPersistenceManager(BAMUtil.getRegistry()).getDataRetentionPeriod();
View Full Code Here

            if (dd == null) {
                spm.addHourDimension(loDay);
                dd = spm.getDayDimension(loDay);
            }

            SummaryStatistic stat = spm.getServerStatDailySummary(this.getServer().getId(), loDay, hiDay);
            if (stat != null) {
                stat.setTypeId(this.getServer().getId());
                stat.setTimeDimensionId(dd.getId());
                SummaryPersistenceManager.getInstance().addServerStatDailySummary(stat);
            }

        } catch (BAMException e) {
            if (log.isErrorEnabled()) {
View Full Code Here

            if (md == null) {
                spm.addMonthDimension(loMonth);
                md = spm.getMonthDimension(loMonth);
            }

            SummaryStatistic stat = spm.getServerStatMonthlySummary(this.getServer().getId(), loMonth, hiMonth);
            if (stat != null) {
                stat.setTypeId(this.getServer().getId());
                stat.setTimeDimensionId(md.getId());
                SummaryPersistenceManager.getInstance().addServerStatMonthlySummary(stat);
            }


        } catch (BAMException e) {
View Full Code Here

            if (qd == null) {
                spm.addQuarterDimension(loQuarter);
                qd = spm.getQuarterDimension(loQuarter);
            }

            SummaryStatistic stat = spm.getServerStatQuarterlySummary(this.getServer().getId(), loQuarter, hiQuarter);
            if (stat != null) {
                stat.setTypeId(this.getServer().getId());
                stat.setTimeDimensionId(qd.getId());
                SummaryPersistenceManager.getInstance().addServerStatQuarterlySummary(stat);
            }

        } catch (BAMException e) {
            if (log.isErrorEnabled()) {
View Full Code Here

            if (md == null) {
                spm.addYearDimension(loYear);
                md = spm.getYearDimension(loYear);
            }

            SummaryStatistic stat = spm.getServerStatYearlySummary(this.getServer().getId(), loYear, hiYear);
            if (stat != null) {
                stat.setTypeId(this.getServer().getId());
                stat.setTimeDimensionId(md.getId());
                SummaryPersistenceManager.getInstance().addServerStatYearlySummary(stat);
            }
        } catch (BAMException e) {
            if (log.isErrorEnabled()) {
                log.error("Error while running yearly summary generator for server: " + this.getServer().getServerURL(), e);
View Full Code Here

            if (md == null) {
                spm.addMonthDimension(loMonth);
                md = spm.getMonthDimension(loMonth);
            }

            SummaryStatistic stat = spm.getOperationStatMonthlySummary(this.getOperation().getOperationID(), loMonth, hiMonth);
            if (stat != null) {
                stat.setTypeId(this.getOperation().getOperationID());
                stat.setTimeDimensionId(md.getId());
                SummaryPersistenceManager.getInstance().addOperationStatMonthlySummary(stat);
            }

        } catch (BAMException e) {
            if (log.isErrorEnabled()) {
View Full Code Here

            if (qd == null) {
                spm.addQuarterDimension(loQuarter);
                qd = spm.getQuarterDimension(loQuarter);
            }

            SummaryStatistic stat = spm.getOperationStatQuarterlySummary(this.getOperation().getOperationID(), loQuarter, hiQuarter);
            if (stat != null) {
                stat.setTypeId(this.getOperation().getOperationID());
                stat.setTimeDimensionId(qd.getId());
                SummaryPersistenceManager.getInstance().addOperationStatQuarterlySummary(stat);
            }
        } catch (BAMException e) {
            if (log.isErrorEnabled()) {
                log.error("Error while running quarterly summary generator for operation: " + getOperation().getName()
View Full Code Here

            if (qd == null) {
                spm.addYearDimension(loYear);
                qd = spm.getYearDimension(loYear);
            }

            SummaryStatistic stat = spm.getOperationStatYearlySummary(this.getOperation().getOperationID(), loYear, hiYear);
            if (stat != null) {
                stat.setTypeId(this.getOperation().getOperationID());
                stat.setTimeDimensionId(qd.getId());
                SummaryPersistenceManager.getInstance().addOperationStatYearlySummary(stat);
            }

        } catch (BAMException e) {
            if (log.isErrorEnabled()) {
View Full Code Here

TOP

Related Classes of org.wso2.carbon.bam.common.dataobjects.stats.SummaryStatistic

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.