Skip to content

Conversation

@jmarkerink
Copy link

No description provided.

response.append("system", new Document()
.append("currentTime", Instant.now())
.append("hostname", Utils.getHostName())
.append("cpuArch", System.getProperty("os.arch"))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets extend AbstractBackendTest#testHostInfo like this:

     @Test
     void testHostInfo() {
         Document result = runCommand("hostInfo");
         assertThat(result.get("ok")).isEqualTo(1.0);
         assertThat(result).containsKeys("os", "system", "extra");
+        assertThat(result.get("system", Document.class)).containsKeys("currentTime", "hostname", "cpuArch");
     }

.append("versionString", osName + " " + osVersion)
.append("kernelVersion", osVersion));
.append("kernelVersion", osVersion)
.append("physicalCores", Runtime.getRuntime().availableProcessors()));
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the behavior of an official MongoDB server?

I cannot find it in the docs: https://www.mongodb.com/docs/manual/reference/method/db.hostInfo/

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jmarkerink jmarkerink changed the title feat: extended hostInfo with cpuArch and physicalCores feat: extended hostInfo with cpuArch and numCores Jan 12, 2026
@jmarkerink jmarkerink requested a review from bwaldvogel January 12, 2026 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants