# melihsenlen/sentinel_curve architecture

> Architecture diagram of the GitHub repository melihsenlen/sentinel_curve, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/melihsenlen/sentinel_curve
- Repository: https://github.com/melihsenlen/sentinel_curve

## Overview

Sentinel Curve collects Windows CPU and memory measurements, trains an LSTM on the resulting time series, and produces autoregressive forecasts for visualization. The graph follows the documented monitor-to-CSV and train-to-inference workflows; source excerpts show the Python calls and file operations. The notebook’s visualization details and configuration values are not sampled, so those links rely on the README.

Main entry points: [`architecture/inference.py`](https://github.com/melihsenlen/sentinel_curve/blob/main/architecture/inference.py) (Autoregressive inferencer), [`architecture/train.py`](https://github.com/melihsenlen/sentinel_curve/blob/main/architecture/train.py) (Trainer), [`monitor/src/main.cpp`](https://github.com/melihsenlen/sentinel_curve/blob/main/monitor/src/main.cpp) (Monitor loop), [`monitor/src/monitor.cpp`](https://github.com/melihsenlen/sentinel_curve/blob/main/monitor/src/monitor.cpp) (Resource sampler)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_monitoring["Resource monitoring"]
  node_monitor_main["Monitor loop<br/>[main.cpp]"]
  node_sampler["Resource sampler<br/>[monitor.cpp]"]
  node_sample_record["Sample record<br/>[monitor.hpp]"]
  node_measurements["Measurements CSV"]
end

subgraph group_learning["Model training"]
  node_pipeline["Train and infer entry<br/>[run.py]"]
  node_trainer["Trainer<br/>[train.py]"]
  node_data_reader["Time-series reader<br/>[data.py]"]
  node_lstm["LSTM regressor<br/>[model.py]"]
  node_settings["Configuration loader<br/>[config.py]"]
  node_config_file["Run configuration<br/>[config.yaml]"]
end

subgraph group_forecasting["Forecasting"]
  node_weights["Trained weights"]
  node_inferencer["Autoregressive inferencer<br/>[inference.py]"]
end

subgraph group_results["Results and visualization"]
  node_predictions["Forecast CSV"]
  node_notebook["Trend visualization<br/>[analysis.ipynb]"]
end

node_operator(("Operator"))
node_windows["Windows resources"]

node_operator -->|"runs monitor"| node_monitor_main
node_monitor_main -->|"collects sample"| node_sampler
node_sampler -->|"reads usage"| node_windows
node_sampler -->|"returns sample"| node_sample_record
node_monitor_main -->|"writes CSV"| node_measurements
node_operator -->|"runs pipeline"| node_pipeline
node_pipeline -->|"runs training"| node_trainer
node_pipeline -->|"runs inference"| node_inferencer
node_trainer -->|"loads settings"| node_settings
node_settings -->|"reads YAML"| node_config_file
node_trainer -->|"builds sequences"| node_data_reader
node_data_reader -->|"reads measurements"| node_measurements
node_trainer -->|"trains model"| node_lstm
node_trainer -->|"saves weights"| node_weights
node_inferencer -->|"loads settings"| node_settings
node_inferencer -->|"creates sequences"| node_data_reader
node_inferencer -->|"predicts steps"| node_lstm
node_inferencer -->|"loads weights"| node_weights
node_inferencer -->|"writes forecasts"| node_predictions
node_operator -->|"views results"| node_notebook
node_notebook -.->|"visualizes forecasts"| node_predictions

click node_monitor_main "https://github.com/melihsenlen/sentinel_curve/blob/main/monitor/src/main.cpp"
click node_sampler "https://github.com/melihsenlen/sentinel_curve/blob/main/monitor/src/monitor.cpp"
click node_sample_record "https://github.com/melihsenlen/sentinel_curve/blob/main/monitor/include/monitor.hpp"
click node_pipeline "https://github.com/melihsenlen/sentinel_curve/blob/main/pipeline/run.py"
click node_trainer "https://github.com/melihsenlen/sentinel_curve/blob/main/architecture/train.py"
click node_data_reader "https://github.com/melihsenlen/sentinel_curve/blob/main/architecture/data.py"
click node_lstm "https://github.com/melihsenlen/sentinel_curve/blob/main/architecture/model.py"
click node_settings "https://github.com/melihsenlen/sentinel_curve/blob/main/architecture/config.py"
click node_config_file "https://github.com/melihsenlen/sentinel_curve/blob/main/config.yaml"
click node_inferencer "https://github.com/melihsenlen/sentinel_curve/blob/main/architecture/inference.py"
click node_notebook "https://github.com/melihsenlen/sentinel_curve/blob/main/analysis.ipynb"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_monitor_main,node_sampler,node_sample_record,node_measurements toneBlue
class node_pipeline,node_trainer,node_data_reader,node_lstm,node_settings,node_config_file toneAmber
class node_weights,node_inferencer toneMint
class node_predictions,node_notebook toneRose
class node_operator,node_windows toneIndigo
```

## Components

### Resource monitoring

- [Monitor loop](https://github.com/melihsenlen/sentinel_curve/blob/main/monitor/src/main.cpp): `monitor/src/main.cpp`
- [Resource sampler](https://github.com/melihsenlen/sentinel_curve/blob/main/monitor/src/monitor.cpp): `monitor/src/monitor.cpp`
- [Sample record](https://github.com/melihsenlen/sentinel_curve/blob/main/monitor/include/monitor.hpp): `monitor/include/monitor.hpp`
- **Measurements CSV**

### Model training

- [Train and infer entry](https://github.com/melihsenlen/sentinel_curve/blob/main/pipeline/run.py): `pipeline/run.py`
- [Trainer](https://github.com/melihsenlen/sentinel_curve/blob/main/architecture/train.py): `architecture/train.py`
- [Time-series reader](https://github.com/melihsenlen/sentinel_curve/blob/main/architecture/data.py): `architecture/data.py`
- [LSTM regressor](https://github.com/melihsenlen/sentinel_curve/blob/main/architecture/model.py): `architecture/model.py`
- [Configuration loader](https://github.com/melihsenlen/sentinel_curve/blob/main/architecture/config.py): `architecture/config.py`
- [Run configuration](https://github.com/melihsenlen/sentinel_curve/blob/main/config.yaml): `config.yaml`

### Forecasting

- **Trained weights**
- [Autoregressive inferencer](https://github.com/melihsenlen/sentinel_curve/blob/main/architecture/inference.py): `architecture/inference.py`

### Results and visualization

- **Forecast CSV**
- [Trend visualization](https://github.com/melihsenlen/sentinel_curve/blob/main/analysis.ipynb): `analysis.ipynb`

### Other components

- **Operator**
- **Windows resources**

## Connections

- Operator → Monitor loop: runs monitor (evidence: `README.md`)
- Monitor loop → Resource sampler: collects sample (evidence: `monitor/src/main.cpp`)
- Resource sampler → Windows resources: reads usage (evidence: `monitor/src/monitor.cpp`)
- Resource sampler → Sample record: returns sample (evidence: `monitor/src/monitor.cpp`)
- Monitor loop → Measurements CSV: writes CSV (evidence: `monitor/src/main.cpp`)
- Operator → Train and infer entry: runs pipeline (evidence: `README.md`)
- Train and infer entry → Trainer: runs training (evidence: `pipeline/run.py`)
- Train and infer entry → Autoregressive inferencer: runs inference (evidence: `pipeline/run.py`)
- Trainer → Configuration loader: loads settings (evidence: `architecture/train.py`)
- Configuration loader → Run configuration: reads YAML (evidence: `architecture/config.py`)
- Trainer → Time-series reader: builds sequences (evidence: `architecture/train.py`)
- Time-series reader → Measurements CSV: reads measurements (evidence: `README.md`)
- Trainer → LSTM regressor: trains model (evidence: `architecture/train.py`)
- Trainer → Trained weights: saves weights (evidence: `architecture/train.py`)
- Autoregressive inferencer → Configuration loader: loads settings (evidence: `architecture/inference.py`)
- Autoregressive inferencer → Time-series reader: creates sequences (evidence: `architecture/inference.py`)
- Autoregressive inferencer → LSTM regressor: predicts steps (evidence: `architecture/inference.py`)
- Autoregressive inferencer → Trained weights: loads weights (evidence: `architecture/inference.py`)
- Autoregressive inferencer → Forecast CSV: writes forecasts (evidence: `architecture/inference.py`)
- Operator → Trend visualization: views results (evidence: `README.md`)
- Trend visualization → Forecast CSV: visualizes forecasts (evidence: `README.md`)
