Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ public void getProcessStatistics() {
.usage(ProcessUsage.builder()
.time("2016-03-23T23:17:30.476314154Z")
.cpu(0.00038711029163348665)
.memory(19177472)
.memory((long)19177472)
.disk(69705728)
.build())
.host("10.244.16.10")
Expand All @@ -596,10 +596,10 @@ public void getProcessStatistics() {
.internal(8080)
.internalTlsProxyPort(5678)
.build())
.uptime(9042)
.memoryQuota(268435456)
.diskQuota(1073741824)
.fileDescriptorQuota(16384)
.uptime((long)9042)
.memoryQuota((long)268435456)
.diskQuota((long)1073741824)
.fileDescriptorQuota((long)16384)
.build())
.build())
.expectComplete()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ public void getProcessStatistics() {
.usage(ProcessUsage.builder()
.time("2016-03-23T23:17:30.476314154Z")
.cpu(0.00038711029163348665)
.memory(19177472)
.memory((long)19177472)
.disk(69705728)
.build())
.host("10.244.16.10")
Expand All @@ -176,10 +176,10 @@ public void getProcessStatistics() {
.internal(8080)
.internalTlsProxyPort(5678)
.build())
.uptime(9042)
.memoryQuota(268435456)
.diskQuota(1073741824)
.fileDescriptorQuota(16384)
.uptime((long)9042)
.memoryQuota((long)268435456)
.diskQuota((long)1073741824)
.fileDescriptorQuota((long)16384)
.build())
.build())
.expectComplete()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,21 @@ public abstract class ProcessStatistics {
* The disk quota
*/
@JsonProperty("disk_quota")
public abstract Integer getDiskQuota();
@Nullable
public abstract Long getDiskQuota();

/**
* The file descriptor quota
*/
@JsonProperty("fds_quota")
public abstract Integer getFileDescriptorQuota();
@Nullable
public abstract Long getFileDescriptorQuota();

/**
* The host
*/
@JsonProperty("host")
@Nullable
public abstract String getHost();

/**
Expand All @@ -61,6 +64,7 @@ public abstract class ProcessStatistics {
* The instance port mappings
*/
@JsonProperty("instance_ports")
@Nullable
public abstract List<PortMapping> getInstancePorts();

/**
Expand All @@ -74,7 +78,8 @@ public abstract class ProcessStatistics {
* The memory quota
*/
@JsonProperty("mem_quota")
public abstract Integer getMemoryQuota();
@Nullable
public abstract Long getMemoryQuota();

/**
* The state
Expand All @@ -93,12 +98,13 @@ public abstract class ProcessStatistics {
* The uptime
*/
@JsonProperty("uptime")
public abstract Integer getUptime();
public abstract Long getUptime();

/**
* The usage
*/
@JsonProperty("usage")
@Nullable
public abstract ProcessUsage getUsage();

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ abstract class _ProcessUsage {
* The memory
*/
@JsonProperty("mem")
abstract Integer getMemory();
abstract Long getMemory();

/**
* The time
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@

package org.cloudfoundry.client.v3.applications;

import org.cloudfoundry.client.v3.processes.ProcessState;
import org.cloudfoundry.client.v3.processes.ProcessStatisticsResource;
import org.cloudfoundry.client.v3.processes.ProcessUsage;
import org.junit.Test;

public final class GetApplicationProcessStatisticsRequestTest {
Expand All @@ -42,4 +45,40 @@ public void valid() {
.build();
}

@Test
public void validDownResponse() {
ProcessStatisticsResource processStatisticsResource = ProcessStatisticsResource.builder()
.type("web")
.index(0)
.state(ProcessState.DOWN)
.uptime(new Long(0))
.build();
GetApplicationProcessStatisticsResponse.builder()
.resource(processStatisticsResource)
.build();
}

@Test
public void validRunningResponse() {
ProcessUsage processUsage = ProcessUsage.builder()
.time("")
.cpu(new Double("0.00038711029163348665"))
.memory(new Long(19177472))
.disk(new Integer(69705728))
.build();
ProcessStatisticsResource processStatisticsResource = ProcessStatisticsResource.builder()
.type("web")
.index(0)
.state(ProcessState.RUNNING)
.host("10.244.16.10")
.usage(processUsage)
.uptime(new Long(9042))
.memoryQuota(new Long(268435456))
.diskQuota(new Long(1073741824))
.fileDescriptorQuota(new Long(16384))
.build();
GetApplicationProcessStatisticsResponse.builder()
.resource(processStatisticsResource)
.build();
}
}