chore(health): adjust health evalutation
This commit is contained in:
parent
a407094253
commit
681f16be93
@ -9,7 +9,7 @@ HealthCheckLDAPAdmins: Anteil der Administrator:innen mit LDAP Authentifizierung
|
|||||||
HealthCheckSMTPConnect: SMTP-Server kann erreicht werden
|
HealthCheckSMTPConnect: SMTP-Server kann erreicht werden
|
||||||
HealthCheckWidgetMemcached: Memcached-Server liefert Widgets korrekt aus
|
HealthCheckWidgetMemcached: Memcached-Server liefert Widgets korrekt aus
|
||||||
HealthCheckActiveJobExecutors: Anteil der job-workers, die neue Befehle annehmen
|
HealthCheckActiveJobExecutors: Anteil der job-workers, die neue Befehle annehmen
|
||||||
HealthCheckDoesFlush: Zustandsprüfung läuft durch
|
HealthCheckDoesFlush: Abgearbeitete Jobs werden aufgeräumt
|
||||||
InstanceIdentification: Instanz-Identifikation
|
InstanceIdentification: Instanz-Identifikation
|
||||||
InstanceId: Instanz-Nummer
|
InstanceId: Instanz-Nummer
|
||||||
ClusterId: Cluster-Nummer
|
ClusterId: Cluster-Nummer
|
||||||
@ -9,7 +9,7 @@ HealthCheckLDAPAdmins: Proportion of administrators with LDAP authentication tha
|
|||||||
HealthCheckSMTPConnect: SMTP server is reachable
|
HealthCheckSMTPConnect: SMTP server is reachable
|
||||||
HealthCheckWidgetMemcached: Memcached server is serving widgets correctly
|
HealthCheckWidgetMemcached: Memcached server is serving widgets correctly
|
||||||
HealthCheckActiveJobExecutors: Proportion of job workers accepting new jobs
|
HealthCheckActiveJobExecutors: Proportion of job workers accepting new jobs
|
||||||
HealthCheckDoesFlush: Health reports flushes
|
HealthCheckDoesFlush: Executed jobs are removed
|
||||||
InstanceIdentification: Instance identification
|
InstanceIdentification: Instance identification
|
||||||
InstanceId: Instance id
|
InstanceId: Instance id
|
||||||
ClusterId: Cluster id
|
ClusterId: Cluster id
|
||||||
|
|||||||
@ -550,8 +550,8 @@ warpSettings foundation = defaultSettings
|
|||||||
& Set.filter (is _Just . (foundation ^. _appHealthCheckInterval))
|
& Set.filter (is _Just . (foundation ^. _appHealthCheckInterval))
|
||||||
atomically $ do
|
atomically $ do
|
||||||
results <- readTVar $ foundation ^. _appHealthReport
|
results <- readTVar $ foundation ^. _appHealthReport
|
||||||
guard $ activeChecks == Set.map (classifyHealthReport . snd) results
|
guard $ activeChecks `Set.isSubsetOf` Set.map (classifyHealthReport . snd) results
|
||||||
guard . (== Min HealthSuccess) $ foldMap (Min . healthReportStatus . snd) results
|
guard . (/= Min HealthFailure) $ foldMap (Min . healthReportStatus . snd) results
|
||||||
notifyReady
|
notifyReady
|
||||||
| otherwise
|
| otherwise
|
||||||
-> notifyReady
|
-> notifyReady
|
||||||
@ -679,7 +679,7 @@ appMain = runResourceT $ do
|
|||||||
interval <- mInterval
|
interval <- mInterval
|
||||||
let lastSuccess = maybeMonoid mResults
|
let lastSuccess = maybeMonoid mResults
|
||||||
& Set.filter (\(_, rep) -> classifyHealthReport rep == hc)
|
& Set.filter (\(_, rep) -> classifyHealthReport rep == hc)
|
||||||
& Set.filter (\(_, rep) -> healthReportStatus rep >= HealthSuccess)
|
& Set.filter (\(_, rep) -> healthReportStatus rep > HealthFailure)
|
||||||
& Set.mapMonotonic (view _1)
|
& Set.mapMonotonic (view _1)
|
||||||
& Set.lookupMax
|
& Set.lookupMax
|
||||||
|
|
||||||
|
|||||||
@ -593,7 +593,7 @@ handleJobs' wNum = C.mapM_ $ \jctl -> hoist delimitInternalState . withJobWorker
|
|||||||
newReport@(healthReportStatus -> newStatus) <- lift $ generateHealthReport kind
|
newReport@(healthReportStatus -> newStatus) <- lift $ generateHealthReport kind
|
||||||
|
|
||||||
$logInfoS logIdent [st|#{tshow kind}: #{toPathPiece newStatus}|]
|
$logInfoS logIdent [st|#{tshow kind}: #{toPathPiece newStatus}|]
|
||||||
unless (newStatus == HealthSuccess) $ do
|
unless (newStatus > HealthFailure) $ do
|
||||||
$logErrorS logIdent [st|#{tshow kind}: #{tshow newReport}|]
|
$logErrorS logIdent [st|#{tshow kind}: #{tshow newReport}|]
|
||||||
|
|
||||||
liftIO $ do
|
liftIO $ do
|
||||||
|
|||||||
@ -67,10 +67,10 @@ classifyHealthReport :: HealthReport -> HealthCheck
|
|||||||
classifyHealthReport HealthMatchingClusterConfig{} = HealthCheckMatchingClusterConfig
|
classifyHealthReport HealthMatchingClusterConfig{} = HealthCheckMatchingClusterConfig
|
||||||
classifyHealthReport HealthLDAPAdmins{} = HealthCheckLDAPAdmins
|
classifyHealthReport HealthLDAPAdmins{} = HealthCheckLDAPAdmins
|
||||||
classifyHealthReport HealthHTTPReachable{} = HealthCheckHTTPReachable
|
classifyHealthReport HealthHTTPReachable{} = HealthCheckHTTPReachable
|
||||||
classifyHealthReport HealthSMTPConnect{} = HealthCheckSMTPConnect
|
classifyHealthReport HealthSMTPConnect{} = HealthCheckSMTPConnect
|
||||||
classifyHealthReport HealthWidgetMemcached{} = HealthCheckWidgetMemcached
|
classifyHealthReport HealthWidgetMemcached{} = HealthCheckWidgetMemcached -- kein Neustart notwendig
|
||||||
classifyHealthReport HealthActiveJobExecutors{} = HealthCheckActiveJobExecutors
|
classifyHealthReport HealthActiveJobExecutors{} = HealthCheckActiveJobExecutors
|
||||||
classifyHealthReport HealthDoesFlush{} = HealthCheckDoesFlush
|
classifyHealthReport HealthDoesFlush{} = HealthCheckDoesFlush -- evtl. kein Neustart notwendig
|
||||||
|
|
||||||
-- | `HealthReport` classified (`classifyHealthReport`) by badness
|
-- | `HealthReport` classified (`classifyHealthReport`) by badness
|
||||||
--
|
--
|
||||||
@ -111,7 +111,8 @@ healthReportStatus = \case
|
|||||||
HealthActiveJobExecutors Nothing -> HealthInactive
|
HealthActiveJobExecutors Nothing -> HealthInactive
|
||||||
HealthActiveJobExecutors (Just prop )
|
HealthActiveJobExecutors (Just prop )
|
||||||
| prop > 0 -> HealthSuccess
|
| prop > 0 -> HealthSuccess
|
||||||
HealthDoesFlush mProp
|
HealthDoesFlush Nothing -> HealthInactive
|
||||||
| maybe True (>= 2) mProp -> HealthFailure -- Looks buggy to me?
|
HealthDoesFlush (Just prop )
|
||||||
|
| prop >= 2 -> HealthFailure
|
||||||
| otherwise -> HealthSuccess
|
| otherwise -> HealthSuccess
|
||||||
_other -> HealthFailure
|
_other -> HealthFailure
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user