Add service status and usage dashboard, refresh externally published edits
This commit is contained in:
@@ -94,6 +94,8 @@ type PipelineSummary struct {
|
||||
|
||||
// Message is the JSON envelope shared by the server and client.
|
||||
type Message struct {
|
||||
Usage *UsageStats `json:"usage,omitempty"`
|
||||
Status *SystemStatus `json:"status,omitempty"`
|
||||
Graph *Graph `json:"graph,omitempty"`
|
||||
ExpectedVersion int `json:"expected_version,omitempty"`
|
||||
Templates []Template `json:"templates,omitempty"`
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
package protocol
|
||||
|
||||
type RunCounts struct {
|
||||
Total int `json:"total"`
|
||||
Succeeded int `json:"succeeded"`
|
||||
Failed int `json:"failed"`
|
||||
Canceled int `json:"canceled"`
|
||||
Interrupted int `json:"interrupted"`
|
||||
Active int `json:"active"`
|
||||
AverageSeconds float64 `json:"average_seconds"`
|
||||
}
|
||||
type PipelineUsage struct {
|
||||
PipelineID int64 `json:"pipeline_id"`
|
||||
Name string `json:"name"`
|
||||
RunCounts
|
||||
}
|
||||
type DailyUsage struct {
|
||||
Date string `json:"date"`
|
||||
Runs int `json:"runs"`
|
||||
}
|
||||
type UsageStats struct {
|
||||
RunCounts
|
||||
Pipelines []PipelineUsage `json:"pipelines"`
|
||||
Days []DailyUsage `json:"days"`
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package protocol
|
||||
|
||||
const GetStatus = "get_status"
|
||||
const Status = "status"
|
||||
|
||||
type NetworkAddress struct {
|
||||
Interface string `json:"interface"`
|
||||
IP string `json:"ip"`
|
||||
}
|
||||
|
||||
type ServiceStatus struct {
|
||||
Health string `json:"health"`
|
||||
URL string `json:"url,omitempty"`
|
||||
Port string `json:"port,omitempty"`
|
||||
Candidates []string `json:"candidate_urls,omitempty"`
|
||||
}
|
||||
|
||||
type SystemStatus struct {
|
||||
Hostname string `json:"hostname"`
|
||||
StartedAt string `json:"started_at"`
|
||||
Uptime string `json:"uptime"`
|
||||
Addresses []NetworkAddress `json:"addresses"`
|
||||
Server ServiceStatus `json:"server"`
|
||||
Ntfy ServiceStatus `json:"ntfy"`
|
||||
Topic string `json:"topic,omitempty"`
|
||||
Note string `json:"note"`
|
||||
}
|
||||
Reference in New Issue
Block a user