Skip to content

Commit 2e2b1ea

Browse files
committed
Update README
1 parent 95c3d69 commit 2e2b1ea

File tree

1 file changed

+34
-17
lines changed

1 file changed

+34
-17
lines changed

README.md

Lines changed: 34 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
# SWF Fast Monitoring Agent
22

3-
**`swf-fastmon-agent`** is a fast monitoring service for the ePIC streaming workflow testbed.
3+
**`swf-fastmon-agent`** is a fast monitoring service for the ePIC streaming workflow testbed.
44

5-
This agent pulls metadata of Time Frames (TF) and distributes the information via ActiveMQ message queues, enabling real-time remote monitoring of ePIC data acquisition processes.
5+
This agent monitors STF (Super Time Frame) files, samples TF (Time Frame) subsets, and distributes metadata via ActiveMQ message queues, enabling real-time remote monitoring of ePIC data acquisition processes. The agent includes both server-side monitoring capabilities and a client for remote visualization.
66

77
## Architecture Overview
88

99
The fast monitoring agent is designed as part of the **SWF testbed ecosystem** and integrates with:
1010
- **swf-monitor**: PostgreSQL database and Django web interface for persistent monitoring data
11-
- **swf-testbed**: Infrastructure orchestration and process management
11+
- **swf-testbed**: Infrastructure orchestration and process management
12+
- **swf-common-lib**: Shared utilities and BaseAgent framework for messaging
1213
- **swf-data-agent**: Receiving messages when STF files are available for fast monitoring
1314

14-
The agent operates as a managed service within the swf-testbed ecosystem, automatically configured and monitored through the central CLI.
15+
The agent operates as a managed service within the swf-testbed ecosystem, automatically configured and monitored through the central CLI. It extends the BaseAgent class from swf-common-lib for consistent messaging and logging across the ecosystem.
1516

1617
--------------
1718

@@ -28,9 +29,14 @@ The agent operates as a managed service within the swf-testbed ecosystem, automa
2829
cd $SWF_PARENT_DIR/swf-testbed
2930
swf-testbed status # Check if fast monitoring agent is running
3031

31-
# Manual development run (for testing)
32+
# Manual development run (message-driven mode - default)
3233
cd ../swf-fastmon-agent
3334
python -m swf_fastmon_agent.main
35+
36+
# Continuous monitoring mode (for testing)
37+
cd ../swf-fastmon-agent
38+
export FASTMON_MODE=continuous
39+
python -m swf_fastmon_agent.main
3440
```
3541

3642
### Working with Django Models
@@ -54,18 +60,29 @@ The fast monitoring agent is configured through the swf-testbed ecosystem:
5460

5561
## Agent Components
5662

57-
- **Metadata Extraction**: Pulls Time Frame metadata from data acquisition systems
58-
- **Message Publishing**: Distributes metadata via ActiveMQ to registered subscribers
59-
- **Database Integration**: Stores monitoring data in swf-monitor PostgreSQL database
60-
- **Subscriber Management**: Handles subscription requests and message routing
61-
- **Status Reporting**: Provides health checks and performance metrics
63+
### Fast Monitor Agent
64+
- **STF File Monitoring**: Monitors directories for newly created STF files
65+
- **TF Sampling**: Simulates TF subsamples from STF files based on configuration
66+
- **Database Integration**: Records STF and TF metadata in swf-monitor PostgreSQL database
67+
- **Message Broadcasting**: Distributes TF file notifications via ActiveMQ to clients
68+
- **Dual Operation Modes**:
69+
- **Message-driven mode**: Responds to data_ready messages from swf-data-agent
70+
- **Continuous mode**: Periodically scans directories (for development/testing)
71+
- **Status Reporting**: Provides health checks and performance metrics via BaseAgent
72+
73+
### Fast Monitoring Client
74+
- **Real-time Display**: Receives and displays TF file notifications in terminal
75+
- **Statistics Tracking**: Monitors per-run TF counts and data volume
76+
- **Graceful Shutdown**: Handles Ctrl+C with summary statistics
77+
- **Configurable Connection**: Supports SSL and custom ActiveMQ settings
6278

6379
### Data Flow
64-
1. **Data Acquisition**: Monitors ePIC DAQ systems for new Time Frame files
65-
2. **Metadata Processing**: Extracts file metadata, checksums, and run conditions
66-
3. **Message Distribution**: Publishes to ActiveMQ topics for real-time monitoring
67-
4. **Database Storage**: Persists metadata in swf-monitor for historical analysis
68-
5. **Web Interface**: Accessible via swf-monitor Django web application
80+
1. **STF File Detection**: Agent monitors directories for new STF files or receives data_ready messages
81+
2. **TF Simulation**: Generates TF subsamples from STF files based on configuration parameters
82+
3. **Database Recording**: Records both STF and TF metadata in swf-monitor database via REST API
83+
4. **Client Notification**: Broadcasts TF file notifications to `/topic/fastmon_client`
84+
5. **Real-time Display**: Client receives notifications and displays formatted TF information
85+
6. **Historical Access**: All data accessible via swf-monitor Django web application
6986

7087
## Development and Testing
7188

@@ -77,7 +94,8 @@ cd $SWF_PARENT_DIR/swf-testbed
7794

7895
# Test agent integration specifically
7996
cd ../swf-fastmon-agent
80-
python -m pytest tests/
97+
python -m pytest src/swf_fastmon_agent/tests/
98+
8199

82100
# Check agent status in testbed
83101
swf-testbed status
@@ -88,7 +106,6 @@ swf-testbed status
88106
# Format and lint (from swf-fastmon-agent directory)
89107
black .
90108
flake8 .
91-
92109
```
93110

94111
## Development Guidelines

0 commit comments

Comments
 (0)