# ntua-thesis/soe-test-app architecture

> Architecture diagram of the GitHub repository ntua-thesis/soe-test-app, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ntua-thesis/soe-test-app
- Repository: https://github.com/ntua-thesis/soe-test-app

## Overview

This repository combines a CPU-and-memory-intensive primes HTTP service with Kubernetes profiling tools and resource-recommendation experiments. The principal workflow is to deploy and load-test the service, collect Prometheus metrics, compile experiment results, and use those data to train or compare resource-selection models. The tree and sampled sources support the load-generation, metric-query, dataset, modeling, and plotting roles shown here; some model-data handoffs and unsampled profiling details are omitted where wiring is uncertain.

Main entry points: [`main.go`](https://github.com/ntua-thesis/soe-test-app/blob/master/main.go) (Primes HTTP server), [`profiling/experiment_runner.py`](https://github.com/ntua-thesis/soe-test-app/blob/master/profiling/experiment_runner.py) (Resource sweep), [`model/create_dataset.py`](https://github.com/ntua-thesis/soe-test-app/blob/master/model/create_dataset.py) (Dataset compilation), [`profiling/simulate.py`](https://github.com/ntua-thesis/soe-test-app/blob/master/profiling/simulate.py) (Trace simulation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_service["Primes Service"]
  node_primes["Primes HTTP server<br/>[main.go]"]
end

subgraph group_profiling["Load Profiling"]
  node_continuous["Continuous load<br/>[continuous_load.py]"]
  node_experiment["Resource sweep"]
  node_simulation["Trace simulation<br/>[simulate.py]"]
end

subgraph group_modeling["Metrics And Models"]
  node_gather["Metric gathering<br/>[gather_metrics.py]"]
  node_dataset["Dataset compilation<br/>[create_dataset.py]"]
  node_knn["KNN recommender<br/>[knn.py]"]
  node_forest["Random forest<br/>[random_forest.py]"]
  node_xgboost["XGBoost model<br/>[xg-boost.py]"]
end

subgraph group_analysis["Analysis And Deployment"]
  node_chart["Kubernetes chart"]
  node_graphs["Metric graphs<br/>[create_graphs.py]"]
  node_comparison["Experiment comparison"]
  node_modelgraphs["Model analysis<br/>[visualize.py]"]
end

node_user(("Load tester"))
node_cluster["Kubernetes cluster"]
node_prometheus[("Prometheus")]

node_user -->|"requests primes"| node_primes
node_primes -->|"returns count"| node_user
node_continuous -->|"updates resources"| node_chart
node_chart -->|"deploys service"| node_cluster
node_cluster -->|"serves endpoint"| node_primes
node_continuous -->|"sends load"| node_primes
node_experiment -->|"updates resources"| node_chart
node_experiment -->|"sends load"| node_cluster
node_experiment -->|"queries metrics"| node_prometheus
node_simulation -->|"replays requests"| node_primes
node_simulation -->|"queries metrics"| node_prometheus
node_gather -->|"queries metrics"| node_prometheus
node_gather -->|"provides metrics"| node_dataset
node_dataset -.->|"provides compiled data"| node_knn
node_dataset -->|"provides compiled data"| node_forest
node_dataset -.->|"provides training data"| node_xgboost
node_experiment -.->|"exports metric CSVs"| node_graphs
node_simulation -.->|"exports metric CSVs"| node_graphs
node_graphs -.->|"produces plots"| node_comparison
node_knn -.->|"provides model results"| node_modelgraphs
node_forest -.->|"provides model results"| node_modelgraphs
node_xgboost -.->|"provides model results"| node_modelgraphs

click node_primes "https://github.com/ntua-thesis/soe-test-app/blob/master/main.go"
click node_chart "https://github.com/ntua-thesis/soe-test-app/tree/master/chart/templates"
click node_continuous "https://github.com/ntua-thesis/soe-test-app/blob/master/profiling/continuous_load.py"
click node_experiment "https://github.com/ntua-thesis/soe-test-app/blob/master/profiling/experiment_runner.py"
click node_simulation "https://github.com/ntua-thesis/soe-test-app/blob/master/profiling/simulate.py"
click node_gather "https://github.com/ntua-thesis/soe-test-app/blob/master/model/gather_metrics.py"
click node_dataset "https://github.com/ntua-thesis/soe-test-app/blob/master/model/create_dataset.py"
click node_knn "https://github.com/ntua-thesis/soe-test-app/blob/master/model/knn.py"
click node_forest "https://github.com/ntua-thesis/soe-test-app/blob/master/model/random_forest.py"
click node_xgboost "https://github.com/ntua-thesis/soe-test-app/blob/master/model/xg-boost.py"
click node_graphs "https://github.com/ntua-thesis/soe-test-app/blob/master/profiling/create_graphs.py"
click node_comparison "https://github.com/ntua-thesis/soe-test-app/blob/master/profiling/comparison_graphs.py"
click node_modelgraphs "https://github.com/ntua-thesis/soe-test-app/blob/master/model/visualize.py"

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_primes toneBlue
class node_continuous,node_experiment,node_simulation,node_prometheus toneAmber
class node_gather,node_dataset,node_knn,node_forest,node_xgboost toneMint
class node_chart,node_graphs,node_comparison,node_modelgraphs toneRose
class node_user,node_cluster toneIndigo
```

## Components

### Primes Service

- [Primes HTTP server](https://github.com/ntua-thesis/soe-test-app/blob/master/main.go): `main.go`

### Load Profiling

- [Continuous load](https://github.com/ntua-thesis/soe-test-app/blob/master/profiling/continuous_load.py): `profiling/continuous_load.py`
- [Resource sweep](https://github.com/ntua-thesis/soe-test-app/blob/master/profiling/experiment_runner.py): `profiling/experiment_runner.py`
- [Trace simulation](https://github.com/ntua-thesis/soe-test-app/blob/master/profiling/simulate.py): `profiling/simulate.py`

### Metrics And Models

- [Metric gathering](https://github.com/ntua-thesis/soe-test-app/blob/master/model/gather_metrics.py): `model/gather_metrics.py`
- [Dataset compilation](https://github.com/ntua-thesis/soe-test-app/blob/master/model/create_dataset.py): `model/create_dataset.py`
- [KNN recommender](https://github.com/ntua-thesis/soe-test-app/blob/master/model/knn.py): `model/knn.py`
- [Random forest](https://github.com/ntua-thesis/soe-test-app/blob/master/model/random_forest.py): `model/random_forest.py`
- [XGBoost model](https://github.com/ntua-thesis/soe-test-app/blob/master/model/xg-boost.py): `model/xg-boost.py`

### Analysis And Deployment

- [Kubernetes chart](https://github.com/ntua-thesis/soe-test-app/tree/master/chart/templates): `chart/templates`
- [Metric graphs](https://github.com/ntua-thesis/soe-test-app/blob/master/profiling/create_graphs.py): `profiling/create_graphs.py`
- [Experiment comparison](https://github.com/ntua-thesis/soe-test-app/blob/master/profiling/comparison_graphs.py): `profiling/comparison_graphs.py`
- [Model analysis](https://github.com/ntua-thesis/soe-test-app/blob/master/model/visualize.py): `model/visualize.py`

### Other components

- **Load tester**
- **Kubernetes cluster**
- **Prometheus**

## Connections

- Load tester → Primes HTTP server: requests primes
- Primes HTTP server → Load tester: returns count
- Continuous load → Kubernetes chart: updates resources
- Kubernetes chart → Kubernetes cluster: deploys service
- Kubernetes cluster → Primes HTTP server: serves endpoint
- Continuous load → Primes HTTP server: sends load
- Resource sweep → Kubernetes chart: updates resources
- Resource sweep → Kubernetes cluster: sends load
- Resource sweep → Prometheus: queries metrics
- Trace simulation → Primes HTTP server: replays requests
- Trace simulation → Prometheus: queries metrics
- Metric gathering → Prometheus: queries metrics
- Metric gathering → Dataset compilation: provides metrics
- Dataset compilation → KNN recommender: provides compiled data
- Dataset compilation → Random forest: provides compiled data
- Dataset compilation → XGBoost model: provides training data
- Resource sweep → Metric graphs: exports metric CSVs
- Trace simulation → Metric graphs: exports metric CSVs
- Metric graphs → Experiment comparison: produces plots
- KNN recommender → Model analysis: provides model results
- Random forest → Model analysis: provides model results
- XGBoost model → Model analysis: provides model results
