Examples of BAMServiceSummaryDSClient


Examples of org.wso2.carbon.bam.common.clients.BAMServiceSummaryDSClient

      }
    }
  }

  public void addServiceStatMonthlySummary(SummaryStatistic stat) throws BAMException {
        BAMServiceSummaryDSClient serviceSummaryDSClient = null;
    try {
      serviceSummaryDSClient = BAMUtil.getBAMServiceSummaryDSClient();
      serviceSummaryDSClient.addServiceStatMonthlySummary(stat);
    } catch (Exception e) {
      throw new BAMException("Adding monthly service summary stat failed", e);
    } finally {
      if (serviceSummaryDSClient != null) {
          serviceSummaryDSClient.cleanup();
      }
    }
  }
View Full Code Here

Examples of org.wso2.carbon.bam.common.clients.BAMServiceSummaryDSClient

      }
    }
  }

  public void addServiceStatQuarterlySummary(SummaryStatistic stat) throws BAMException {
        BAMServiceSummaryDSClient serviceSummaryDSClient = null;
    try {
      serviceSummaryDSClient = BAMUtil.getBAMServiceSummaryDSClient();
      serviceSummaryDSClient.addServiceStatQuarterlySummary(stat);
    } catch (Exception e) {
      throw new BAMException("Adding quarterly service summary stat failed", e);
    } finally {
      if (serviceSummaryDSClient != null) {
          serviceSummaryDSClient.cleanup();
      }
    }
  }
View Full Code Here

Examples of org.wso2.carbon.bam.common.clients.BAMServiceSummaryDSClient

      }
    }
  }

  public void addServiceStatYearlySummary(SummaryStatistic stat) throws BAMException {
        BAMServiceSummaryDSClient serviceSummaryDSClient = null;
    try {
      serviceSummaryDSClient = BAMUtil.getBAMServiceSummaryDSClient();
      serviceSummaryDSClient.addServiceStatYearlySummary(stat);
    } catch (Exception e) {
      throw new BAMException("Adding yearly service summary stat failed", e);
    } finally {
      if (serviceSummaryDSClient != null) {
          serviceSummaryDSClient.cleanup();
      }
    }
  }
View Full Code Here

Examples of org.wso2.carbon.bam.common.clients.BAMServiceSummaryDSClient

    }
  }

  public SummaryStatistic getServerStatHourlySummary(int serverId, BAMCalendar startTime,
      BAMCalendar endTime) throws BAMException {
        BAMServiceSummaryDSClient serviceSummaryDSClient = null;
    try {
      serviceSummaryDSClient = BAMUtil.getBAMServiceSummaryDSClient();
      SummaryStatistic stat = serviceSummaryDSClient.getServerStatHourlySummary(serverId, 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.getServerMaxCounts(serverId, startTime, endTime);
            SummaryStatistic maxStatPrevHour = serviceSummaryDSClient.getServerMaxCounts(serverId, 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 server: " + serverId+ " start time: " +
                    startTime.getBAMTimestamp(), e);
    } finally {
      if (serviceSummaryDSClient != null) {
          serviceSummaryDSClient.cleanup();
      }
    }
  }
View Full Code Here

Examples of org.wso2.carbon.bam.common.clients.BAMServiceSummaryDSClient

    }
  }

  public SummaryStatistic getServerStatDailySummary(int serverId, BAMCalendar startTime, BAMCalendar endTime)
      throws BAMException {
        BAMServiceSummaryDSClient serviceSummaryDSClient = null;
    try {
      serviceSummaryDSClient = BAMUtil.getBAMServiceSummaryDSClient();
      return serviceSummaryDSClient.getServerStatDailySummary(serverId, startTime, endTime);
    } catch (Exception e) {
      throw new BAMException("Could not retrieve daily summary for server: " + serverId+ " start time: " +
                    startTime.getBAMTimestamp(), e);
    } finally {
      if (serviceSummaryDSClient != null) {
          serviceSummaryDSClient.cleanup();
      }
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.