Testing Backends For Availability
This is an overview for how backends are queried for their availability status.
Overview Diagram
This diagram shows how backends are queried to determine their availability:
- (1) Starting from a call to StartAllAPIMonitoring, one of several BackendSamplers are created:
|
|
- (2) Then a disruptionSampler is created with that BackendSampler https://github.com/openshift/origin/blob/08eb7795276c45f2be16e980a9687e34f6d2c8ec/pkg/monitor/backenddisruption/disruption_backend_sampler.go#L410
- (3) The
produceSamples
function is called to produce the disruptionSamples. This function is built around aTicker
that fires every 1 second. ThecheckConnection
function is called to send an Http GET to the backend and look for a response from the backend.
|
|
(4) The
checkConnection
function, producesdisruptionSamples
which represent the startTime of the Http GET and an associatedsampleErr
that trackes if the Http GET was successful (sampleErr set tonil
) or failing (the error is saved). ThedisruptionSamples
are stored in a slice referenced by thedisruptionSampler
.(5) The
consumeSamples
function takes the disruptionSamples and determines when disruption started and stopped. It then records Events and records Intervals/Conditions on the monitorRecorder.
|
|
- (6) Intervals on the monitorRecorder are used by the synthetic tests.
Last modified June 22, 2022: Starter Disruption Documentation (#263) (292d250)