Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 20 additions & 20 deletions Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Sources/App/Commands/Alerting.swift
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ extension [Alerting.BuildInfo] {
func validateSuccessRateInRange() -> Alerting.Validation {
let successRate = Double(filter { $0.status == .ok }.count) / Double(count)
// Success rate has been around 30% generally
if 0.2 <= successRate && successRate <= 0.4 {
if 0.15 <= successRate && successRate <= 0.45 {
return .ok
} else {
let percentSuccessRate = (successRate * 1000).rounded() / 10
Expand Down
8 changes: 4 additions & 4 deletions Tests/AppTests/AlertingTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -109,20 +109,20 @@ extension AllTests.AlertingTests {
#expect(all.validateSuccessRateInRange() == .ok)
}
do {
let okCount = 199
let okCount = 149
let failedCount = 1000 - okCount
let okBuilds = (0..<okCount).map { _ in Alerting.BuildInfo.mock(status: .ok) }
let failedBuilds = (0..<failedCount).map { _ in Alerting.BuildInfo.mock(status: .failed) }
let all = okBuilds + failedBuilds
#expect(all.validateSuccessRateInRange() == .failed(reasons: ["Global success rate of 19.9% out of bounds"]))
#expect(all.validateSuccessRateInRange() == .failed(reasons: ["Global success rate of 14.9% out of bounds"]))
}
do {
let okCount = 401
let okCount = 451
let failedCount = 1000 - okCount
let okBuilds = (0..<okCount).map { _ in Alerting.BuildInfo.mock(status: .ok) }
let failedBuilds = (0..<failedCount).map { _ in Alerting.BuildInfo.mock(status: .failed) }
let all = okBuilds + failedBuilds
#expect(all.validateSuccessRateInRange() == .failed(reasons: ["Global success rate of 40.1% out of bounds"]))
#expect(all.validateSuccessRateInRange() == .failed(reasons: ["Global success rate of 45.1% out of bounds"]))
}
}

Expand Down
2 changes: 1 addition & 1 deletion mon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ services:

grafana:
# https://github.com/grafana/grafana/releases
image: grafana/grafana:11.6.2
image: grafana/grafana:12.0.2
environment:
GF_SECURITY_ADMIN_PASSWORD: ${GF_SECURITY_ADMIN_PASSWORD}
GF_USERS_ALLOW_SIGN_UP: 'false'
Expand Down
Loading