zalk 的状态统计
一个 Fabric 模组,用于将硬件、性能和玩家事件记录到游戏日志中,从而更轻松地排查 Bug 和性能问题。
记录内容
启动时(仅一次):
- 环境类型(客户端或服务器)及模组版本
- Fabric Loader 版本
- Java 版本与虚拟机名称
- 操作系统名称、版本及架构
- 可用处理器数量
- JVM 已用内存与最大内存
- CPU 型号、物理/逻辑核心数以及 1 秒 CPU 负载采样
- 总内存与可用内存
硬件探测在后台守护线程上运行,因此 1 秒 CPU 负载采样不再阻塞游戏启动。
仅限客户端:
- 当 FPS 持续 10 秒处于或低于你的阈值时,发出低 FPS 警告。仅记录一次,不会刷屏。
- 当 FPS 回升至恢复阈值以上时,发送一次恢复通知。
- 按你设定的间隔输出 FPS 摘要(平均值与最低值)。
仅限服务器:
- 按你设定的间隔输出 TPS(1 分钟 / 5 分钟 / 15 分钟)
- 专用服务器上,JVM 堆内存使用情况(附带每次报告的增量)
- 玩家加入与断开连接事件
- 服务器启动与停止,以及运行时长
配置
设置保存在 .minecraft/config/zalks-stats.json 中,也可在游戏内通过 Mod Menu 界面进行编辑。建议安装 Mod Menu,但非必需。
| 设置项 |
选项 |
默认值 |
| 低 FPS 警告阈值 |
10–90 FPS |
20 |
| FPS 恢复阈值 |
10–120 FPS |
30 |
| FPS 摘要间隔 |
60, 120, 300, 600, 900 秒 |
300 |
| TPS 间隔 |
1, 2, 5, 10, 20, 30 秒 |
5 |
| 堆内存间隔 |
60, 120, 300, 600, 900 秒 |
300 |
| 日志开关 |
hardware, environment, FPS, TPS, heap, player join/leave, server lifecycle |
全部开启 |
加载和保存时会对数值进行钳制,因此手动编辑或损坏的配置文件绝不会让模组陷入不合逻辑的状态。恢复阈值始终保持在警告阈值之上,以防止警告立即重新触发。
要求
- Minecraft 26.3
- Fabric Loader 0.19.5 或更高版本
- Java 25 或更高版本
- Fabric API
- Mod Menu(可选,用于提供设置界面)
同时适用于客户端和专用服务器。客户端专属代码不会在服务器上加载。
安装
- 为 Minecraft 26.3 安装 Fabric Loader 和 Fabric API。
- 下载
zalks-stats-1.4.2.jar。
- 将其放入你的
mods 文件夹。
- 启动游戏。
构建
git clone https://github.com/zallkyre/zalks-stats.git
cd zalks-stats
./gradlew build
构建生成的 jar 文件位于 build/libs/ 中。需要 Java 25 或更高版本。
许可证
发布于公共领域。请参阅 LICENSE 文件。
zalk's stats
A Fabric mod that logs hardware, performance, and player events to the game log, so bugs and performance problems are easier to trace.
What it logs
At startup, once:
- Environment type (client or server) and mod version
- Fabric Loader version
- Java version and VM name
- OS name, version, and architecture
- Available processors
- JVM memory used vs max
- CPU model, physical/logical core count, and a 1-second CPU load sample
- Total and available RAM
The hardware probe runs on a background daemon thread, so the one-second CPU load sample no longer stalls game start-up.
Client only:
- Low-FPS warning when FPS stays at or below your threshold for 10 seconds. Logged once, not spammed.
- Recovery notice once FPS climbs back to your recovery threshold.
- FPS summary (average and minimum) on your chosen interval.
Server only:
- TPS 1m / 5m / 15m on your chosen interval
- JVM heap usage with per-report delta, on a dedicated server
- Player join and disconnect events
- Server start and stop, with uptime
Configuration
Settings live in .minecraft/config/zalks-stats.json and can be edited in-game from the Mod Menu screen. Mod Menu is suggested, not required.
| Setting |
Options |
Default |
| Low-FPS warning threshold |
10-90 FPS |
20 |
| FPS recovery threshold |
10-120 FPS |
30 |
| FPS summary interval |
60, 120, 300, 600, 900 s |
300 |
| TPS interval |
1, 2, 5, 10, 20, 30 s |
5 |
| Heap interval |
60, 120, 300, 600, 900 s |
300 |
| Log toggles |
hardware, environment, FPS, TPS, heap, player join/leave, server lifecycle |
all on |
Values are clamped on load and save, so a hand-edited or corrupted config can never leave the mod in a nonsensical state. The recovery threshold is always kept above the warning threshold, so the warning cannot immediately re-arm itself.
Requirements
- Minecraft 26.3
- Fabric Loader 0.19.5 or newer
- Java 25 or newer
- Fabric API
- Mod Menu (optional, for the settings screen)
Works on both the client and a dedicated server. Client-only code is not loaded on a server.
Installation
- Install Fabric Loader and Fabric API for Minecraft 26.3.
- Download
zalks-stats-1.4.2.jar.
- Put it in your
mods folder.
- Launch the game.
Building
git clone https://github.com/zallkyre/zalks-stats.git
cd zalks-stats
./gradlew build
The built jar appears in build/libs/. Java 25 or newer is required.
License
Released into the public domain. See the LICENSE file.
评论 0
登录后参与评分
还没有评论,来抢沙发吧