
UnifiedMetrics 是一款功能齐全、免费且开源的 Minecraft 服务器指标收集插件。本项目遵循 GNU LGPLv3 许可证授权。
开箱即用的仪表板 包含在内!
点击 此处 查看实时预览!
特性
- 跨平台且兼容主流平台。在任何支持的平台上获取相同的指标和功能。
- 实时监控你的服务器,支持 Prometheus/InfluxDB 以及提供的 Grafana 仪表板。
- 高性能 指标收集。对服务器性能的影响极低或无影响。
- 免费且开源。代码免费开放,任何人都可以审查和贡献。
兼容性
服务器:
- 1.8+ Spigot 服务器 (包括基于 Spigot 的分叉版本)
- 1.16+ Fabric 服务器
- Minestom
- Velocity
- BungeeCord
指标:
快速开始
阅读 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:
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 signArchives is 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()
评论 0
登录后参与评分
还没有评论,来抢沙发吧