aboutsummaryrefslogtreecommitdiff
path: root/src/zenserver/zenserver.h
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2026-03-09 17:43:08 +0100
committerGitHub Enterprise <[email protected]>2026-03-09 17:43:08 +0100
commitb37b34ea6ad906f54e8104526e77ba66aed997da (patch)
treee80ce17d666aff6d2f0d73d4977128ffb4055476 /src/zenserver/zenserver.h
parentadd fallback for zencache multirange (#816) (diff)
downloadzen-b37b34ea6ad906f54e8104526e77ba66aed997da.tar.xz
zen-b37b34ea6ad906f54e8104526e77ba66aed997da.zip
Dashboard overhaul, compute integration (#814)
- **Frontend dashboard overhaul**: Unified compute/main dashboards into a single shared UI. Added new pages for cache, projects, metrics, sessions, info (build/runtime config, system stats). Added live-update via WebSockets with pause control, sortable detail tables, themed styling. Refactored compute/hub/orchestrator pages into modular JS. - **HTTP server fixes and stats**: Fixed http.sys local-only fallback when default port is in use, implemented root endpoint redirect for http.sys, fixed Linux/Mac port reuse. Added /stats endpoint exposing HTTP server metrics (bytes transferred, request rates). Added WebSocket stats tracking. - **OTEL/diagnostics hardening**: Improved OTLP HTTP exporter with better error handling and resilience. Extended diagnostics services configuration. - **Session management**: Added new sessions service with HTTP endpoints for registering, updating, querying, and removing sessions. Includes session log file support. This is still WIP. - **CLI subcommand support**: Added support for commands with subcommands in the zen CLI tool, with improved command dispatch. - **Misc**: Exposed CPU usage/hostname to frontend, fixed JS compact binary float32/float64 decoding, limited projects displayed on front page to 25 sorted by last access, added vscode:// link support. Also contains some fixes from TSAN analysis.
Diffstat (limited to 'src/zenserver/zenserver.h')
-rw-r--r--src/zenserver/zenserver.h17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/zenserver/zenserver.h b/src/zenserver/zenserver.h
index 5a8a079c0..c06093f0d 100644
--- a/src/zenserver/zenserver.h
+++ b/src/zenserver/zenserver.h
@@ -3,11 +3,13 @@
#pragma once
#include <zencore/basicfile.h>
+#include <zencore/system.h>
#include <zenhttp/httpserver.h>
#include <zenhttp/httpstats.h>
#include <zenhttp/httpstatus.h>
#include <zenutil/zenserverprocess.h>
+#include <atomic>
#include <memory>
#include <string_view>
#include "config/config.h"
@@ -51,8 +53,10 @@ public:
protected:
int Initialize(const ZenServerConfig& ServerOptions, ZenServerState::ZenServerEntry* ServerEntry);
void Finalize();
+ void ShutdownServices();
void GetBuildOptions(StringBuilderBase& OutOptions, char Separator = ',') const;
- void LogSettingsSummary(const ZenServerConfig& ServerConfig);
+ static std::vector<std::pair<std::string_view, std::string>> BuildSettingsList(const ZenServerConfig& ServerConfig);
+ void LogSettingsSummary(const ZenServerConfig& ServerConfig);
protected:
NamedMutex m_ServerMutex;
@@ -73,9 +77,10 @@ protected:
kInitializing,
kRunning,
kShuttingDown
- } m_CurrentState = kInitializing;
+ };
+ std::atomic<ServerState> m_CurrentState = kInitializing;
- inline void SetNewState(ServerState NewState) { m_CurrentState = NewState; }
+ inline void SetNewState(ServerState NewState) { m_CurrentState.store(NewState, std::memory_order_relaxed); }
static std::string_view ToString(ServerState Value);
std::function<void()> m_IsReadyFunc;
@@ -88,8 +93,10 @@ protected:
std::unique_ptr<IHttpRequestFilter> m_HttpRequestFilter;
- HttpHealthService m_HealthService;
- HttpStatusService m_StatusService;
+ HttpHealthService m_HealthService;
+ HttpStatsService m_StatsService{m_IoContext};
+ HttpStatusService m_StatusService;
+ SystemMetricsTracker m_MetricsTracker;
// Stats reporting