diff options
| author | Dan Engelbrecht <[email protected]> | 2026-03-27 11:13:02 +0100 |
|---|---|---|
| committer | GitHub Enterprise <[email protected]> | 2026-03-27 11:13:02 +0100 |
| commit | 776d76d299748a79b9cb25593cd8266cb26a6553 (patch) | |
| tree | b827b4d3f5a497d4ba851991db9fbe4b44860405 /src/zenhttp/include | |
| parent | update Oodle 2.9.14 -> 2.9.15 (#893) (diff) | |
| download | zen-776d76d299748a79b9cb25593cd8266cb26a6553.tar.xz zen-776d76d299748a79b9cb25593cd8266cb26a6553.zip | |
idle deprovision in hub (#895)
- Feature: Hub watchdog automatically deprovisions inactive provisioned and hibernated instances
- Feature: Added `stats/activity_counters` endpoint to measure server activity
- Feature: Added configuration options for hub watchdog
- `--hub-watchdog-provisioned-inactivity-timeout-seconds` Inactivity timeout before a provisioned instance is deprovisioned
- `--hub-watchdog-hibernated-inactivity-timeout-seconds` Inactivity timeout before a hibernated instance is deprovisioned
- `--hub-watchdog-inactivity-check-margin-seconds` Margin before timeout at which an activity check is issued
- `--hub-watchdog-cycle-interval-ms` Watchdog poll interval in milliseconds
- `--hub-watchdog-cycle-processing-budget-ms` Maximum time budget per watchdog cycle in milliseconds
- `--hub-watchdog-instance-check-throttle-ms` Minimum delay between checks on a single instance
- `--hub-watchdog-activity-check-connect-timeout-ms` Connect timeout for activity check requests
- `--hub-watchdog-activity-check-request-timeout-ms` Request timeout for activity check requests
Diffstat (limited to 'src/zenhttp/include')
| -rw-r--r-- | src/zenhttp/include/zenhttp/auth/authservice.h | 4 | ||||
| -rw-r--r-- | src/zenhttp/include/zenhttp/httpclient.h | 1 | ||||
| -rw-r--r-- | src/zenhttp/include/zenhttp/httpserver.h | 8 | ||||
| -rw-r--r-- | src/zenhttp/include/zenhttp/httpstats.h | 1 |
4 files changed, 11 insertions, 3 deletions
diff --git a/src/zenhttp/include/zenhttp/auth/authservice.h b/src/zenhttp/include/zenhttp/auth/authservice.h index 64b86e21f..ee67c0f5b 100644 --- a/src/zenhttp/include/zenhttp/auth/authservice.h +++ b/src/zenhttp/include/zenhttp/auth/authservice.h @@ -8,14 +8,14 @@ namespace zen { class AuthMgr; -class HttpAuthService final : public zen::HttpService +class HttpAuthService final : public HttpService { public: HttpAuthService(AuthMgr& AuthMgr); virtual ~HttpAuthService(); virtual const char* BaseUri() const override; - virtual void HandleRequest(zen::HttpServerRequest& Request) override; + virtual void HandleRequest(HttpServerRequest& Request) override; private: AuthMgr& m_AuthMgr; diff --git a/src/zenhttp/include/zenhttp/httpclient.h b/src/zenhttp/include/zenhttp/httpclient.h index b0d74951e..26d60b9ae 100644 --- a/src/zenhttp/include/zenhttp/httpclient.h +++ b/src/zenhttp/include/zenhttp/httpclient.h @@ -364,6 +364,7 @@ public: LoggerRef Log() { return m_Log; } std::string_view GetBaseUri() const { return m_BaseUri; } std::string_view GetSessionId() const { return m_SessionId; } + void SetBaseUri(std::string_view NewBaseUri); void SetSessionId(const Oid& SessionId); bool Authenticate(); diff --git a/src/zenhttp/include/zenhttp/httpserver.h b/src/zenhttp/include/zenhttp/httpserver.h index 633eb06be..5eaed6004 100644 --- a/src/zenhttp/include/zenhttp/httpserver.h +++ b/src/zenhttp/include/zenhttp/httpserver.h @@ -220,6 +220,12 @@ struct IHttpStatsProvider * not override this will be skipped in WebSocket broadcasts. */ virtual CbObject CollectStats() { return {}; } + + /** Return a number indicating activity. Increase the number + * when activity is detected. Example would be to return the + * number of received requests + */ + virtual uint64_t GetActivityCounter() { return 0; } }; struct IHttpStatsService @@ -302,8 +308,8 @@ public: } // IHttpStatsProvider - virtual CbObject CollectStats() override; virtual void HandleStatsRequest(HttpServerRequest& Request) override; + virtual CbObject CollectStats() override; private: std::vector<HttpService*> m_KnownServices; diff --git a/src/zenhttp/include/zenhttp/httpstats.h b/src/zenhttp/include/zenhttp/httpstats.h index 460315faf..bce771c75 100644 --- a/src/zenhttp/include/zenhttp/httpstats.h +++ b/src/zenhttp/include/zenhttp/httpstats.h @@ -62,6 +62,7 @@ private: std::atomic<bool> m_PushEnabled{false}; void BroadcastStats(); + void Initialize(); // Thread-based push (when no io_context is provided) std::thread m_PushThread; |