@@ -17,6 +17,7 @@ This library provides tools for aggregating sensor data over time windows, detec
1717- [ Architecture Overview] ( #architecture-overview )
1818- [ Running Tests] ( #running-tests )
1919- [ Project Structure] ( #project-structure )
20+ - [ Plotting Results] ( #plotting-results )
2021- [ Implementation Status] ( #implementation-status )
2122
2223---
@@ -41,25 +42,25 @@ This library provides tools for aggregating sensor data over time windows, detec
4142### Option 1: Using Effekt directly
4243
43441 . Clone this repository:
44- ``` sh
45- git clone < repo-url>
46- cd Real-Time-Stream-Processing-Library
47- ```
45+ ``` sh
46+ git clone < repo-url>
47+ cd Real-Time-Stream-Processing-Library
48+ ```
4849
49502 . Make sure Effekt is installed at version ` 0.59.0 ` and available in your PATH. You can verify with:
50- ``` sh
51- effekt --version
52- ```
51+ ``` sh
52+ effekt --version
53+ ```
5354
54553 . Run the main file:
55- ``` sh
56- effekt src/main.effekt
57- ```
56+ ``` sh
57+ effekt src/main.effekt
58+ ```
5859
59604 . Run the tests:
60- ``` sh
61- effekt src/test.effekt
62- ```
61+ ``` sh
62+ effekt src/test.effekt
63+ ```
6364
6465### Option 2: Using Nix
6566
@@ -264,7 +265,6 @@ Tests use the `test` module from Effekt's standard library and return exit code
264265│ ├── main.effekt # Main entry point
265266│ ├── test.effekt # Test runner
266267│ ├── examples.effekt # Usage examples
267- │ ├── lib.effekt # Library re-exports
268268│ ├── lib/ # Library modules
269269│ │ ├── aggregation.effekt
270270│ │ ├── anomaly_detection.effekt
@@ -284,16 +284,50 @@ Tests use the `test` module from Effekt's standard library and return exit code
284284│ ├── lib.effekt
285285│ ├── testdata.csv
286286│ └── testdata_with_timestamp.csv
287- ├── flake.nix # Nix flake configuration
288- ├── flake.lock # Nix lockfile
289- ├── PROJECT_SPEC.md # Project specification
290- ├── ARCHITECTURE.md # Developer/architecture documentation
287+ ├── plot_data.py # Visualization script for results
288+ ├── flake.nix # Nix flake configuration
289+ ├── flake.lock # Nix lockfile
290+ ├── PROJECT_SPEC.md # Project specification
291+ ├── ARCHITECTURE.md # Developer/architecture documentation
291292├── LICENSE
292293└── README.md
293294```
294295
295296---
296297
298+ ## Plotting Results
299+
300+ The ` plot_data.py ` script provides visualization tools for analyzing output from the stream processing library. It generates plots from CSV files produced by the logging handlers.
301+
302+ ### Usage
303+
304+ ``` sh
305+ python plot_data.py --raw < csv_file> --value-name " <Name>" [--out < output.png> ]
306+ python plot_data.py --anomalies < csv_file> --value-name " <Name>" [--show-anomaly-values] [--out < output.png> ]
307+ ```
308+
309+ ### Features
310+
311+ - ** Raw Data Plotting** : Visualize time-series data with timestamps converted from Unix milliseconds
312+ - ** Anomaly Visualization** : Plot data with anomalies highlighted in red, including both point markers and background shading for anomaly regions
313+ - ** Anomaly Scores** : Optional secondary y-axis displaying anomaly scores for detailed analysis
314+ - ** Export** : Save plots to PNG files or display interactively
315+
316+ ### Examples
317+
318+ ``` sh
319+ # Plot raw CPU usage data
320+ python plot_data.py --raw cpu_usage_raw.csv --value-name " CPU Usage" --out raw_plot.png
321+
322+ # Plot with anomalies and scores
323+ python plot_data.py --anomalies cpu_anomalies.csv --value-name " CPU Usage" --show-anomaly-values --out anomaly_plot.png
324+ ```
325+
326+ ### Requirements
327+
328+ - ` pandas ` : Data loading and processing
329+ - ` matplotlib ` : Plotting and visualization
330+
297331## Implementation Status
298332
299333All requirements from the project specification have been implemented:
0 commit comments