为什么选择 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 —
PerformanceAPI for 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.yml to your language code (e.g. fr.yml)
- Translate all messages
- Set
language: fr in config.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.
评论 0
登录后参与评分
还没有评论,来抢沙发吧