AH StatusAPI

插件

· 作者 MeisterAH_

在您的服务器上托管一个强大且安全的 REST API。 最适合构建您自己的仪表板——面向开发者和管理员

0 本站下载 0 关注 更新于 11 个月前

最新 2.5 · 1.21.10 · Paper / Spigot

一键开服(送7天)

AH StatusAPI

概述

ServerStatusAPI 是一款功能强大的安全 Minecraft 服务器监控插件,它收集全面的性能数据并通过 REST API 提供这些数据。它允许服务器管理员实时监视关键指标并分析历史数据,且不会影响服务器性能。

请注意,该插件仍处于测试阶段。

为了正常工作,服务器每天需要重启一次。

Ping 检测目前仅在玩家在线时有效。

功能

  • 实时监控服务器性能指标(TPS、RAM、CPU)
  • 通过 RESTful API 轻松集成外部工具和仪表板
  • 玩家追踪,包含游戏时间和 Ping 统计信息
  • 按世界监控实体,并提供按类型详细分布的数据
  • 历史记录用于趋势和性能分析
  • 可配置的数据采集,支持调整采集间隔
  • 使用 SQLite 进行数据库存储(可选择禁用)
  • 通过优化的数据采集实现资源友好
  • 自动删除旧的历史数据
  • CORS 集成
  • 速率限制
  • 记录 API 请求日志

即将推出!

  • 多世界支持
  • 控制台集成
  • 自定义 Discord 机器人用于服务器状态显示

配置

在开始使用之前,您需要在 config.yml 中指定服务器运行 API 的端口。(可能还需要配置防火墙)

之后,您可以通过以下方式访问您的 API:

http://serverip:port/metrics/current

API 端点

  • /metrics/current - 当前服务器状态数据
  • /metrics/history - 历史性能数据
  • /metrics/players - 包含游戏时间统计信息的玩家数据
  • /metrics/entities - 按世界划分的实体分布

各端点的示例数据

/metrics/current

{
  "cpuUsage": 0.06,
  "uptimeMillis": 76504272,
  "memory": {
    "max": 2147483648,
    "used": 716963360
  },
  "maxPlayers": 100,
  "onlinePlayers": 0,
  "tps": 20.0000152480116,
  "ping": 0,
  "players": [],
  "serverAddress": "serverip",
  "loadedChunks": 147,
  "timestamp": 1746884632413
}

/metrics/entities

{
  "counts": {
    "nether": 4,
    "overworld": 3,
    "the_end": 10
  },
  "distribution": {
    "nether": {
      "STRIDER": 4
    },
    "overworld": {
      "CHEST_MINECART": 3
    },
    "the_end": {
      "END_CRYSTAL": 10
    }
  }
}

/metrics/players

[
  {
    "totalPlaytimeMillis": 26095444,
    "name": "MeisterAH",
    "uuid": "debb8545-6216-4115-bc21-11c3529e3a3a"
  },
  {
    "totalPlaytimeMillis": 384016,
    "name": "Nickkyy_",
    "uuid": "095ecf90-6a7e-42eb-84eb-efd1c5f4417f"
  },
  {
    "totalPlaytimeMillis": 26416194,
    "name": "Schwabbel_Split",
    "uuid": "63a3ae68-0d98-4428-91e5-b4862d8b4e62"
  },
  {
    "totalPlaytimeMillis": 2268454,
    "name": "Jak0bUVA",
    "uuid": "fefca110-bcc9-483a-b647-54afc3ce9ba5"
  },
  {
    "totalPlaytimeMillis": 2267672,
    "name": "Maxomito",
    "uuid": "9dd498e6-517a-4b33-9d0a-57747e5c4e4f"
  }
]

/metrics/history (如果启用,默认为 true)

{
    "cpuUsage": 0.06,
    "uptimeMillis": 81362446,
    "memory": {
      "max": 2147483648,
      "used": 631376208
    },
    "maxPlayers": 100,
    "onlinePlayers": 0,
    "entityCount": 17,
    "tps": 20.0000402534144,
    "ping": 0,
    "players": [],
    "serverAddress": "123.123.123.123",
    "loadedChunks": 147,
    "timestamp": 1746889490587
  },
  {
    "cpuUsage": 0,
    "uptimeMillis": 81361458,
    "memory": {
      "max": 2147483648,
      "used": 619055352
    },
    "maxPlayers": 100,
    "onlinePlayers": 0,
    "entityCount": 17,
    "tps": 19.9999879986739,
    "ping": 0,
    "players": [],
    "serverAddress": "123.123.123.123",
    "loadedChunks": 147,
    "timestamp": 1746889489600
  },
  {
    "cpuUsage": 0.06,
    "uptimeMillis": 81360450,
    "memory": {
      "max": 2147483648,
      "used": 619055352
    },
    "maxPlayers": 100,
    "onlinePlayers": 0,
    "entityCount": 17,
    "tps": 19.9999989690001,
    "ping": 0,
    "players": [],
    "serverAddress": "123.123.123.123",
    "loadedChunks": 147,
    "timestamp": 1746889489600
  }

  [...]

你是这个资源的作者?登录后可认领此资源。

评论 0

0.0
暂无评分
5 星
0
4 星
0
3 星
0
2 星
0
1 星
0
我的评分

登录后参与评分

还没有评论,来抢沙发吧

评论配图

相似资源