Add names and description to metrics
This commit is contained in:
parent
600464b889
commit
29ecde067f
@ -460,9 +460,15 @@ final class CapServer {
|
||||
|
||||
// MARK: Monitoring
|
||||
|
||||
private let capCountMetric = Metric<Int>("caps.count")
|
||||
private let capCountMetric = Metric<Int>("caps.count",
|
||||
name: "Number of caps",
|
||||
description: "The total number of caps in the database")
|
||||
|
||||
private let imageCountMetric = Metric<Int>("caps.images")
|
||||
private let imageCountMetric = Metric<Int>("caps.images",
|
||||
name: "Total images",
|
||||
description: "The total number of images for all caps")
|
||||
|
||||
private let classifierMetric = Metric<Int>("caps.classifier")
|
||||
private let classifierMetric = Metric<Int>("caps.classifier",
|
||||
name: "Classifier Version",
|
||||
description: "The current version of the image classifier")
|
||||
}
|
||||
|
@ -18,7 +18,9 @@ public func configure(_ app: Application) throws {
|
||||
// All new metrics are automatically registered with the standard observer
|
||||
MetricObserver.standard = monitor
|
||||
|
||||
let status = Metric<ServerStatus>("caps.status")
|
||||
let status = Metric<ServerStatus>("caps.status",
|
||||
name: "Status",
|
||||
description: "The general status of the service")
|
||||
status.update(.initializing)
|
||||
|
||||
let server = CapServer(in: URL(fileURLWithPath: publicDirectory))
|
||||
|
Loading…
Reference in New Issue
Block a user