Examples of BAMServiceSummaryDSClient


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

    }
  }

  public SummaryStatistic getServerStatMonthlySummary(int serverId, BAMCalendar startTime,
      BAMCalendar endTime) throws BAMException {
        BAMServiceSummaryDSClient serviceSummaryDSClient = null;
    try {
      serviceSummaryDSClient = BAMUtil.getBAMServiceSummaryDSClient();
      return serviceSummaryDSClient.getServerStatMonthlySummary(serverId, startTime, endTime);
    } catch (Exception e) {
      throw new BAMException("Could not retrieve monthly 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 getServerStatQuarterlySummary(int serverId, BAMCalendar startTime,
      BAMCalendar endTime) throws BAMException {
        BAMServiceSummaryDSClient serviceSummaryDSClient = null;
    try {
      serviceSummaryDSClient = BAMUtil.getBAMServiceSummaryDSClient();
      return serviceSummaryDSClient.getServerStatQuarterlySummary(serverId, startTime, endTime);
    } catch (Exception e) {
      throw new BAMException("Could not retrieve quarterly 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 getServerStatYearlySummary(int serverId, BAMCalendar startTime,
      BAMCalendar endTime) throws BAMException {
        BAMServiceSummaryDSClient serviceSummaryDSClient = null;
    try {
      serviceSummaryDSClient = BAMUtil.getBAMServiceSummaryDSClient();
      return serviceSummaryDSClient.getServerStatYearlySummary(serverId, startTime, endTime);
    } catch (Exception e) {
      throw new BAMException("Could not retrieve yearly 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 void addServerStatHourlySummary(SummaryStatistic stat) throws BAMException {
        BAMServiceSummaryDSClient serviceSummaryDSClient = null;
    try {
      serviceSummaryDSClient = BAMUtil.getBAMServiceSummaryDSClient();
      serviceSummaryDSClient.addServerStatHourlySummary(stat);
    } catch (Exception e) {
      throw new BAMException("Adding hourly server 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 addServerStatDailySummary(SummaryStatistic stat) throws BAMException {
        BAMServiceSummaryDSClient serviceSummaryDSClient = null;
    try {
      serviceSummaryDSClient = BAMUtil.getBAMServiceSummaryDSClient();
      serviceSummaryDSClient.addServerStatDailySummary(stat);
    } catch (Exception e) {
      throw new BAMException("Adding daily server 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 addServerStatMonthlySummary(SummaryStatistic stat) throws BAMException {
        BAMServiceSummaryDSClient serviceSummaryDSClient = null;
    try {
      serviceSummaryDSClient = BAMUtil.getBAMServiceSummaryDSClient();
      serviceSummaryDSClient.addServerStatMonthlySummary(stat);
    } catch (Exception e) {
      throw new BAMException("Adding monthly server 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 addServerStatQuarterlySummary(SummaryStatistic stat) throws BAMException {
        BAMServiceSummaryDSClient serviceSummaryDSClient = null;
    try {
      serviceSummaryDSClient = BAMUtil.getBAMServiceSummaryDSClient();
      serviceSummaryDSClient.addServerStatQuarterlySummary(stat);
    } catch (Exception e) {
      throw new BAMException("Adding quarterly server 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 addServerStatYearlySummary(SummaryStatistic stat) throws BAMException {
        BAMServiceSummaryDSClient serviceSummaryDSClient = null;
    try {
      serviceSummaryDSClient = BAMUtil.getBAMServiceSummaryDSClient();
      serviceSummaryDSClient.addServerStatYearlySummary(stat);
    } catch (Exception e) {
      throw new BAMException("Adding yearly server 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 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
          + " 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 getOperationStatDailySummary(int opId, BAMCalendar startTime, BAMCalendar endTime)
      throws BAMException {
        BAMServiceSummaryDSClient serviceSummaryDSClient = null;
    try {
            serviceSummaryDSClient = BAMUtil.getBAMServiceSummaryDSClient();
      return serviceSummaryDSClient.getOperationStatDailySummary(opId, startTime, endTime);
    } catch (Exception e) {
      throw new BAMException("Could not retrieve daily summary for operation: " + opId
          + " 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.