open-io / oio-swift

Openio flavor of the Openstack Swift Gateway and middlewares, allowing access to OpenIO SDS via an Openstack Swift gateway.
https://www.openio.io
Apache License 2.0
23 stars 21 forks source link

Implement custom healthcheck middleware #202

Closed fvennetier closed 4 years ago

fvennetier commented 4 years ago

This extension of swift's healthcheck middleware counts the number of requests currently being processed. The counter can be retrieved from a JSON object generated when calling the /_status route (can be changed by configuration).

oioswift processes can be registered in oio-sds' conscience with watchers configured like this:

host: 10.0.3.1
port: 5000
type: oioswift
service_id: oioswift-1
location: rack.127-0-0-1.novol
checks:
    - {type: http, uri: "/healthcheck"}
slots:
    - oioswift
stats:
    - {type: system}
    - {type: http, path: "/_status", parser: json}
codecov-io commented 4 years ago

Codecov Report

Merging #202 into master will decrease coverage by 2.09%. The diff coverage is 31.09%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #202      +/-   ##
==========================================
- Coverage   76.04%   73.96%   -2.08%     
==========================================
  Files          36       37       +1     
  Lines        3793     3843      +50     
==========================================
- Hits         2884     2842      -42     
- Misses        909     1001      +92
Impacted Files Coverage Δ
oioswift/common/middleware/healthcheck.py 0% <0%> (ø)
oioswift/__init__.py 100% <100%> (ø) :arrow_up:
oioswift/server.py 87.1% <100%> (+0.66%) :arrow_up:
bin/oioswift-proxy-server 55.89% <55.89%> (ø)
oioswift/common/middleware/tempauth.py 0% <0%> (-39.13%) :arrow_down:
oioswift/common/middleware/container_hierarchy.py 66.32% <0%> (-6.17%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update e7dd900...8a91414. Read the comment docs.