octavia.amphorae.drivers.health package

Submodules

octavia.amphorae.drivers.health.heartbeat_udp module

class UDPStatusGetter[source]

Bases: object

This class defines methods that will gather heartbeats

The heartbeats are transmitted via UDP and this class will bind to a port and absorb them

check()[source]
dorecv(*args, **kw)[source]

Waits for a UDP heart beat to be sent.

Returns:

Returns the unwrapped payload and addr that sent the heartbeat.

update(key, ip, port)[source]

Update the running config for the udp socket server

Parameters:
  • key – The hmac key used to verify the UDP packets. String

  • ip – The ip address the UDP server will read from

  • port – The port the UDP server will read from

Returns:

None

class UpdateHealthDb[source]

Bases: object

update_health(health, srcaddr)[source]
update_stats(health_message)[source]

Parses the health message then passes it to the stats driver(s)

Parameters:

health_message (dict) – The health message containing the listener stats

Example V1 message:

health = {
    "id": "<amphora_id>",
    "listeners": {
        "<listener_id>": {
            "status": "OPEN",
            "stats": {
                "ereq": 0,
                "conns": 0,
                "totconns": 0,
                "rx": 0,
                "tx": 0,
            },
            "pools": {
                "<pool_id>": {
                    "status": "UP",
                    "members": {"<member_id>": "ONLINE"}
                }
            }
        }
    }
}

Example V2 message:

{"id": "<amphora_id>",
 "seq": 67,
 "listeners": {
   "<listener_id>": {
     "status": "OPEN",
     "stats": {
       "tx": 0,
       "rx": 0,
       "conns": 0,
       "totconns": 0,
       "ereq": 0
     }
   }
 },
 "pools": {
     "<pool_id>:<listener_id>": {
       "status": "UP",
       "members": {
         "<member_id>": "no check"
       }
     }
 },
 "ver": 2
 "recv_time": time.time()
}

Example V3 message:

Same as V2 message, except values are deltas rather than absolutes.

Module contents