
UnifiedMetrics 是一款功能齐全、免费且开源的 Minecraft 服务器指标收集插件。本项目遵循 GNU LGPLv3 许可证授权。
特性
- 跨平台且兼容主流平台。在任何支持的平台上获取相同的指标和功能。
- 实时监控你的服务器,支持 Prometheus/InfluxDB 以及提供的 Grafana 仪表板。
- 高性能 指标收集。对服务器性能的影响极低或无影响。
- 免费且开源。代码免费开放,任何人都可以审查和贡献。
兼容性
服务器:
- 1.8+ Spigot 服务器 (包括基于 Spigot 的分叉版本)
- 1.16+ Fabric 服务器
- Minestom
- Velocity
- BungeeCord
指标:
- Prometheus
- InfluxDB
快速开始
阅读 Wiki 以获取入门指南。
指标
指标列表(点击显示)
| Collector | Description | Platform | Default |
|---|---|---|---|
| systemGc | 垃圾回收持续时间和释放字节数 | All | true |
| systemMemory | 已用内存、承诺内存、最大内存和初始内存 | All | true |
| systemProcess | CPU 负载、秒数和进程启动时间 | All | true |
| systemThread | 当前线程数、守护进程线程数、已启动线程数和峰值线程数 | All | true |
| events | 登录、加入、退出、聊天和延迟事件计数器 | All | true |
| server | 插件数量和玩家数量 | All | true |
| tick | Tick 持续时间直方图 | Bukkit, Minestom | true |
| world | 世界实体、玩家和区块数量 | Bukkit, Minestom | true |
特别感谢
Bloom Host 慷慨地为 UnifiedMetrics 提供了开发服务器。 Bloom 内置了服务器拆分功能,使得构建监控堆栈变得极其简单。通过 此链接 在 Bloom 获取高性能服务器。
YourKit 通过创新和智能工具支持开源项目,用于监控和分析 Java 和 .NET 应用程序。YourKit 是 YourKit Java Profiler、 YourKit .NET Profiler 和 YourKit YouMonitor 的创建者。
从源码构建
说明(点击显示)
要求:
- JDK 8+(Fabric 需要 16+,Minestom 需要 17+)
- Git(可选)
要构建 UnifiedMetrics,首先需要获取源代码。你可以从 GitHub 下载源代码或使用 Git CLI。
$ git clone https://github.com/Cubxity/UnifiedMetrics && cd UnifiedMetrics
在克隆的目录中打开终端并运行以下命令。以下命令将构建所有子项目。
$ ./gradlew assemble -x signArchives
-x signArchives用于跳过签名,除非你已经设置了签名
要构建特定的子项目,可以在其前面加上子项目路径。例如:
$ ./gradlew :unifiedmetrics-platform-bukkit:assemble -x signArchives
输出产物位于 subproject/build/libs 中。
API
说明(点击显示)
示例
示例插件可在 examples 目录下找到。
Gradle (Kotlin)
repositories {
mavenCentral()
maven("https://s01.oss.sonatype.org/content/repositories/snapshots/")
}
dependencies {
// ...
compileOnly("dev.cubxity.plugins", "unifiedmetrics-api", "0.3.3-SNAPSHOT")
}
用法
将 :unifiedmetrics-api 添加为依赖项(compileOnly/provided)。如果可能,优先使用平台的 Service Manager。
import dev.cubxity.plugins.metrics.api.UnifiedMetricsProvider
/* ... */
val api = UnifiedMetricsProvider.get()

UnifiedMetrics is a fully-featured free and open-source metrics collection plugin for Minecraft servers. This project is licensed under GNU LGPLv3.
Dashboard included out-of-box!
Click here for live preview!
Features
- Platform-agnostic & compatible with popular platforms. Get the same metrics and features on any supported platform.
- Monitor your server in real-time with Prometheus/InfluxDB and provided Grafana dashboards.
- High performance metric collection. Low to none performance impact on the server's performance.
- Free and open-source. The code is free and open for anyone to audit and contribute to.
Compatibility
Server:
- 1.8+ Spigot servers (includes Spigot-based forks)
- 1.16+ Fabric servers
- Minestom
- Velocity
- BungeeCord
Metrics:
- Prometheus
- InfluxDB
Getting started
Read the wiki for instructions on how to get started.
Metrics
Table of metrics (click to show)
| Collector | Description | Platform | Default |
|---|---|---|---|
| systemGc | Garbage collection duration and freed bytes | All | true |
| systemMemory | Memory used, committed, max and init | All | true |
| systemProcess | CPU load, seconds, and process start time | All | true |
| systemThread | Current, daemon, started, and peak thread count | All | true |
| events | Login, join, quit, chat, and ping event counter | All | true |
| server | Plugins count and player counts | All | true |
| tick | Tick duration histogram | Bukkit, Minestom | true |
| world | World entities, players, and chunks count | Bukkit, Minestom | true |
Special Thanks
Bloom Host has kindly provided UnifiedMetrics with development servers. Bloom has server splitting built-in, which makes it extremely easy to build your monitoring stack. Get high performance servers at Bloom by using this link.
YourKit supports open source projects with innovative and intelligent tools for monitoring and profiling Java and .NET applications. YourKit is the creator of YourKit Java Profiler, YourKit .NET Profiler, and YourKit YouMonitor.
Building from source
Instructions (click to show)
Requirements:
- JDK 8+ (16+ for Fabric, 17+ for Minestom)
- Git (Optional)
To build UnifiedMetrics, you need to obtain the source code first. You can download the source from GitHub or use the Git CLI.
$ git clone https://github.com/Cubxity/UnifiedMetrics && cd UnifiedMetrics
Open a terminal in the cloned directory and run the following command. The following command will build all subprojects.
$ ./gradlew assemble -x signArchives
-x signArchivesis required to skip signing, unless you have signing set up
To build a specific subproject, you can prefix it with the subproject path. For example:
$ ./gradlew :unifiedmetrics-platform-bukkit:assemble -x signArchives
The output artifacts can be found in subproject/build/libs.
API
Instructions (click to show)
Examples
Example plugins can be found under examples directory.
Gradle (Kotlin)
repositories {
mavenCentral()
maven("https://s01.oss.sonatype.org/content/repositories/snapshots/")
}
dependencies {
// ...
compileOnly("dev.cubxity.plugins", "unifiedmetrics-api", "0.3.3-SNAPSHOT")
}
Usage
Add :unifiedmetrics-api as a dependency (compileOnly/provided). Prefer using platform's service manager if possible.
import dev.cubxity.plugins.metrics.api.UnifiedMetricsProvider
/* ... */
val api = UnifiedMetricsProvider.get()
下载 UnifiedMetrics
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 UnifiedMetrics
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 UnifiedMetrics
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 UnifiedMetrics
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 UnifiedMetrics
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 UnifiedMetrics
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 UnifiedMetrics
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 UnifiedMetrics
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 UnifiedMetrics
下载 UnifiedMetrics
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
错误修复
- deps: 更新所有非主要依赖项 (#75) (renovate[bot])
- deps: 更新所有非主要依赖项 (#76) (renovate[bot])
- deps: 更新所有非主要依赖项 (#79) (renovate[bot])
- build: 依赖问题 (Cubxity)
- gitignore 和 .idea 目录 (Cubxity)
- velocity: 登录计数器指标 (Cubxity)
- deps: 更新所有非主要依赖项 (#82) (renovate[bot])
- deps: 更新所有非主要依赖项 (#92) (renovate[bot])
- build: signArchives 和 shadowJar (Cubxity)
- build: signArchives 和 shadowJar (Cubxity)
- build: fabric compileJava (Cubxity)
- build: java 目标版本 (Cubxity)
构建
- minestom: 升级依赖项 (Cubxity)
杂项
- 改进 renovate 配置 (Cubxity)
- 版本号提升至 0.3.8-SNAPSHOT (Cubxity)
- deps: 从 renovate 中排除 fabric yarn (Cubxity)
- deps: 更新所有非主要依赖项 (#81) (renovate[bot])
- deps: 更新所有非主要依赖项 (#89) (renovate[bot])
- deps: 将 gradle 依赖项更新至 v8 (#88) (renovate[bot])
- deps: 将 com.github.johnrengelman.shadow 插件更新至 v8 (#91) (renovate[bot])
- deps: 更新所有非主要依赖项 (#93) (renovate[bot])
- deps: 更新 minestom 依赖项 (Cubxity)
- 版本号提升至 0.3.8 (Cubxity)
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
插件
PacketEvents 是一款专为 Minecraft Java 版打造的协议库,旨在简化数据包的处理与传输。
插件
ExyliaPlugins 的库。
插件
通过对话框或铁砧界面帮助你的 Anthme
插件
重新定义服务器上的生物运输方式。使用高度可定制的口袋道具,安全地捕获、存储和释放任何实体。
插件
为基于 Spigot/Paper/Folia 的服务器添加对 Vivecraft 的支持
插件
用于绘制游戏内地图或在浏览器中随探索实时进行地图绘制的实时地图。
评论 0
登录后参与评分
还没有评论,来抢沙发吧