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

Examples of org.wso2.carbon.bam.common.dataobjects.mediation.MediationSummaryStatistic


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

            MediationSummaryStatistic stat = spm.getSequenceStatMonthlySummary(getServer().getId(),
                    getSequence().getName(), getSequence().getDirection(), loMonth, hiMonth);
            stat.setName(getSequence().getName());
            stat.setTimeDimensionId(md.getId());
            stat.setServerId(getServer().getId());
            stat.setDirection(getSequence().getDirection());

            SummaryPersistenceManager.getInstance().addSequenceStatMonthlySummary(stat);
        } catch (BAMException e) {
            if (log.isErrorEnabled()) {
                log.error("Error while running monthly summary generator for sequence: " + getSequence()
View Full Code Here


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

            MediationSummaryStatistic stat = spm.getSequenceStatQuarterlySummary(getServer().getId(),
                    getSequence().getName(), getSequence().getDirection(), loQuarter, hiQuarter);
            stat.setName(getSequence().getName());
            stat.setTimeDimensionId(qd.getId());
            stat.setServerId(getServer().getId());
            stat.setDirection(getSequence().getDirection());

            SummaryPersistenceManager.getInstance().addSequenceStatQuarterlySummary(stat);
        } catch (BAMException e) {
            if (log.isErrorEnabled()) {
                log.error("Error while running quarterly summary generator for operaion: " + getSequence()
View Full Code Here

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

            MediationSummaryStatistic stat = spm.getSequenceStatYearlySummary(getServer().getId(),
                    getSequence().getName(), getSequence().getDirection(), loYear, hiYear);
            stat.setName(getSequence().getName());
            stat.setTimeDimensionId(qd.getId());
            stat.setServerId(getServer().getId());
            stat.setDirection(getSequence().getDirection());

            SummaryPersistenceManager.getInstance().addSequenceStatYearlySummary(stat);
        } catch (BAMException e) {
            if (log.isErrorEnabled()) {
                log.error("Error while running yearly summary generator for operaion: " + getSequence()
View Full Code Here

                spm.addHourDimension(loHour);
                hd = spm.getHourDimension(loHour);
            }

            //TODO: flag
            MediationSummaryStatistic stat = spm.getProxyServiceStatHourlySummary(getServer().getId(),
                    getProxyService().getName(), getProxyService().getDirection(), loHour, hiHour);
            stat.setName(getProxyService().getName());
            stat.setTimeDimensionId(hd.getId());
            stat.setServerId(getServer().getId());
            stat.setDirection(getProxyService().getDirection());

            SummaryPersistenceManager.getInstance().addProxyServiceStatHourlySummary(stat);

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

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

            MediationSummaryStatistic stat = spm.getProxyServiceStatDailySummary(getServer().getId(),
                    getProxyService().getName(), getProxyService().getDirection(), loDay, hiDay);
            stat.setName(getProxyService().getName());
            stat.setTimeDimensionId(dd.getId());
            stat.setServerId(getServer().getId());
            stat.setDirection(getProxyService().getDirection());

            SummaryPersistenceManager.getInstance().addProxyServiceStatDailySummary(stat);
        } catch (BAMException e) {
            if (log.isErrorEnabled()) {
                log.error("Error while running daily summary generator for proxyService: " + getProxyService()
View Full Code Here

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

            MediationSummaryStatistic stat = spm.getProxyServiceStatMonthlySummary(getServer().getId(),
                    getProxyService().getName(), getProxyService().getDirection(), loMonth, hiMonth);
            stat.setName(getProxyService().getName());
            stat.setTimeDimensionId(md.getId());
            stat.setServerId(getServer().getId());
            stat.setDirection(getProxyService().getDirection());

            SummaryPersistenceManager.getInstance().addProxyServiceStatMonthlySummary(stat);
        } catch (BAMException e) {
            if (log.isErrorEnabled()) {
                log.error("Error while running monthly summary generator for proxyService: " + getProxyService()
View Full Code Here

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

            MediationSummaryStatistic stat = spm.getProxyServiceStatQuarterlySummary(getServer().getId(),
                    getProxyService().getName(), getProxyService().getDirection(), loQuarter, hiQuarter);
            stat.setName(getProxyService().getName());
            stat.setTimeDimensionId(qd.getId());
            stat.setServerId(getServer().getId());
            stat.setDirection(getProxyService().getDirection());

            SummaryPersistenceManager.getInstance().addProxyServiceStatQuarterlySummary(stat);
        } catch (BAMException e) {
            if (log.isErrorEnabled()) {
                log.error("Error while running quarterly summary generator for operaion: " + getProxyService()
View Full Code Here

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

            MediationSummaryStatistic stat = spm.getProxyServiceStatYearlySummary(getServer().getId(),
                    getProxyService().getName(), getProxyService().getDirection(), loYear, hiYear);
            stat.setName(getProxyService().getName());
            stat.setTimeDimensionId(qd.getId());
            stat.setServerId(getServer().getId());
            stat.setDirection(getProxyService().getDirection());

            SummaryPersistenceManager.getInstance().addProxyServiceStatYearlySummary(stat);
        } catch (BAMException e) {
            if (log.isErrorEnabled()) {
                log.error("Error while running yearly summary generator for operaion: " + getProxyService()
View Full Code Here

            int[] intsThisHour;
            int[] intsPrevHour;
      double doubleVal;
      int intVal;

      MediationSummaryStatistic statistic = new MediationSummaryStatistic();

      endpointString = createMediationKeyString(ENDPOINT, direction, MAX_PROCESSING_TIME, endpoint);
      doubles = client
          .getMediationStatHourlySummaryDouble(serverId, endpointString, startTime, endTime);
      doubleVal = BAMMath.max(doubles);
      statistic.setMaxProcessingTime(doubleVal);

      endpointString = createMediationKeyString(ENDPOINT, direction, MIN_PROCESSING_TIME, endpoint);
      doubles = client
          .getMediationStatHourlySummaryDouble(serverId, endpointString, startTime, endTime);
      doubleVal = BAMMath.min(doubles);
      statistic.setMinProcessingTime(doubleVal);

      endpointString = createMediationKeyString(ENDPOINT, direction, AVG_PROCESSING_TIME, endpoint);
      doubles = client.getMediationStatHourlySummaryDouble(serverId, endpointString, startTime, endTime);
      doubleVal = BAMMath.avg(doubles);
      statistic.setAvgProcessingTime(doubleVal);

//      endpointString = createMediationKeyString(ENDPOINT, direction, CUMULATIVE_COUNT, endpoint);
//      ints = client.getMediationStatHourlySummaryInt(serverId, endpointString, startTime, endTime);
//      intVal = BAMMath.max(ints) - BAMMath.min(ints);
//      statistic.setCount(intVal);
//
//      endpointString = createMediationKeyString(ENDPOINT, direction, FAULT_COUNT, endpoint);
//      ints = client.getMediationStatHourlySummaryInt(serverId, endpointString, startTime, endTime);
//      intVal = BAMMath.max(ints) - BAMMath.min(ints);
//      statistic.setFaultCount(intVal);

      BAMCalendar prevStartTime = BAMCalendar.getInstance(startTime);
      prevStartTime.add(BAMCalendar.HOUR, -24);
            BAMCalendar prevEndTime = BAMCalendar.getInstance(endTime);
            prevEndTime.add(BAMCalendar.HOUR, -1);

      endpointString = createMediationKeyString(ENDPOINT, direction, CUMULATIVE_COUNT, endpoint);
            intsThisHour = client.getDataForMediationMaxCount(serverId, endpointString, startTime, endTime);
            intsPrevHour = client.getDataForMediationMaxCount(serverId, endpointString, prevStartTime, prevEndTime);

            intVal = BAMMath.max(intsThisHour) - BAMMath.max(intsPrevHour);
      statistic.setCount(intVal >=0 ? intVal : BAMMath.max(intsThisHour));

      if (BAMMath.max(intsThisHour) <= 0){
        statistic.setAllZeros();
      } else {
      endpointString = createMediationKeyString(ENDPOINT, direction, FAULT_COUNT, endpoint);
              intsThisHour = client.getDataForMediationMaxCount(serverId, endpointString, startTime, endTime);
              intsPrevHour = client.getDataForMediationMaxCount(serverId, endpointString, prevStartTime, prevEndTime);
        intVal = BAMMath.max(intsThisHour) - BAMMath.max(intsPrevHour);
        statistic.setFaultCount(intVal >=0 ? intVal : BAMMath.max(intsThisHour));
      }

      return statistic;

    } catch (Exception e) {
View Full Code Here

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

            MediationSummaryStatistic stat = spm.getEndpointStatHourlySummary(getServer().getId(),
                    getEndpoint().getName(), getEndpoint().getDirection(), loHour, hiHour);
            stat.setName(getEndpoint().getName());
            stat.setTimeDimensionId(hd.getId());
            stat.setServerId(getServer().getId());
            stat.setDirection(getEndpoint().getDirection());

            SummaryPersistenceManager.getInstance().addEndpointStatHourlySummary(stat);

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

TOP

Related Classes of org.wso2.carbon.bam.common.dataobjects.mediation.MediationSummaryStatistic

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.