Search in sources :

Example 1 with TaskQueueFetchQueueStatsRequest

use of com.google.appengine.api.taskqueue.TaskQueuePb.TaskQueueFetchQueueStatsRequest in project appengine-java-standard by GoogleCloudPlatform.

the class LocalTaskQueueTest method testFetchQueueStats.

@Test
public void testFetchQueueStats() throws Exception {
    TaskQueueFetchQueueStatsRequest request = TaskQueueFetchQueueStatsRequest.newBuilder().addQueueName(ByteString.copyFromUtf8("default")).build();
    TaskQueueFetchQueueStatsResponse response = localService.fetchQueueStats(new Status(), request);
    assertThat(response.getQueueStatsCount()).isEqualTo(1);
    TaskQueueFetchQueueStatsResponse.QueueStats stats = response.getQueueStats(0);
    assertThat(stats.hasScannerInfo()).isTrue();
    TaskQueueScannerQueueInfo scannerInfo = stats.getScannerInfo();
    assertThat(scannerInfo.hasRequestsInFlight()).isTrue();
    assertThat(scannerInfo.hasEnforcedRate()).isTrue();
    assertThat((0 == stats.getNumTasks() && -1 == stats.getOldestEtaUsec()) || (0 < stats.getNumTasks() && 0 <= stats.getOldestEtaUsec())).isTrue();
    assertThat(scannerInfo.getEnforcedRate()).isAtLeast(0);
    assertThat(scannerInfo.getExecutedLastMinute()).isAtLeast(0);
    assertThat(scannerInfo.getRequestsInFlight()).isAtLeast(0);
}
Also used : Status(com.google.appengine.tools.development.LocalRpcService.Status) TaskQueueFetchQueueStatsResponse(com.google.appengine.api.taskqueue.TaskQueuePb.TaskQueueFetchQueueStatsResponse) TaskQueueScannerQueueInfo(com.google.appengine.api.taskqueue.TaskQueuePb.TaskQueueScannerQueueInfo) TaskQueueFetchQueueStatsRequest(com.google.appengine.api.taskqueue.TaskQueuePb.TaskQueueFetchQueueStatsRequest) Test(org.junit.Test)

Aggregations

TaskQueueFetchQueueStatsRequest (com.google.appengine.api.taskqueue.TaskQueuePb.TaskQueueFetchQueueStatsRequest)1 TaskQueueFetchQueueStatsResponse (com.google.appengine.api.taskqueue.TaskQueuePb.TaskQueueFetchQueueStatsResponse)1 TaskQueueScannerQueueInfo (com.google.appengine.api.taskqueue.TaskQueuePb.TaskQueueScannerQueueInfo)1 Status (com.google.appengine.tools.development.LocalRpcService.Status)1 Test (org.junit.Test)1