This commit is contained in:
npc0-hue
2026-08-26 09:56:43 +08:00
parent 2b4974b561
commit 8e02a316fa
93 changed files with 21749 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
package protocol
import "time"
type MetricSample struct {
ID string `json:"id,omitempty"`
ServerInstanceID string `json:"serverInstanceId"`
Online bool `json:"online"`
PlayerCount *int `json:"playerCount,omitempty"`
MaxPlayers *int `json:"maxPlayers,omitempty"`
TPS *float64 `json:"tps,omitempty"`
LatencyMS *float64 `json:"latencyMs,omitempty"`
CPUPercent *float64 `json:"cpuPercent,omitempty"`
MemoryPercent *float64 `json:"memoryPercent,omitempty"`
DiskPercent *float64 `json:"diskPercent,omitempty"`
Source string `json:"source"`
CollectedAt time.Time `json:"collectedAt"`
}
type MetricBatchIngestRequest struct {
RunEndpointID string `json:"runEndpointId"`
SessionToken string `json:"sessionToken"`
Samples []MetricSample `json:"samples"`
}
type MetricBatchIngestResponse struct {
Accepted bool `json:"accepted"`
AcceptedCount int `json:"acceptedCount"`
LatestAt time.Time `json:"latestAt"`
ServerTime time.Time `json:"serverTime"`
}