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 3b36407 commit f728303
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 @@ -24,6 +24,7 @@ classifiers = [
]

dependencies = [
"psutil",
"requests",
"schedule",
"tomlkit"
Expand Down
4 changes: 2 additions & 2 deletions src/endstone_bstats/_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, Callable, Dict

import psutil
from endstone.plugin import Plugin

from endstone_bstats._base import MetricsBase
Expand Down Expand Up @@ -71,7 +71,7 @@ def append_platform_data(self, platform_data: Dict[str, Any]) -> None:
platform_data["osVersion"] = platform.release()

platform_data["osArch"] = platform.machine().lower()
platform_data["coreCount"] = os.cpu_count()
platform_data["coreCount"] = psutil.cpu_count(logical=False)

def append_service_data(self, service_data: Dict[str, Any]):
"""
Expand Down

0 comments on commit f728303

Please sign in to comment.