struct HealthCheckRecord
Defined at line 615 of file ../../src/devices/bin/driver_manager/node.h
The latest health check outcome for a node. driver_manager caches it so that failures such
as a wedged driver dispatcher or a crashed driver host are preserved out-of-process.
Lifetime: the record belongs to one driver instance. It is cleared, along with the alert
probe timestamps, whenever a new driver is started on the node (first bind, rebind or
restart), so a stale TIMEOUT or UNHEALTHY from the previous instance never outlives it.
Replacement policy (see MaybeStoreHealthCheckRecord):
(a) A result that carries no health information (NOT_SUPPORTED, UNAVAILABLE,
COMMUNICATION_ERROR, INVALID_STATE, NOT_FOUND) never replaces a record that does carry
some (a status, or a synthetic TIMEOUT / host-closed / transport-failure condition). It is
only cached while there is no informative record yet.
(b) An OK PING result does not hide a non-OK record from a FAST or DEEP check or a
self_fault alert: a liveness ping says nothing about the hardware. The most recent
informative non-PING record is retained separately for this purpose, so a PING failure
(TIMEOUT, crashed host) in between does not launder the hardware fault away: once the
PING succeeds again the retained non-PING record is published again.
All other results replace the existing record.
Public Members
optional status
optional error
optional level
basic_time timestamp
vector diagnostics
vector conditions
Public Methods
bool is_ping ()
True if the record came from a PING, i.e. it only measures dispatcher liveness.
Defined at line 641 of file ../../src/devices/bin/driver_manager/node.h
HealthCheckRecord FromResponse (const fuchsia_driver_framework::HealthCheckResponse &response,std::optional<fuchsia_driver_framework::HealthCheckRequest>level,zx::timetimestamp)
Builds a record from a response returned by (or synthesized for) the driver. |level| is the
level of the check that produced it, or nullopt for a SELF_FAULT alert.
Defined at line 3548 of file ../../src/devices/bin/driver_manager/node.cc
HealthCheckRecord FromError (fuchsia_driver_framework::HealthCheckErrorerror,std::optional<fuchsia_driver_framework::HealthCheckRequest>level,zx::timetimestamp)
Builds a record for a check that failed with |error|. TIMEOUT and other errors that
indicate a problem add a single synthetic UNHEALTHY condition; NOT_SUPPORTED, UNAVAILABLE,
COMMUNICATION_ERROR, INVALID_STATE and NOT_FOUND carry no health information and add none.
Defined at line 3562 of file ../../src/devices/bin/driver_manager/node.cc
fuchsia_driver_framework::HealthCondition SyntheticCondition (std::string reason_code, std::string message)
Builds an UNHEALTHY condition that driver_manager synthesizes for failures it detects
itself (e.g. a crashed driver host), as opposed to conditions reported by the driver.
Defined at line 3505 of file ../../src/devices/bin/driver_manager/node.cc
std::string_view first_reason_code ()
Returns the reason code of the first condition, or "-" if there is none. Used for logs.
Defined at line 3514 of file ../../src/devices/bin/driver_manager/node.cc
bool is_informative ()
True if the record says something about the driver's health: it has a status, or a
synthetic condition for a failure driver_manager detected. False for the bare errors listed
under replacement policy (a).
Defined at line 3521 of file ../../src/devices/bin/driver_manager/node.cc