为什么选择 PerformanceAnalyzer?
大多数监控插件只会告诉你服务器正在卡顿。而 PerformanceAnalyzer 会告诉你为什么。
当 TPS 下降或 MSPT 飙升时,该插件会自动捕获服务器状态的完整快照——包括已加载区块、实体数量、玩家活动、可疑模组等——让你能够立即诊断问题,而不是盲目猜测。
⚡ v3.0.0 新增功能
- AntiCheat 现已成为独立插件。 PerformanceAnalyzer 现在是一个专注的纯性能监控工具。XRay/移动检测功能已移至独立的 BSAnticheat 插件中——将其与 PerformanceAnalyzer 一同安装后,GUI 将自动链接两者。
- 每秒检测性能下降——性能下降现以每秒一次的频率采样(与数据库日志记录间隔解耦),因此不会遗漏短暂的峰值。
- REST API 已上线——为 Grafana/Prometheus 仪表盘提供 JSON 端点。
- 开发者 API——其他插件可以读取实时的 TPS/MSPT/堆内存/实体数据。
主要功能
实时性能监控
- TPS、MSPT 和堆内存跟踪,附带历史数据和 ASCII 迷你图
- Spark 集成,用于获取高精度的 TPS(10秒/1分钟/5分钟)、MSPT(平均值/p95/最大值)和 CPU 数据
- ProtocolLib 集成,用于数据包分析和洪水检测
- 数据库日志记录(SQLite 或 MySQL),通过 HikariCP 实现异步批量写入
- 备用文件日志记录——如果数据库不可用,指标将被写入文件而非丢失
自动卡顿诊断
- 性能下降检测——当 TPS 下降或 MSPT 飙升时自动触发,采样频率为每秒一次
- 完整服务器快照——在下降发生的瞬间捕获区块、实体、内存和玩家位置
- 准确的低/高值跟踪——报告下降窗口期间实际遇到的最差 TPS/MSPT
- 卡顿来源分析——识别最可能导致问题的玩家和模组
- 问题区块检测——找出被大量方块实体或红石过载的区块
- 区块频繁加载/卸载检测——定位那些加载/卸载过于频繁的区块
- 节流且安静——昂贵的深度分析受到速率限制,除非开启调试模式,否则不会输出到控制台,从而确保诊断过程本身不会加剧卡顿
交互式 GUI 系统
- 性能仪表盘——实时显示 TPS、MSPT、堆内存,支持自动刷新
- 卡顿分析页面——展示前 5 名活跃玩家和可疑模组及其风险评分
- 性能下降页面——浏览最近最多 21 次下降事件,点击可查看详细报告
- 配置 GUI——无需修改配置文件即可切换设置
- 伴侣检测——当安装了 AntiCheat 插件时,显示 BSAntiCheat 状态
- 多页导航、颜色编码的项目、直观的设计
静音模式 / 主播模式
/perfsilent—— 屏蔽聊天中的所有警报通知/perfsilent performance—— 仅屏蔽性能警报类别/perfsilent list—— 查看当前偏好设置/perfsilent reset—— 重新接收所有警报- 重启服务器后保持有效
- 非常适合不需要持续通知的主播、建筑师或管理员
Discord Webhook 集成
- 自动发送 TPS 下降、高 MSPT、堆内存警告和数据包洪水的通知
- 每种警报类型使用颜色编码的嵌入消息
- 可配置:精确选择哪些事件会被报告
- 异步、限速的 HTTP 请求——零性能影响
- 防 SSRF 保护:仅接受有效的 Discord webhook URL
自动实体清理器
- 基于优先级的移除:物品 > 投射物 > 怪物 > 动物
- 保护命名实体、驯服动物、村民和 Boss 怪物
- 支持按世界和按区块设置上限
- 提供试运行模式,以便在启用前进行安全测试
其他工具
- 世界统计 (
/worldstats) —— 每个世界的实体、区块、密度及趋势分析 - 实体分析 (
/entitystats) —— 按类别细分,热点检测 - 区块统计 (
/chunkstats) —— 加载跟踪、问题区块、频繁加载/卸载检测 - REST API —— 带 API 密钥认证的 JSON 端点,适用于 Grafana/Prometheus 仪表盘
- 开发者 API ——
PerformanceAPI,供其他插件读取实时指标 - 自动数据库清理 —— 可配置保留期(默认:30 天)
- 多语言支持 —— 英语 & 德语,易于扩展
命令
| 命令 | 描述 | 权限 |
|---|---|---|
/perfstatus |
实时 TPS、MSPT、堆内存数据 | performance.status |
/perfhistory [min] |
历史 MSPT 迷你图及统计信息 | performance.history |
/perfgui |
打开交互式 GUI | performance.gui |
/perfreload |
重载插件配置 | performance.admin |
/perfsilent [type] |
切换警报通知(主播模式) | performance.admin |
/perfdrops [#] |
查看/分析性能下降事件 | performance.admin |
/worldstats [world] |
按世界统计(别名 /ws) |
performance.admin |
/entitystats [world] |
实体分析及热点(别名 /es) |
performance.admin |
/chunkstats [sub] |
区块加载跟踪及问题(别名 /cs) |
performance.admin |
权限
| 权限 | 描述 | 默认值 |
|---|---|---|
performance.status |
使用 /perfstatus |
所有人 |
performance.history |
使用 /perfhistory |
所有人 |
performance.gui |
使用 /perfgui |
所有人 |
performance.admin |
管理命令及警报通知 | OP |
performance.silent |
使用静音模式屏蔽警报 | OP |
配置亮点
数据库 (SQLite 或 MySQL)
database:
type: sqlite # 或 'mysql'
sqlite_file: "plugins/PerformanceAnalyzer/perf.db"
retention_days: 30 # 自动清理(0 = 禁用)
fallback_file_logging: true # 如果数据库不可用时,记录到文件
fallback_log_file: "plugins/PerformanceAnalyzer/fallback.log"
pool:
max_pool_size: 10
minimum_idle: 2
性能阈值
thresholds:
mspt: 50.0 # MSPT 警告 (ms)
heap_usage_percent: 80.0 # 堆内存警告 (%)
tps_drop: 19.0 # TPS 下降警告
packet_flood_per_tick: 1000.0 # 数据包洪水检测
延迟分析阈值
所有阈值均可根据您的硬件进行调整:
lag_analysis:
player_tracking: true
plugin_analysis: true
chunk_analysis_timeout_ms: 5000
# 区块阈值(标准 | 高性能 | 低配)
chunk_tile_entities_threshold: 10 # 10 | 20-30 | 5-8
chunk_redstone_threshold: 30 # 30 | 50-100 | 15-20
chunk_entity_warning: 50 # 50 | 80-100 | 30-40
chunk_entity_critical: 100 # 100 | 150-200 | 60-80
# 世界阈值
world_entity_warning: 5000
world_entity_critical: 10000
Discord Webhook
discord:
enabled: false
webhook_url: ""
alert_types:
high_mspt: true
tps_drop: true
high_heap: true
packet_flood: true
REST API
api:
enabled: false
port: 8080
key: "changeme" # 重要:请设置一个安全的密钥!否则服务器将无法启动。
端点:/api/health, /api/metrics, /api/worlds, /api/trends
认证方式:Authorization: Bearer <key>
自动实体清理
entity_cleaner:
enabled: false
interval_seconds: 300
world_limit: 5000
chunk_limit: 100
dry_run: true # 测试模式(仅记录日志,不执行移除操作)
protect_villagers: true
protect_item_frames: true
blacklist: ["ENDER_DRAGON", "WITHER", "WARDEN"]
world_whitelist: [] # 永不进行清理的世界列表
开发者 API
其他插件可以直接读取实时性能数据:
PerformanceAPI api = (PerformanceAPI) Bukkit.getPluginManager().getPlugin("PerformanceAnalyzer");
double tps = api.getCurrentTPS();
double mspt = api.getCurrentMSPT();
double heap = api.getHeapUsagePercent();
int entities = api.getTotalEntityCount();
语言支持
内置英文和德文。语言文件位于 plugins/PerformanceAnalyzer/lang/,支持完全自定义。
添加新语言:
- 将
en.yml复制并重命名为您的语言代码(例如fr.yml) - 翻译所有消息内容
- 在
config.yml中设置language: fr - 运行命令
/perfreload
寻找反作弊?
自 v3.0.0 版本起,XRay 和移动检测功能已移至其专属插件:BSAntiCheat。建议同时安装这两个插件——PerformanceAnalyzer 负责性能和延迟诊断,BSAntiCheat 负责作弊检测,并通过 GUI 将它们关联起来。
可选依赖
| 插件 | 优势 |
|---|---|
| spark | 精确的 TPS(10秒/1分钟/5分钟)、MSPT(平均/95百分位/最大值)、CPU 监控 |
| ProtocolLib | 数据包分析与洪水检测 |
| BSAntiCheat | 配套反作弊插件(XRay 与移动检测) |
所有集成均为可选——该插件可完全独立运行。
环境要求
- Java 21
- Paper 1.21.4 – 1.21.x
- 线程安全,异步操作,极低的性能开销
配置自动迁移
更新时,您现有的配置文件绝不会被覆盖。新设置会自动以合理的默认值添加。只需替换 JAR 文件并重启服务器即可。
特别感谢
感谢 ELITEK3V 进行测试。
Why PerformanceAnalyzer?
Most monitoring plugins tell you that your server is lagging. PerformanceAnalyzer tells you why.
When a TPS drop or MSPT spike occurs, the plugin automatically captures a full snapshot of your server state — loaded chunks, entity counts, player activity, suspect plugins — so you can diagnose the problem instantly instead of guessing.
⚡ New in v3.0.0
- AntiCheat is now its own plugin. PerformanceAnalyzer is now a focused, pure performance monitor. The XRay/Movement detection lives on in the standalone BSAntiCheat plugin — install it alongside PerformanceAnalyzer and the GUI will link the two together automatically.
- Per-second drop detection — performance drops are now sampled every second (decoupled from the database logging interval), so short-lived spikes are no longer missed.
- REST API is live — JSON endpoints for Grafana/Prometheus dashboards.
- Developer API — other plugins can read live TPS/MSPT/heap/entity data.
Key Features
Real-Time Performance Monitoring
- TPS, MSPT & Heap tracking with historical data and ASCII sparklines
- Spark Integration for highly accurate TPS (10s/1m/5m), MSPT (avg/p95/max), and CPU data
- ProtocolLib Integration for packet analysis and flood detection
- Database Logging (SQLite or MySQL) with async batch writes via HikariCP
- Fallback File Logging — if the database goes down, metrics are written to a file instead of being lost
Automatic Lag Diagnosis
- Performance Drop Detection — triggers automatically when TPS drops or MSPT spikes, sampled every second
- Full Server Snapshots — captures chunks, entities, memory, and player locations at the moment of the drop
- Accurate Low/High Tracking — reports the actual worst TPS/MSPT seen during the drop window
- Lag Source Analysis — identifies the players and plugins most likely responsible
- Problematic Chunk Detection — finds chunks overloaded with tile entities or redstone
- Chunk Thrashing Detection — spots chunks that load/unload too frequently
- Throttled & quiet — the expensive deep analysis is rate-limited and stays out of the console unless debug mode is on, so the diagnostics never make the lag worse
Interactive GUI System
- Performance Dashboard — live TPS, MSPT, heap with auto-refresh
- Lag Analysis Page — top 5 active players and suspect plugins with risk scores
- Performance Drops Page — browse up to 21 recent drops, click for detailed reports
- Config GUI — toggle settings without touching files
- Companion detection — shows BSAntiCheat status when the AntiCheat plugin is installed
- Multi-page navigation, color-coded items, intuitive design
Silent Mode / Streamer Mode
/perfsilent— mute all alert notifications in chat/perfsilent performance— mute just the performance alert category/perfsilent list— view your current preferences/perfsilent reset— receive all alerts again- Persistent across server restarts
- Perfect for streamers, builders, or admins who don't need constant notifications
Discord Webhook Integration
- Automatic notifications for TPS drops, high MSPT, heap warnings, and packet floods
- Color-coded embeds per alert type
- Configurable: choose exactly which events get reported
- Async, rate-limited HTTP requests — zero performance impact
- SSRF-protected: only valid Discord webhook URLs are accepted
Auto Entity Cleaner
- Priority-based removal: items > projectiles > monsters > animals
- Protects named entities, tamed animals, villagers, and boss mobs
- Per-world and per-chunk limits
- Dry-run mode for safe testing before enabling
Additional Tools
- World Statistics (
/worldstats) — entities, chunks, density, trend analysis per world - Entity Analysis (
/entitystats) — breakdown by category, hotspot detection - Chunk Statistics (
/chunkstats) — load tracking, problematic chunks, thrashing - REST API — JSON endpoints for Grafana/Prometheus dashboards with API key auth
- Developer API —
PerformanceAPIfor other plugins to read live metrics - Auto Database Cleanup — configurable retention (default: 30 days)
- Multi-Language — English & German, easily extensible
Commands
| Command | Description | Permission |
|---|---|---|
/perfstatus |
Live TPS, MSPT, heap data | performance.status |
/perfhistory [min] |
Historical MSPT sparkline & stats | performance.history |
/perfgui |
Open the interactive GUI | performance.gui |
/perfreload |
Reload plugin configuration | performance.admin |
/perfsilent [type] |
Toggle alert notifications (streamer mode) | performance.admin |
/perfdrops [#] |
View/analyze performance drops | performance.admin |
/worldstats [world] |
Per-world statistics (alias /ws) |
performance.admin |
/entitystats [world] |
Entity analysis & hotspots (alias /es) |
performance.admin |
/chunkstats [sub] |
Chunk load tracking & problems (alias /cs) |
performance.admin |
Permissions
| Permission | Description | Default |
|---|---|---|
performance.status |
Use /perfstatus |
Everyone |
performance.history |
Use /perfhistory |
Everyone |
performance.gui |
Use /perfgui |
Everyone |
performance.admin |
Admin commands & alert notifications | OP |
performance.silent |
Use silent mode to mute alerts | OP |
Configuration Highlights
Database (SQLite or MySQL)
database:
type: sqlite # or 'mysql'
sqlite_file: "plugins/PerformanceAnalyzer/perf.db"
retention_days: 30 # Auto-cleanup (0 = disabled)
fallback_file_logging: true # Log to file if the DB is unavailable
fallback_log_file: "plugins/PerformanceAnalyzer/fallback.log"
pool:
max_pool_size: 10
minimum_idle: 2
Performance Thresholds
thresholds:
mspt: 50.0 # MSPT warning (ms)
heap_usage_percent: 80.0 # Heap warning (%)
tps_drop: 19.0 # TPS drop warning
packet_flood_per_tick: 1000.0 # Packet flood detection
Lag Analysis Thresholds
All thresholds are adjustable for your hardware:
lag_analysis:
player_tracking: true
plugin_analysis: true
chunk_analysis_timeout_ms: 5000
# Chunk thresholds (Standard | Powerful | Weak)
chunk_tile_entities_threshold: 10 # 10 | 20-30 | 5-8
chunk_redstone_threshold: 30 # 30 | 50-100 | 15-20
chunk_entity_warning: 50 # 50 | 80-100 | 30-40
chunk_entity_critical: 100 # 100 | 150-200 | 60-80
# World thresholds
world_entity_warning: 5000
world_entity_critical: 10000
Discord Webhook
discord:
enabled: false
webhook_url: ""
alert_types:
high_mspt: true
tps_drop: true
high_heap: true
packet_flood: true
REST API
api:
enabled: false
port: 8080
key: "changeme" # IMPORTANT: Set a secure key! The server won't start otherwise.
Endpoints: /api/health, /api/metrics, /api/worlds, /api/trends
Authentication: Authorization: Bearer <key>
Auto Entity Cleaner
entity_cleaner:
enabled: false
interval_seconds: 300
world_limit: 5000
chunk_limit: 100
dry_run: true # Test mode (logs only, no removal)
protect_villagers: true
protect_item_frames: true
blacklist: ["ENDER_DRAGON", "WITHER", "WARDEN"]
world_whitelist: [] # Worlds that are never cleaned
Developer API
Other plugins can read live performance data directly:
PerformanceAPI api = (PerformanceAPI) Bukkit.getPluginManager().getPlugin("PerformanceAnalyzer");
double tps = api.getCurrentTPS();
double mspt = api.getCurrentMSPT();
double heap = api.getHeapUsagePercent();
int entities = api.getTotalEntityCount();
Language Support
English and German are included. Language files live in plugins/PerformanceAnalyzer/lang/ and are fully customizable.
Adding a new language:
- Copy
en.ymlto your language code (e.g.fr.yml) - Translate all messages
- Set
language: frinconfig.yml - Run
/perfreload
Looking for AntiCheat?
As of v3.0.0, the XRay and Movement detection has moved into its own dedicated plugin: BSAntiCheat. Install both side by side — PerformanceAnalyzer handles performance and lag diagnosis, BSAntiCheat handles cheat detection, and the GUI links them together.
Optional Dependencies
| Plugin | Benefit |
|---|---|
| spark | Accurate TPS (10s/1m/5m), MSPT (avg/p95/max), CPU monitoring |
| ProtocolLib | Packet analysis & flood detection |
| BSAntiCheat | Companion AntiCheat plugin (XRay & movement detection) |
All integrations are optional — the plugin works fully standalone.
Requirements
- Java 21
- Paper 1.21.4 – 1.21.x
- Thread-safe, async operations, minimal performance overhead
Config Auto-Migration
When updating, your existing config is never overwritten. New settings are automatically added with sensible defaults. Just replace the JAR and restart.
Special Thanks
To ELITEK3V for testing.
下载 PerformanceAnalyzer
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 PerformanceAnalyzer
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 PerformanceAnalyzer
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 PerformanceAnalyzer
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 PerformanceAnalyzer
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 PerformanceAnalyzer
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 PerformanceAnalyzer
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 PerformanceAnalyzer
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 PerformanceAnalyzer
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 PerformanceAnalyzer
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
[3.4.0] - 2026-11-25
Added
- 主线程采样器:按插件统计刻时间(任务、事件、命令)、实体类型、区块实体、区块 I/O、结构搜索和红石,精确到最耗时的代码路径及具体行。
- 卡顿检测:等待网络/数据库操作、文件 I/O、区块加载、锁或休眠时进行监控,包括刻与刻之间的停滞(由命令、玩家操作、排队任务引起)。
- 慢速刻会存储至数据库(
slow_tick),包含 60 帧的堆栈信息及其触发原因(玩家操作、命令、插件、实体、区块刻),并附带背后的游戏代码。 - 事件报告:每个已解决的事件以及每次持续 500 毫秒或以上的停滞都会被完整写入
incidents.log,记录在线玩家数量和近期行为(命令、传送、交易、战利品、末影之眼、延迟突增);时间戳包含所在区域编号,重启后编号连续递增。 - 服务器日志错误检测:刻异常、StackOverflowError/OutOfMemoryError、插件异常及中断的邻居更新链(可选告警
alerts.server_errors)。 - 可选的每区块邻居/方块更新计数功能(
lag_analysis.neighbor_updates,默认关闭)。 - 玩家延迟、网络尖峰(可选告警
alerts.network_spikes)、单人模式下的延迟突增(ping_jump)及连接超时(disconnect)。 - 内存趋势:若 GC 后老年代基线持续上升,将报告为疑似内存泄漏(
alerts.memory_trend)。 /perfstatus命令、REST API 和 Prometheus 中新增数据项。
Fixed
/perfhistory此前将超过 50 毫秒的分钟平均值误判为尖峰,且从未显示真实卡顿;现改为统计存储的慢速刻,并标识耗时最长的一次。- 默认的
expensive_commands配置项/此前匹配了所有命令,而非仅匹配 WorldEdit 命令。 - 启动阶段的 GC 暂停不再在启动宽限期结束后立即触发 WARNING 告警。
- 存档相关的告警抑制逻辑改为每个事件仅判定一次,因此被抑制的初始告警不会再跟随一条“已解决”状态的告警。
- 区块频繁重载(chunk churn)仅统计近期的重载次数;从 WARNING 升级的事件,其日期追溯至警告发出时。
- 数据库行现在携带测量时间而非刷新时间;长描述内容不再导致 MySQL 插入失败。
/perfreload命令现在正确应用player_tracking和log_interval_seconds配置。- 占位符检查现在使用实际加载的语言文件,并忽略不含格式参数的文本。
[3.3.0] - 2026-10-21
Fixed
/perfreload可在启动被拒(密钥为空、端口已被占用)后重新启用 REST API;在绑定/端口/密钥更改时会自动重启。- 尖刺评估现在以异步方式运行,而非在主线程卡顿的刻内执行。
- Discord Webhook 增加了连接/读取超时设置,并遵守 HTTP 429 状态码下的
Retry-After头信息。 - ZGC/Shenandoah 并发周期不再计入 GC 暂停时间。
- 关闭服务器时不再覆盖对
config.yml的手动编辑;配置保存现在是原子操作且会合并写入。 /perfsilent设置的单类别静音在玩家登出后依然保持有效。- 实体扫描已添加速率限制,过期的扫描结果不再作为事件原因上报。
- 缺失可选数据库驱动时改为回退而非禁用插件;SQLite 使用单一连接;MySQL 索引创建正常工作。
- 语言文件重载时,警告信息中不再显示原始键名;配置合并时不再重新添加已过时的 v2 告警类型。
- 当占位符在不同版本间发生变化时,语言文件中的文本将回退到内置文本,而不是显示
%s/%d(此前已在某条日志警告中提及此问题)。
Changed
- 在 Folia 上禁用了
/chunkstats概览、/entitystats和/worldstats(因跨区域访问受限);/perfincidents和 REST API 仍作为位置信号保留。 - 德语文本现在使用正确的变音符号(umlauts)。
Removed
- 别名
incidents、ps、silent和calibrate;请使用/perfincidents、/perfsilent、/perfcalibrate或pi/pc。
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
插件
PacketEvents 是一款专为 Minecraft Java 版打造的协议库,旨在简化数据包的处理与传输。
插件
ExyliaPlugins 的库。
插件
通过对话框或铁砧界面帮助你的 Anthme
插件
重新定义服务器上的生物运输方式。使用高度可定制的口袋道具,安全地捕获、存储和释放任何实体。
插件
为基于 Spigot/Paper/Folia 的服务器添加对 Vivecraft 的支持
插件
一个在游戏内运行的 Minecraft 地图编辑器! 支持选区、蓝图、复制粘贴、笔刷和脚本。 可在创造模式中使用,也可在生存模式中临时使用。
评论 0
登录后参与评分
还没有评论,来抢沙发吧