friendica-exporter/serverinfo/serverinfo.go

125 lines
3.6 KiB
Go

package serverinfo
// ServerInfo contains the status information about the instance.
type ServerInfo struct {
Cron Cron `json:"cron"`
Worker Worker `json:"worker"`
Users Users `json:"users"`
Posts Posts `json:"posts"`
Packets Packets `json:"packets"`
Reports Reports `json:"reports"`
Update Update `json:"update"`
Server Server `json:"server"`
}
// DateTimeTimestamp contains a Datetime and a Timestamp
type DateTimeTimestamp struct {
DateTime string `json:"datetime"`
Timestamp int32 `json:"timestamp"`
}
// Cron contains information about the Cronjob
type Cron struct {
LastExecution DateTimeTimestamp `json:"lastExecution"`
}
// JPM contains the KPI "Jobs per Minute"
type JPM struct {
OneMinute int64 `json:"1"`
ThreeMinutes int64 `json:"3"`
FiveMinutes int64 `json:"5"`
}
// WorkerCount contains the count of specific worker tasks, based on their priority
type WorkerCount struct {
Undefined int64 `json:"0"`
Critical int64 `json:"10"`
High int64 `json:"20"`
Medium int64 `json:"30"`
Low int64 `json:"40"`
Negligible int64 `json:"50"`
Total int64 `json:"total"`
}
// Worker contains information about the worker load
type Worker struct {
LastExecution DateTimeTimestamp `json:"lastExecution"`
JPM JPM `json:"jpm"`
Active WorkerCount `json:"active"`
Deferred []int64 `json:"deferrd"`
Total WorkerCount `json:"total"`
}
// Users contains statistics about the users of this node
type Users struct {
Total int64 `json:"total"`
ActiveWeek int64 `json:"activeWeek"`
ActiveMonth int64 `json:"activeMonth"`
ActiveHalfYear int64 `json:"activeHalfYear"`
Pending int64 `json:"pending"`
}
// PostCounts contains contains post and comments statistics
type PostCounts struct {
Posts int64 `json:"posts"`
Comments int64 `json:"comments"`
}
// Posts contains statistics about inbound and outbound posts and comments
type Posts struct {
Inbound PostCounts `json:"inbound"`
Outbound PostCounts `json:"outbound"`
}
// PacketCounts contains statistics of protocol specific packages
type PacketCounts struct {
ActivityPub int64 `json:"apub"`
DFRN int64 `json:"dfrn"`
Diaspora int64 `json:"dspr"`
OStatus int64 `json:"stat"`
Feed int64 `json:"feed"`
Mail int64 `json:"mail"`
Bluesky int64 `json:"bsky"`
Thumblr int64 `json:"tmbl"`
}
// Packets contains statistics of inbound and outbound packages
type Packets struct {
Inbound PacketCounts `json:"inbound"`
Outbound PacketCounts `json:"outbound"`
}
// Reports contains statistics about Friendica reports
type Reports struct {
Newest DateTimeTimestamp `json:"newest"`
Open int64 `json:"open"`
Closed int64 `json:"closed"`
}
// Update contains information about updates
type Update struct {
Available bool `json:"available"`
AvailableVersion string `json:"available_version"`
Status int8 `json:"status"`
DatabaseStatus int8 `json:"db_status"`
}
// PHP contains information about the PHP used on this node
type PHP struct {
Version string `json:"version"`
UploadMaxFilesize string `json:"upload_max_filesize"`
PostMaxSize string `json:"post_max_size"`
MemoryLimit string `json:"memory_limit"`
}
// Database contains information about the Database used on this node
type Database struct {
MaxAllowedPacket string `json:"max_allowed_packet"`
}
// Server contains information about this server
type Server struct {
Version string `json:"version"`
PHP PHP `json:"php"`
Database Database `json:"database"`
}