Package com.google.appengine.api.log.dev

Examples of com.google.appengine.api.log.dev.LocalLogService


    reader.beginSlice();
    checkReader(reader, new String[] {});
  }

  public void testEndTimeEqual() throws Exception {
    LocalLogService localService = LocalLogServiceTestConfig.getLocalLogService();
    localService.addRequestInfo(APP_ID, VERSION_ID, "req01", IP, NICKNAME, BASE_TIME + 10L,
        BASE_TIME + 20L, METHOD, RESOURCE, HTTP_VERSION, USER_AGENT, true, STATUS_CODE, REFERRER);

    LogInputReader reader = createReader(BASE_TIME + 15L, BASE_TIME + 20L);
    reader.beginSlice();
    checkReader(reader, new String[] {});
View Full Code Here


    reader.beginSlice();
    checkReader(reader, new String[] {});
  }

  public void testEndTimeAfter() throws Exception {
    LocalLogService localService = LocalLogServiceTestConfig.getLocalLogService();
    localService.addRequestInfo(APP_ID, VERSION_ID, "req01", IP, NICKNAME, BASE_TIME + 10L,
        BASE_TIME + 20L, METHOD, RESOURCE, HTTP_VERSION, USER_AGENT, true, STATUS_CODE, REFERRER);

    LogInputReader reader = createReader(BASE_TIME + 15L, BASE_TIME + 21L);
    reader.beginSlice();
    checkReader(reader, new String[] { "req01" });
View Full Code Here

  }

  public void testSlicing() throws Exception {
    // While the local log interface exposes request ID as a string, the log API's offset handling
    // assumes this is a number and will attempt to parse it
    LocalLogService localService = LocalLogServiceTestConfig.getLocalLogService();
    localService.addRequestInfo(APP_ID, VERSION_ID, "1", IP, NICKNAME, BASE_TIME + 10L,
        BASE_TIME + 20L, METHOD, RESOURCE, HTTP_VERSION, USER_AGENT, true, STATUS_CODE, REFERRER);

    localService.addRequestInfo(APP_ID, VERSION_ID, "2", IP, NICKNAME, BASE_TIME + 20L,
        BASE_TIME + 30L, METHOD, RESOURCE, HTTP_VERSION, USER_AGENT, true, STATUS_CODE, REFERRER);

    LogInputReader reader1 = createReader(BASE_TIME + 0L, BASE_TIME + 200L);
    // Begin and end a slice before reading any items
    reader1.beginSlice();
View Full Code Here

    assertEquals("1", logReq01.getRequestId());
    reader3.endSlice();
  }

  public void testProgress() throws Exception {
    LocalLogService localService = LocalLogServiceTestConfig.getLocalLogService();
    localService.addRequestInfo(APP_ID, VERSION_ID, "req01", IP, NICKNAME, BASE_TIME + 10L,
        BASE_TIME + 20L, METHOD, RESOURCE, HTTP_VERSION, USER_AGENT, true, STATUS_CODE, REFERRER);

    localService.addRequestInfo(APP_ID, VERSION_ID, "req02", IP, NICKNAME, BASE_TIME + 20L,
        BASE_TIME + 100L, METHOD, RESOURCE, HTTP_VERSION, USER_AGENT, true, STATUS_CODE, REFERRER);

    LogInputReader reader = createReader(BASE_TIME + 0L, BASE_TIME + 200L);
    // Before any logs are read
    assertEquals(0.0, reader.getProgress());
View Full Code Here

    logQuery.majorVersionIds(versionList);
    return new LogInputReader(logQuery);
  }

  public void testStartTimeBefore() throws Exception {
    LocalLogService localService = LocalLogServiceTestConfig.getLocalLogService();
    localService.addRequestInfo(APP_ID, VERSION_ID, "req01", IP, NICKNAME, BASE_TIME + 10L,
        BASE_TIME + 20L, METHOD, RESOURCE, HTTP_VERSION, USER_AGENT, true, STATUS_CODE, REFERRER);

    LogInputReader reader = createReader(BASE_TIME + 19L, BASE_TIME + 25L);
    reader.beginSlice();
    checkReader(reader, new String[] { "req01" });
View Full Code Here

    reader.beginSlice();
    checkReader(reader, new String[] { "req01" });
  }

  public void testStartTimeEqual() throws Exception {
    LocalLogService localService = LocalLogServiceTestConfig.getLocalLogService();
    localService.addRequestInfo(APP_ID, VERSION_ID, "req01", IP, NICKNAME, BASE_TIME + 10L,
        BASE_TIME + 20L, METHOD, RESOURCE, HTTP_VERSION, USER_AGENT, true, STATUS_CODE, REFERRER);

    LogInputReader reader = createReader(BASE_TIME + 20L, BASE_TIME + 25L);
    reader.beginSlice();
    checkReader(reader, new String[] { "req01" });
View Full Code Here

    reader.beginSlice();
    checkReader(reader, new String[] { "req01" });
  }

  public void testStartTimeAfter() throws Exception {
    LocalLogService localService = LocalLogServiceTestConfig.getLocalLogService();
    localService.addRequestInfo(APP_ID, VERSION_ID, "req01", IP, NICKNAME, BASE_TIME + 10L,
        BASE_TIME + 20L, METHOD, RESOURCE, HTTP_VERSION, USER_AGENT, true, STATUS_CODE, REFERRER);

    LogInputReader reader = createReader(BASE_TIME + 21L, BASE_TIME + 25L);
    reader.beginSlice();
    checkReader(reader, new String[] {});
View Full Code Here

              String appId = env.getAppId();
              String versionId = env.getVersionId();
              String requestId = DevLogHandler.getRequestId();
              long endTimeUsec = new Date().getTime() * 1000;

              LocalLogService logService = (LocalLogService)
                  apiProxyLocal.getService(LocalLogService.PACKAGE);

              logService.addRequestInfo(appId, versionId, requestId,
                  request.getRemoteAddr(), request.getRemoteUser(),
                  startTimeUsec, endTimeUsec, request.getMethod(),
                  request.getRequestURI(), request.getProtocol(),
                  request.getHeader("User-Agent"), true,
                  wrappedResponse.getStatus(), request.getHeader(HttpHeaders.REFERER));
              logService.clearResponseSize();
            } finally {
              ApiProxy.clearEnvironmentForCurrentThread();
            }
          }
        }
View Full Code Here

TOP

Related Classes of com.google.appengine.api.log.dev.LocalLogService

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.