Closed oubiwann closed 6 years ago
For every type of supported health check, we will need a function to perform the check. So far, these are:
:tcp
TCP CONNECT
:http
GET
:docker
:cpu
:mem
Ultimately, these would be used like so at the system-component-level:
[{:name :mock-echo :type :tcp :frequency 30000} {:name :mock-echo :type :http :frequency 5000} {:name :elasticsearch :type :docker :frequency 10000}
But directly, these functions would probably be utilized by a new health method supported by service components -- those would be responsible for setting/configuring the proper hosts, ports, endpoints, containers, etc.
health
As such, dev tasks might be this:
{:connects? <bool>}
{:status <int> :value <parsed body>}
{:container-up? <bool>}
{:cpu <float>}
ProcessRunner
DockerRunner
HTTP GETer done in b79c041.
Docker checker done in 06d8eca.
Added TCP ping support in 261f564.
For every type of supported health check, we will need a function to perform the check. So far, these are:
:tcp
- a simple TCP "ping-like" functionality (e.g.,TCP CONNECT
-only) - connect to host and port:http
- an HTTP health check - do an HTTPGET
against a specified endpoint and parse results:docker
- check the status of a running Docker container:cpu
- check the CPU usage of a process-based service:mem
- check the memory usage of a process-based serviceUltimately, these would be used like so at the system-component-level:
But directly, these functions would probably be utilized by a new
health
method supported by service components -- those would be responsible for setting/configuring the proper hosts, ports, endpoints, containers, etc.As such, dev tasks might be this:
{:connects? <bool>}
GET
ter with response body-parsing and HTTP status code-checking ... maybe return{:status <int> :value <parsed body>}
{:container-up? <bool>}
{:cpu <float>}
ProcessRunner
component to support ahealth
methodDockerRunner
component to support ahealth
methodhealth
methods for each service type to call the appropriate generic health functions, dispatched on type