Skip to content

Commit

Permalink
feat: use psutil to get physical processor count instead of os.cpu_count
Browse files Browse the repository at this point in the history
  • Loading branch information
wu-vincent committed Sep 9, 2024
1 parent ede1674 commit c16d9d2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ dependencies = [
"importlib-resources",
"numpy",
"packaging",
"psutil",
"requests",
"rich",
"tomlkit",
Expand Down
4 changes: 2 additions & 2 deletions python/src/endstone/_internal/metrics.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import os
import platform
from pathlib import Path
from typing import Any, Dict

import psutil
from endstone import Server
from endstone_bstats import MetricsBase, MetricsConfig, SimplePie, AdvancedPie, DrilldownPie, SingleLineChart

Expand Down Expand Up @@ -53,7 +53,7 @@ def append_platform_data(self, platform_data: Dict[str, Any]) -> None:
if os_arch == "x86_64":
os_arch = "amd64"
platform_data["osArch"] = os_arch
platform_data["coreCount"] = os.cpu_count()
platform_data["coreCount"] = psutil.cpu_count(logical=False)

def log_info(self, message: str) -> None:
self._server.logger.info(message)
Expand Down

0 comments on commit c16d9d2

Please sign in to comment.