Commit 08e22b5
committed
feat(server): add health check endpoint with tests
Add /health endpoint to server for health checking and monitoring.
Include comprehensive tests covering GET requests, method restrictions,
and compatibility with custom protocols.
Added _register_health_check method to AgentRunServer that registers
a /health route returning {"status": "ok"} for GET requests while
ensuring other methods are properly restricted.
添加用于健康检查和监控的 /health 端点。
包括涵盖 GET 请求、方法限制和自定义协议兼容性的全面测试。
在 AgentRunServer 中添加 _register_health_check 方法,该方法注册
一个 /health 路由,对 GET 请求返回 {"status": "ok"},同时
确保其他方法被正确限制。
Change-Id: I7718d675242179379935b81f6e323a2942d71bd8
Signed-off-by: OhYee <oyohyee@oyohyee.com>1 parent 7b9a8f3 commit 08e22b5
File tree
2 files changed
+47
-0
lines changed- agentrun/server
- tests/unittests/server
2 files changed
+47
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
135 | 138 | | |
136 | 139 | | |
137 | 140 | | |
| |||
145 | 148 | | |
146 | 149 | | |
147 | 150 | | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
148 | 158 | | |
149 | 159 | | |
150 | 160 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
127 | 164 | | |
128 | 165 | | |
129 | 166 | | |
| |||
0 commit comments