-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #136 from assimbly/feature/health-check-jvm
health check endpoint - jvm stats
- Loading branch information
Showing
4 changed files
with
127 additions
and
0 deletions.
There are no files selected for viewing
57 changes: 57 additions & 0 deletions
57
dil/src/main/java/org/assimbly/dil/validation/stats/BackendResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
package org.assimbly.dil.validation.stats; | ||
|
||
import org.codehaus.jackson.annotate.JsonIgnore; | ||
|
||
import java.lang.management.ManagementFactory; | ||
import java.lang.management.OperatingSystemMXBean; | ||
import java.lang.management.ThreadMXBean; | ||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
public class BackendResponse { | ||
|
||
public enum StatusTag { | ||
OK, TROUBLING, FAILING | ||
} | ||
|
||
@JsonIgnore | ||
private final OperatingSystemMXBean operatingSystemMXBean = ManagementFactory.getOperatingSystemMXBean(); | ||
private final ThreadMXBean threadMXBean = ManagementFactory.getThreadMXBean(); | ||
|
||
private Map<String, Object> jvm = new HashMap<>(); | ||
private Map<String, Long> memory = new HashMap<>(); | ||
private Map<String, Integer> threads = new HashMap<>(); | ||
|
||
|
||
public Map<String, Long> getMemory() { | ||
return memory; | ||
} | ||
public void setMemory(Map<String, Long> memory) { | ||
this.memory = memory; | ||
} | ||
public void addMemory(String key, Long value) { | ||
this.memory.put(key, value); | ||
} | ||
|
||
public Map<String, Integer> getThreads() { | ||
return threads; | ||
} | ||
public void setThreads(Map<String, Integer> threads) { | ||
this.threads = threads; | ||
} | ||
public void addThread(String key, Integer value) { | ||
this.threads.put(key, value); | ||
} | ||
|
||
public Map<String, Object> getJvm() { | ||
return jvm; | ||
} | ||
public void setJvm(Map<String, Object> jvm) { | ||
this.jvm = jvm; | ||
} | ||
public void addJvm(String key, Object value) { | ||
this.jvm.put(key, value); | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters