Skip to content

Commit efa0076

Browse files
author
jmarkerink
committed
feat: changed physicalCores to numCores and extended unit test
1 parent d855217 commit efa0076

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,12 +223,12 @@ 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())
226227
.append("cpuArch", System.getProperty("os.arch"))
227228
);
228229
response.append("extra", new Document()
229230
.append("versionString", osName + " " + osVersion)
230-
.append("kernelVersion", osVersion)
231-
.append("physicalCores", Runtime.getRuntime().availableProcessors()));
231+
.append("kernelVersion", osVersion));
232232
Utils.markOkay(response);
233233
return response;
234234
}

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)