Examples of WjrGAEQuotaRecorder


Examples of bufferings.ktr.wjr.server.logic.WjrGAEQuotaRecorder

   */
  public WjrMethodItem runTest(WjrMethodItem methodItem, boolean cpumsEnabled,
      boolean apimsEnabled, boolean logHookEnabled, String logHookTimezone) {
    checkNotNull(methodItem, "The methodItem parameter is null.");

    WjrGAEQuotaRecorder quotaRecorder = null;
    if (cpumsEnabled || apimsEnabled) {
      quotaRecorder = getGAEQuotaRecorder();
    }

    WjrGAELogRecorder logRecorder = null;
    if (logHookEnabled) {
      logRecorder = getGAELogRecorder();
    }

    WjrMethodRunner methodRunner = getMethodRunner();
    try {
      methodItem.clearResult();

      if (logRecorder != null) {
        if (WjrSharedUtils.isNullOrEmptyString(logHookTimezone)) {
          logHookTimezone = WjrConfig.DEFAULT_LOGHOOK_TIMEZONE;
        }

        logRecorder.startRecording(logHookTimezone);
      }

      if (quotaRecorder != null) {
        quotaRecorder.startRecording();
      }

      methodItem = methodRunner.runWjrMethod(methodItem);
    } finally {
      if (quotaRecorder != null && quotaRecorder.isRecording()) {
        quotaRecorder.stopRecording();
        if (cpumsEnabled) {
          methodItem.setCpuTime(quotaRecorder.getRecordedCpuTime());
        }
        if (apimsEnabled) {
          methodItem.setApiTime(quotaRecorder.getRecordedApiTime());
        }
      }

      if (logRecorder != null && logRecorder.isRecording()) {
        logRecorder.stopRecording();
View Full Code Here

Examples of bufferings.ktr.wjr.server.logic.WjrGAEQuotaRecorder

  /**
   * Gets the GAE quota recorder.
   */
  protected WjrGAEQuotaRecorder getGAEQuotaRecorder() {
    return new WjrGAEQuotaRecorder();
  }
View Full Code Here

Examples of bufferings.ktr.wjr.server.logic.WjrGAEQuotaRecorder

        };
      }

      @Override
      protected WjrGAEQuotaRecorder getGAEQuotaRecorder() {
        return new WjrGAEQuotaRecorder() {
          @Override
          public String getRecordedApiTime() {
            return "APITIME";
          }
View Full Code Here

Examples of bufferings.ktr.wjr.server.logic.WjrGAEQuotaRecorder

  public WjrMethodItem runTest(WjrMethodItem methodItem,
      Map<String, List<String>> parameterMap, boolean cpumsEnabled,
      boolean apimsEnabled, boolean logHookEnabled, String logHookTimezone) {
    checkNotNull(methodItem, "The methodItem parameter is null.");

    WjrGAEQuotaRecorder quotaRecorder = null;
    if (cpumsEnabled || apimsEnabled) {
      quotaRecorder = getGAEQuotaRecorder();
    }

    WjrGAELogRecorder logRecorder = null;
    if (logHookEnabled) {
      logRecorder = getGAELogRecorder();
    }

    WjrMethodRunner methodRunner = getMethodRunner();
    try {
      methodItem.clearResult();

      if (logRecorder != null) {
        if (logHookTimezone == null || logHookTimezone.length() == 0) {
          logHookTimezone = WjrConfig.DEFAULT_LOGHOOK_TIMEZONE;
        }

        WjrParamParser paramParser = getParamParser();
        String timeZoneId =
          paramParser.getTimeZoneId(parameterMap, logHookTimezone);
        logRecorder.startRecording(timeZoneId);
      }

      if (quotaRecorder != null) {
        quotaRecorder.startRecording();
      }

      methodItem = methodRunner.runWjrMethod(methodItem);
    } finally {
      if (quotaRecorder != null && quotaRecorder.isRecording()) {
        quotaRecorder.stopRecording();
        if (cpumsEnabled) {
          methodItem.setCpuTime(quotaRecorder.getRecordedCpuTime());
        }
        if (apimsEnabled) {
          methodItem.setApiTime(quotaRecorder.getRecordedApiTime());
        }
      }

      if (logRecorder != null && logRecorder.isRecording()) {
        logRecorder.stopRecording();
View Full Code Here

Examples of bufferings.ktr.wjr.server.logic.WjrGAEQuotaRecorder

  /**
   * Gets the GAE quota recorder.
   */
  protected WjrGAEQuotaRecorder getGAEQuotaRecorder() {
    return new WjrGAEQuotaRecorder();
  }
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.