Skip to content

Commit b854cd1

Browse files
authored
Merge pull request #245 from jmarkerink/feat/extend-hostInfo
feat: extended hostInfo with cpuArch and numCores
2 parents a5781c8 + efa0076 commit b854cd1

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

core/src/main/java/de/bwaldvogel/mongo/backend/AbstractMongoBackend.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,8 @@ private Document handleHostInfo() {
223223
response.append("system", new Document()
224224
.append("currentTime", Instant.now())
225225
.append("hostname", Utils.getHostName())
226+
.append("numCores", Runtime.getRuntime().availableProcessors())
227+
.append("cpuArch", System.getProperty("os.arch"))
226228
);
227229
response.append("extra", new Document()
228230
.append("versionString", osName + " " + osVersion)

test-common/src/main/java/de/bwaldvogel/mongo/backend/AbstractBackendTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6647,6 +6647,7 @@ void testHostInfo() {
66476647
Document result = runCommand("hostInfo");
66486648
assertThat(result.get("ok")).isEqualTo(1.0);
66496649
assertThat(result).containsKeys("os", "system", "extra");
6650+
assertThat(result.get("system", Document.class)).containsKeys("currentTime", "hostname", "numCores", "cpuArch");
66506651
}
66516652

66526653
@Test

0 commit comments

Comments
 (0)