Skip to content

Commit ce6e390

Browse files
chore(deps): update from template
1 parent 425ef3a commit ce6e390

4 files changed

Lines changed: 36 additions & 6 deletions

File tree

.copier-answers.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
_commit: v0.16.9
1+
_commit: v0.16.10
22
_src_path: gh:helmut-hoffer-von-ankershoffen/oe-python-template
33
attestations_enabled: true
44
author_email: helmuthva@gmail.com

ATTRIBUTIONS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12189,7 +12189,7 @@ License: LGPL-2.1-or-later
1218912189

1219012190
```
1219112191

12192-
## oe-python-template-example (0.4.17) - MIT License
12192+
## oe-python-template-example (0.4.18) - MIT License
1219312193

1219412194
🧠 Example project scaffolded and kept up to date with OE Python Template (oe-python-template).
1219512195

CLI_REFERENCE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ $ oe-python-template-example [OPTIONS] COMMAND [ARGS]...
1414
* `--show-completion`: Show completion for the current shell, to copy it or customize the installation.
1515
* `--help`: Show this message and exit.
1616

17-
🧠 OE Python Template Example v0.4.17 - built with love in Berlin 🐻
17+
🧠 OE Python Template Example v0.4.18 - built with love in Berlin 🐻
1818

1919
**Commands**:
2020

src/oe_python_template_example/system/_service.py

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,15 @@ def info(include_environ: bool = False, filter_secrets: bool = True) -> dict[str
151151
Returns:
152152
dict[str, Any]: Service configuration.
153153
"""
154+
import psutil # noqa: PLC0415
154155
from uptime import boottime, uptime # noqa: PLC0415
155156

156157
bootdatetime = boottime()
158+
vmem = psutil.virtual_memory()
159+
swap = psutil.swap_memory()
160+
cpu_percent = psutil.cpu_percent(interval=5)
161+
cpu_times_percent = psutil.cpu_times_percent(interval=5)
162+
157163
rtn: InfoDict = {
158164
"package": {
159165
"version": __version__,
@@ -177,9 +183,33 @@ def info(include_environ: bool = False, filter_secrets: bool = True) -> dict[str
177183
"version": platform.version(),
178184
},
179185
"machine": {
180-
"arch": platform.machine(),
181-
"processor": platform.processor(),
182-
"cpu_count": os.cpu_count(),
186+
"cpu": {
187+
"percent": cpu_percent,
188+
"load_avg": psutil.getloadavg(),
189+
"user": cpu_times_percent.user,
190+
"system": cpu_times_percent.system,
191+
"idle": cpu_times_percent.idle,
192+
"arch": platform.machine(),
193+
"processor": platform.processor(),
194+
"count": os.cpu_count(),
195+
"frequency": psutil.cpu_freq(),
196+
},
197+
"memory": {
198+
"percent": vmem.percent,
199+
"total": vmem.total,
200+
"available": vmem.available,
201+
"used": vmem.used,
202+
"free": vmem.free,
203+
"active": vmem.active,
204+
"inactive": vmem.inactive,
205+
"wired": vmem.wired,
206+
},
207+
"swap": {
208+
"percent": swap.percent,
209+
"total": swap.total,
210+
"used": swap.used,
211+
"free": swap.free,
212+
},
183213
},
184214
"network": {
185215
"hostname": platform.node(),

0 commit comments

Comments
 (0)