# `sc_crawler.workload_profile_scores`

> Workload profile score computation and database persistence.

# `sc_crawler.workload_profile_scores`

This module computes precomputed compound benchmark scores for all servers
across all vendors and stores them as synthetic BenchmarkScore rows.

**Functions:**

- [**recompute_workload_profiles**](#recompute_workload_profiles) – Recompute workload-profile scores for all servers and persist them.

## func <code class="doc-name">recompute_workload_profiles</code> [workload_profile_scores.py:404–444](https://github.com/SpareCores/sc-crawler/blob/81bb61ea164dda526de4aa6de298810007274f21/src/sc_crawler/workload_profile_scores.py#L404-L444)

```python
recompute_workload_profiles(session)
```

Recompute workload-profile scores for all servers and persist them.

Marks all existing workload-profile BenchmarkScore rows inactive, then
loads all active raw benchmark scores from the database (excluding
workload-profile rows to avoid circularity), computes composite scores vs
per-benchmark medians across all vendors, and inserts fresh rows.

**Parameters:**

- **session** (`Session`) – Active SQLModel session connected to the crawler database.

**Returns:**

- [`int`](https://docs.python.org/3/builtins/functions.html#int) – The number of workload-profile rows inserted.
