|
Csilk 0.2.1
A lightweight, high-performance C HTTP web framework
|
Unified administration and monitoring controller implementation. More...
#include "csilk/app/admin.h"#include <stdatomic.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include <time.h>#include <unistd.h>#include "cJSON.h"#include "csilk/core/internal.h"
Functions | |
| uint64_t | atomic_load_http_requests (void) |
| uint64_t | atomic_load_http_duration (void) |
| static void | admin_ui_handler (csilk_ctx_t *c) |
| Helper to serve the admin UI HTML. | |
| static void | admin_stats_handler (csilk_ctx_t *c) |
| Aggregates system-wide statistics into a JSON response. | |
| static void | admin_topology_handler (csilk_ctx_t *c) |
| Returns the router topology for graph visualization. | |
| static void | admin_profiler_handler (csilk_ctx_t *c) |
| Simple profiler placeholder (Flamegraph data source). | |
| static void | admin_ws_handler (csilk_ctx_t *c) |
| WebSocket handler that streams multiplexed events. | |
| void | csilk_admin_serve (csilk_app_t *app, const char *app_path) |
| Register administration routes to an application. | |
| void | csilk_admin_serve_secure (csilk_app_t *app, const char *app_path, csilk_handler_t auth_middleware) |
| Register administration routes with a secure middleware. | |
Variables | |
| static uint64_t | last_req_count = 0 |
| static uint64_t | last_check_time = 0 |
Unified administration and monitoring controller implementation.
|
static |
Simple profiler placeholder (Flamegraph data source).
|
static |
Aggregates system-wide statistics into a JSON response.
|
static |
Returns the router topology for graph visualization.
|
static |
Helper to serve the admin UI HTML.
|
static |
WebSocket handler that streams multiplexed events.
|
extern |
|
extern |
| void csilk_admin_serve | ( | csilk_app_t * | app, |
| const char * | path | ||
| ) |
Register administration routes to an application.
This function registers several routes under the given path:
| app | The application handle. |
| path | The base URL path for the admin panel (e.g., "/admin"). |
| void csilk_admin_serve_secure | ( | csilk_app_t * | app, |
| const char * | app_path, | ||
| csilk_handler_t | auth_middleware | ||
| ) |
Register administration routes with a secure middleware.
Register protected administration routes to an application.
This implementation creates a new route group for the admin panel, applying an optional authentication middleware. This ensures that sensitive metrics and real-time data are only accessible to authorized users.
| app | The high-level application handle. |
| app_path | The base URL path for the admin panel (e.g., "/admin"). |
| auth_middleware | Optional handler function for authentication. |
|
static |
|
static |