@@ -28,8 +28,14 @@ The agent operates as a managed service within the swf-testbed ecosystem, automa
2828# The agent runs as a managed service within the testbed
2929cd $SWF_PARENT_DIR /swf-testbed
3030swf-testbed status # Check if fast monitoring agent is running
31+ ```
32+
33+ The agent relies on ` .env ` configuration for API tokens and monitor URLs, and uses supervisord for process management.
3134
32- # Manual development run (message-driven mode - default)
35+ ### Manual execution for development/testing
36+
37+ ``` bash
38+ # For manual development run (message-driven mode - default)
3339cd ../swf-fastmon-agent
3440export SWF_MONITOR_HTTP_URL=" http://localhost:8002"
3541export SWF_API_TOKEN=" your_api_token_here"
@@ -63,20 +69,17 @@ The fast monitoring agent is configured through the swf-testbed ecosystem:
6369 - ** Message-driven mode** : Responds to data_ready messages from swf-data-agent
6470 - ** Continuous mode** : Periodically scans directories (for development/testing)
6571- ** Status Reporting** : Provides health checks and performance metrics via BaseAgent
66- - ** Token-based Authentication** : Secure API access using token authentication
6772
68- ### Fast Monitoring Client
73+ ### Fast Monitoring Client (in development)
6974- ** Real-time Display** : Receives and displays TF file notifications in terminal via SSE streaming
7075- ** Statistics Tracking** : Monitors per-run TF counts and data volume
7176- ** Graceful Shutdown** : Handles Ctrl+C with summary statistics
72- - ** Message Filtering** : Filter by message types and agent names
7377- ** Authentication** : Uses API tokens for secure SSE stream access
74- - ** Configurable Connection** : Supports custom monitor URLs and filtering options
7578
7679### Data Flow
77801 . ** STF File Detection** : Agent monitors directories for new STF files or receives data_ready messages
78812 . ** TF Simulation** : Generates TF subsamples from STF files based on configuration parameters
79- 3 . ** Database Recording** : Records both STF and TF metadata in swf-monitor database via REST API
82+ 3 . ** Database Recording** : Records TF metadata in swf-monitor database via REST API
80834 . ** SSE Message Broadcasting** : Agent sends TF file notifications to swf-monitor's ` /api/messages/ ` endpoint
81845 . ** Real-time Streaming** : swf-monitor broadcasts messages via SSE to connected clients at ` /api/messages/stream/ `
82856 . ** Client Display** : Client receives SSE stream and displays formatted TF information in real-time
@@ -87,8 +90,6 @@ The fast monitoring agent is configured through the swf-testbed ecosystem:
8790- ** Better Scalability** : SSE handles many concurrent read-only client connections efficiently
8891- ** Enhanced Security** : API token-based authentication with fine-grained access control
8992- ** Web Integration Ready** : Easy to add web-based dashboards that consume the same SSE stream
90- - ** Message Filtering** : Built-in filtering by message types and agent names at the server level
91- - ** Lower Latency** : Direct HTTP streaming eliminates message broker overhead
9293
9394## SSE Client Usage
9495
0 commit comments