module HTTPHealthCheck
Builds Envoy HTTP active health checks.
Definitions
def build(path, interval: 1, timeout: 1, unhealthy_threshold: 2, healthy_threshold: 1)
Build an HTTP active health check.
Signature
-
parameter
pathString The request path used to check each endpoint.
-
parameter
intervalNumeric The interval between checks in seconds.
-
parameter
timeoutNumeric The check timeout in seconds.
-
parameter
unhealthy_thresholdInteger The consecutive failures required to mark an endpoint unhealthy.
-
parameter
healthy_thresholdInteger The consecutive successes required to mark an endpoint healthy.
-
returns
Envoy::Config::Core::V3::HealthCheck The generated health check.
Implementation
def build(path, interval: 1, timeout: 1, unhealthy_threshold: 2, healthy_threshold: 1)
Envoy::Config::Core::V3::HealthCheck.new(
timeout: duration(timeout),
interval: duration(interval),
unhealthy_threshold: Google::Protobuf::UInt32Value.new(value: Integer(unhealthy_threshold)),
healthy_threshold: Google::Protobuf::UInt32Value.new(value: Integer(healthy_threshold)),
http_health_check: Envoy::Config::Core::V3::HealthCheck::HttpHealthCheck.new(path: path.to_s)
)
end