Merge branch 'memory'
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
package com.instana.robotshop.shipping;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Arrays;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@@ -22,6 +23,8 @@ public class Controller {
|
||||
|
||||
private String CART_URL = String.format("http://%s/shipping/", getenv("CART_ENDPOINT", "cart"));
|
||||
|
||||
public static List bytesGlobal = Collections.synchronizedList(new ArrayList<byte[]>());
|
||||
|
||||
@Autowired
|
||||
private CityRepository cityrepo;
|
||||
|
||||
@@ -35,6 +38,22 @@ public class Controller {
|
||||
return val;
|
||||
}
|
||||
|
||||
@GetMapping(path = "/memory")
|
||||
public int memory() {
|
||||
byte[] bytes = new byte[1024 * 1024 * 25];
|
||||
Arrays.fill(bytes,(byte)8);
|
||||
bytesGlobal.add(bytes);
|
||||
|
||||
return bytesGlobal.size();
|
||||
}
|
||||
|
||||
@GetMapping(path = "/free")
|
||||
public int free() {
|
||||
bytesGlobal.clear();
|
||||
|
||||
return bytesGlobal.size();
|
||||
}
|
||||
|
||||
@GetMapping("/health")
|
||||
public String health() {
|
||||
return "OK";
|
||||
|
Reference in New Issue
Block a user