# `sc_crawler.workload_profiles`

> Workload profile definitions for compound benchmark scoring.

# `sc_crawler.workload_profiles`

Each workload profile is a weighted combination of benchmark scores that
represents a specific real-world usage pattern. Scores are aggregated as a
weighted average (geometric mean) of benchmark scores compared to their
medians. A score of 1.0 represents a synthetic baseline server with the
median performance of each component benchmark.

Weights within each workload sum to 1.0.

**Classes:**

- [**BenchmarkEntry**](#benchmarkentry) – A single benchmark component contributing to a workload profile score.
- [**MeasuredSource**](#measuredsource) – Benchmark score measured directly by the Inspector.
- [**ExtrapolatedSource**](#extrapolatedsource) – Benchmark score derived from the server's own measurements of other benchmarks.
- [**CompoundSource**](#compoundsource) – Benchmark score aggregated from the scores of several component benchmarks.
- [**Workload**](#workload) – A named workload profile composed of weighted benchmark entries.

**Attributes:**

- [**WORKLOADS**](#workloads) ([`dict`](https://docs.python.org/3/builtins/stdtypes.html#dict)`[`[`str`](https://docs.python.org/3/builtins/stdtypes.html#str), [`Workload`](#workload)`]`) – Workload profile definitions keyed by workload ID.

## class <code class="doc-name">BenchmarkEntry</code> [workload_profiles.py:28–57](https://github.com/SpareCores/sc-crawler/blob/81bb61ea164dda526de4aa6de298810007274f21/src/sc_crawler/workload_profiles.py#L28-L57)

Bases: [`BaseModel`](https://docs.pydantic.dev/latest/api/pydantic/base_model/#pydantic.BaseModel)

A single benchmark component contributing to a workload profile score.

**Functions:**

- [**effective_penalty**](#benchmarkentryeffective_penalty) – Return the penalty floor used when on_missing is PENALIZE.

**Attributes:**

- [**benchmark_id**](#benchmarkentrybenchmark_id) ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str)) – The benchmark ID of a BenchmarkScore.
- [**weight**](#benchmarkentryweight) ([`float`](https://docs.python.org/3/builtins/functions.html#float)) – Relative weight of this component. Weights within a workload sum to 1.0.
- [**label**](#benchmarkentrylabel) ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str)) – Human-readable description of what this component measures.
- [**config_filter**](#benchmarkentryconfig_filter) ([`dict`](https://docs.python.org/3/builtins/stdtypes.html#dict)`[`[`str`](https://docs.python.org/3/builtins/stdtypes.html#str), [`Any`](https://docs.python.org/3/library/typing.html#typing.Any)`]` | `None`) – Optional filter applied to the benchmark's config JSON column.
- [**on_missing**](#benchmarkentryon_missing) ([`BenchmarkComponentMissingPolicy`](https://docs.sparecores.com/crawler/reference/table_fields.md#benchmarkcomponentmissingpolicy)) – How to handle a missing or invalid measurement for this component.
- [**penalty**](#benchmarkentrypenalty) ([`float`](https://docs.python.org/3/builtins/functions.html#float) | `None`) – Substituted normalized ratio when on_missing is PENALIZE.

### attr <code class="doc-parent">BenchmarkEntry.</code><code class="doc-name">benchmark_id</code> [workload_profiles.py:31](https://github.com/SpareCores/sc-crawler/blob/81bb61ea164dda526de4aa6de298810007274f21/src/sc_crawler/workload_profiles.py#L31)

```python
benchmark_id: str
```

The benchmark ID of a BenchmarkScore.

### attr <code class="doc-parent">BenchmarkEntry.</code><code class="doc-name">weight</code> [workload_profiles.py:33](https://github.com/SpareCores/sc-crawler/blob/81bb61ea164dda526de4aa6de298810007274f21/src/sc_crawler/workload_profiles.py#L33)

```python
weight: float
```

Relative weight of this component. Weights within a workload sum to 1.0.

### attr <code class="doc-parent">BenchmarkEntry.</code><code class="doc-name">label</code> [workload_profiles.py:35](https://github.com/SpareCores/sc-crawler/blob/81bb61ea164dda526de4aa6de298810007274f21/src/sc_crawler/workload_profiles.py#L35)

```python
label: str
```

Human-readable description of what this component measures.

### attr <code class="doc-parent">BenchmarkEntry.</code><code class="doc-name">config_filter</code> [workload_profiles.py:37](https://github.com/SpareCores/sc-crawler/blob/81bb61ea164dda526de4aa6de298810007274f21/src/sc_crawler/workload_profiles.py#L37)

```python
config_filter: dict[str, Any] | None = None
```

Optional filter applied to the benchmark's config JSON column.

### attr <code class="doc-parent">BenchmarkEntry.</code><code class="doc-name">on_missing</code> [workload_profiles.py:39](https://github.com/SpareCores/sc-crawler/blob/81bb61ea164dda526de4aa6de298810007274f21/src/sc_crawler/workload_profiles.py#L39)

```python
on_missing: BenchmarkComponentMissingPolicy = BenchmarkComponentMissingPolicy.IGNORE
```

How to handle a missing or invalid measurement for this component.

### attr <code class="doc-parent">BenchmarkEntry.</code><code class="doc-name">penalty</code> [workload_profiles.py:41](https://github.com/SpareCores/sc-crawler/blob/81bb61ea164dda526de4aa6de298810007274f21/src/sc_crawler/workload_profiles.py#L41)

```python
penalty: float | None = None
```

Substituted normalized ratio when on_missing is PENALIZE.

### meth <code class="doc-parent">BenchmarkEntry.</code><code class="doc-name">effective_penalty</code> [workload_profiles.py:46–48](https://github.com/SpareCores/sc-crawler/blob/81bb61ea164dda526de4aa6de298810007274f21/src/sc_crawler/workload_profiles.py#L46-L48)

```python
effective_penalty()
```

Return the penalty floor used when on_missing is PENALIZE.

## class <code class="doc-name">MeasuredSource</code> [workload_profiles.py:60–63](https://github.com/SpareCores/sc-crawler/blob/81bb61ea164dda526de4aa6de298810007274f21/src/sc_crawler/workload_profiles.py#L60-L63)

Bases: [`Json`](https://docs.sparecores.com/crawler/reference/table_fields.md#json)

Benchmark score measured directly by the Inspector.

## class <code class="doc-name">ExtrapolatedSource</code> [workload_profiles.py:66–71](https://github.com/SpareCores/sc-crawler/blob/81bb61ea164dda526de4aa6de298810007274f21/src/sc_crawler/workload_profiles.py#L66-L71)

Bases: [`Json`](https://docs.sparecores.com/crawler/reference/table_fields.md#json)

Benchmark score derived from the server's own measurements of other benchmarks.

## class <code class="doc-name">CompoundSource</code> [workload_profiles.py:74–90](https://github.com/SpareCores/sc-crawler/blob/81bb61ea164dda526de4aa6de298810007274f21/src/sc_crawler/workload_profiles.py#L74-L90)

Bases: [`Json`](https://docs.sparecores.com/crawler/reference/table_fields.md#json)

Benchmark score aggregated from the scores of several component benchmarks.

**Attributes:**

- [**aggregation**](#compoundsourceaggregation) ([`BenchmarkComponentAggregationMethod`](https://docs.sparecores.com/crawler/reference/table_fields.md#benchmarkcomponentaggregationmethod)) – How component benchmark scores are combined into one composite score.
- [**normalization**](#compoundsourcenormalization) ([`BenchmarkComponentNormalizationMethod`](https://docs.sparecores.com/crawler/reference/table_fields.md#benchmarkcomponentnormalizationmethod)) – How each raw benchmark value is scaled to be comparable across benchmarks.
- [**components**](#compoundsourcecomponents) ([`list`](https://docs.python.org/3/builtins/stdtypes.html#list)`[`[`BenchmarkEntry`](#benchmarkentry)`]`) – The components of the workload profile.
- [**impact_formula**](#compoundsourceimpact_formula) ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str) | `None`) – Human-friendly explanation of how to read per-component ``impact`` on scores.

### attr <code class="doc-parent">CompoundSource.</code><code class="doc-name">aggregation</code> [workload_profiles.py:78](https://github.com/SpareCores/sc-crawler/blob/81bb61ea164dda526de4aa6de298810007274f21/src/sc_crawler/workload_profiles.py#L78)

```python
aggregation: BenchmarkComponentAggregationMethod
```

How component benchmark scores are combined into one composite score.

### attr <code class="doc-parent">CompoundSource.</code><code class="doc-name">normalization</code> [workload_profiles.py:80](https://github.com/SpareCores/sc-crawler/blob/81bb61ea164dda526de4aa6de298810007274f21/src/sc_crawler/workload_profiles.py#L80)

```python
normalization: BenchmarkComponentNormalizationMethod
```

How each raw benchmark value is scaled to be comparable across benchmarks.

### attr <code class="doc-parent">CompoundSource.</code><code class="doc-name">components</code> [workload_profiles.py:82](https://github.com/SpareCores/sc-crawler/blob/81bb61ea164dda526de4aa6de298810007274f21/src/sc_crawler/workload_profiles.py#L82)

```python
components: list[BenchmarkEntry]
```

The components of the workload profile.

### attr <code class="doc-parent">CompoundSource.</code><code class="doc-name">impact_formula</code> [workload_profiles.py:84](https://github.com/SpareCores/sc-crawler/blob/81bb61ea164dda526de4aa6de298810007274f21/src/sc_crawler/workload_profiles.py#L84)

```python
impact_formula: str | None = None
```

Human-friendly explanation of how to read per-component ``impact`` on scores.

## class <code class="doc-name">Workload</code> [workload_profiles.py:118–128](https://github.com/SpareCores/sc-crawler/blob/81bb61ea164dda526de4aa6de298810007274f21/src/sc_crawler/workload_profiles.py#L118-L128)

Bases: [`BaseModel`](https://docs.pydantic.dev/latest/api/pydantic/base_model/#pydantic.BaseModel)

A named workload profile composed of weighted benchmark entries.

**Attributes:**

- [**name**](#workloadname) ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str)) – Short human-readable name, e.g. 'Web server'.
- [**version**](#workloadversion) ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str)) – Workload profile version.
- [**rationale**](#workloadrationale) ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str)) – Explanation of which benchmarks were chosen and why.
- [**benchmarks**](#workloadbenchmarks) ([`list`](https://docs.python.org/3/builtins/stdtypes.html#list)`[`[`BenchmarkEntry`](#benchmarkentry)`]`) – Ordered list of benchmark components with weights.

### attr <code class="doc-parent">Workload.</code><code class="doc-name">name</code> [workload_profiles.py:121](https://github.com/SpareCores/sc-crawler/blob/81bb61ea164dda526de4aa6de298810007274f21/src/sc_crawler/workload_profiles.py#L121)

```python
name: str
```

Short human-readable name, e.g. 'Web server'.

### attr <code class="doc-parent">Workload.</code><code class="doc-name">version</code> [workload_profiles.py:123](https://github.com/SpareCores/sc-crawler/blob/81bb61ea164dda526de4aa6de298810007274f21/src/sc_crawler/workload_profiles.py#L123)

```python
version: str
```

Workload profile version.

### attr <code class="doc-parent">Workload.</code><code class="doc-name">rationale</code> [workload_profiles.py:125](https://github.com/SpareCores/sc-crawler/blob/81bb61ea164dda526de4aa6de298810007274f21/src/sc_crawler/workload_profiles.py#L125)

```python
rationale: str
```

Explanation of which benchmarks were chosen and why.

### attr <code class="doc-parent">Workload.</code><code class="doc-name">benchmarks</code> [workload_profiles.py:127](https://github.com/SpareCores/sc-crawler/blob/81bb61ea164dda526de4aa6de298810007274f21/src/sc_crawler/workload_profiles.py#L127)

```python
benchmarks: list[BenchmarkEntry]
```

Ordered list of benchmark components with weights.

## attr <code class="doc-name">WORKLOADS</code> [workload_profiles.py:131–476](https://github.com/SpareCores/sc-crawler/blob/81bb61ea164dda526de4aa6de298810007274f21/src/sc_crawler/workload_profiles.py#L131-L476)

```python
WORKLOADS: dict[str, Workload] = {'web': Workload(name='Web Server', version='2.0', rationale='Primary workloads drivers are single-process static HTTP serving speed and throughput, text processing, TLS termination, and asset compression.', benchmarks=[BenchmarkEntry(benchmark_id='static_web:rps-extrapolated', weight=0.3, label='Static web RPS (1 KiB, 8 conn/vCPU)', config_filter={'size': '1k', 'connections_per_vcpus': 8.0}), BenchmarkEntry(benchmark_id='static_web:rps-extrapolated', weight=0.2, label='Static web RPS (64 KiB, 8 conn/vCPU)', config_filter={'size': '64k', 'connections_per_vcpus': 8.0}), BenchmarkEntry(benchmark_id='static_web:throughput-extrapolated', weight=0.2, label='Static web throughput (256 KiB, 8 conn/vCPU)', config_filter={'size': '256k', 'connections_per_vcpus': 8.0}), BenchmarkEntry(benchmark_id='openssl', weight=0.2, label='OpenSSL AES-256-CBC (16 kB blocks)', config_filter={'algo': 'AES-256-CBC', 'block_size': 16384}), BenchmarkEntry(benchmark_id='compression_text:compress', weight=0.05, label='Gzip compression (multi-core, level 5)', config_filter={'algo': 'gzip', 'compression_level': 5, 'cores': 'multi'}), BenchmarkEntry(benchmark_id='passmark:cpu_string_sorting_test', weight=0.05, label='PassMark string sorting')]), 'compute': Workload(name='Compute Heavy Applications', version='2.0', rationale='Number-crunching workload augmenting raw CPU performance stressing, general CPU performance benchmarks, memory bandwidth, and pure math computation speed like floating point, integer, SIMD (AVX/SSE/FMA) operations.', benchmarks=[BenchmarkEntry(benchmark_id='stress_ng:bestn', weight=0.15, label='stress-ng div16 best-N cores'), BenchmarkEntry(benchmark_id='stress_ng:best1', weight=0.1, label='stress-ng div16 single core'), BenchmarkEntry(benchmark_id='passmark:cpu_mark', weight=0.2, label='PassMark CPU Mark (composite)'), BenchmarkEntry(benchmark_id='bw_mem', weight=0.1, label='Memory bandwidth (read, 64 MB)', config_filter={'operation': 'rd', 'size': 64.0}), BenchmarkEntry(benchmark_id='passmark:cpu_floating_point_maths_test', weight=0.15, label='PassMark floating point'), BenchmarkEntry(benchmark_id='passmark:cpu_extended_instructions_test', weight=0.15, label='PassMark AVX/SSE/FMA (SIMD)'), BenchmarkEntry(benchmark_id='passmark:cpu_integer_maths_test', weight=0.1, label='PassMark integer math'), BenchmarkEntry(benchmark_id='passmark:cpu_physics_test', weight=0.05, label='PassMark physics simulation')]), 'cache': Workload(name='Cache Intensive', version='2.0', rationale='In-memory key-value store workload, mixing direct Redis performance metrics with memory speed and latency benchmarks, and single-core CPU performance profiles.', benchmarks=[BenchmarkEntry(benchmark_id='redis:rps-extrapolated', weight=0.5, label='Redis RPS (pipeline=1, SET)', config_filter={'operation': 'SET', 'pipeline': 1.0}), BenchmarkEntry(benchmark_id='redis:rps-extrapolated', weight=0.2, label='Redis RPS (pipeline=16, SET)', config_filter={'operation': 'SET', 'pipeline': 16.0}), BenchmarkEntry(benchmark_id='passmark:memory_mark', weight=0.1, label='PassMark Memory Mark (composite)'), BenchmarkEntry(benchmark_id='bw_mem', weight=0.1, label='Memory bandwidth (read, 16 MB ~ L3)', config_filter={'operation': 'rd', 'size': 16.0}), BenchmarkEntry(benchmark_id='passmark:cpu_single_threaded_test', weight=0.1, label='PassMark single-thread CPU')]), 'data_analysis': Workload(name='Data Analysis', version='2.0', rationale='Data analysis and ETL workloads are memory-bandwidth-bound and CPU-throughput-driven. The profile combines general CPU performance and memory bandwidth/latency as the primary drivers, supplemented by single-core compression speed as a proxy for serialisation-heavy ETL tasks.', benchmarks=[BenchmarkEntry(benchmark_id='passmark:cpu_mark', weight=0.7, label='PassMark CPU Mark (composite)'), BenchmarkEntry(benchmark_id='compression_text:compress', weight=0.1, label='Gzip compression (single-core, level 5)', config_filter={'algo': 'gzip', 'compression_level': 5, 'cores': 'single'}), BenchmarkEntry(benchmark_id='bw_mem', weight=0.1, label='Memory bandwidth (read, 64 MB)', config_filter={'operation': 'rd', 'size': 64.0}), BenchmarkEntry(benchmark_id='passmark:memory_mark', weight=0.1, label='PassMark Memory Mark (composite)')]), 'llm': Workload(name='LLM Inference', version='2.0', rationale='VRAM and memory-bandwidth-bound LLM inference workload, using direct LLM speed benchmarks at three model sizes, and supplementing with raw memory bandwidth and SIMD performance benchmarks.', benchmarks=[BenchmarkEntry(benchmark_id='llm_speed:text_generation', weight=0.15, label='LLM text generation (SmolLM-135M, 128 tok)', config_filter={'model': 'SmolLM-135M.Q4_K_M.gguf', 'tokens': 128}, on_missing=BenchmarkComponentMissingPolicy.REQUIRE), BenchmarkEntry(benchmark_id='llm_speed:prompt_processing', weight=0.15, label='LLM prompt processing (SmolLM-135M, 512 tok)', config_filter={'model': 'SmolLM-135M.Q4_K_M.gguf', 'tokens': 512}, on_missing=BenchmarkComponentMissingPolicy.REQUIRE), BenchmarkEntry(benchmark_id='llm_speed:text_generation', weight=0.15, label='LLM text generation (Llama 7B, 128 tok)', config_filter={'model': 'llama-7b.Q4_K_M.gguf', 'tokens': 128}, on_missing=BenchmarkComponentMissingPolicy.PENALIZE, penalty=0.0001), BenchmarkEntry(benchmark_id='llm_speed:prompt_processing', weight=0.15, label='LLM prompt processing (Llama 7B, 512 tok)', config_filter={'model': 'llama-7b.Q4_K_M.gguf', 'tokens': 512}, on_missing=BenchmarkComponentMissingPolicy.PENALIZE, penalty=0.0001), BenchmarkEntry(benchmark_id='llm_speed:text_generation', weight=0.15, label='LLM text generation (Llama-3.3 70B, 128 tok)', config_filter={'model': 'Llama-3.3-70B-Instruct-Q4_K_M.gguf', 'tokens': 128}, on_missing=BenchmarkComponentMissingPolicy.PENALIZE, penalty=0.01), BenchmarkEntry(benchmark_id='llm_speed:prompt_processing', weight=0.15, label='LLM prompt processing (Llama-3.3 70B, 512 tok)', config_filter={'model': 'Llama-3.3-70B-Instruct-Q4_K_M.gguf', 'tokens': 512}, on_missing=BenchmarkComponentMissingPolicy.PENALIZE, penalty=0.01), BenchmarkEntry(benchmark_id='bw_mem', weight=0.05, label='Memory bandwidth (read, 256 MB)', config_filter={'operation': 'rd', 'size': 256.0}), BenchmarkEntry(benchmark_id='passmark:cpu_extended_instructions_test', weight=0.025, label='PassMark AVX/SSE/FMA (SIMD)'), BenchmarkEntry(benchmark_id='passmark:cpu_floating_point_maths_test', weight=0.025, label='PassMark floating point')]), 'cicd': Workload(name='CI/CD Build', version='2.0', rationale='Build performance is mainly driven by multi-core compilation throughput, but also bundles single-core compilation speed and general CPU performance, multi-core compression and text/scripting processing.', benchmarks=[BenchmarkEntry(benchmark_id='geekbench:clang', weight=0.5, label='Geekbench Clang compilation (multi-core)', config_filter={'cores': 'multi'}), BenchmarkEntry(benchmark_id='geekbench:clang', weight=0.1, label='Geekbench Clang compilation (single-core)', config_filter={'cores': 'single'}), BenchmarkEntry(benchmark_id='stress_ng:bestn', weight=0.2, label='stress-ng div16 best-N cores'), BenchmarkEntry(benchmark_id='passmark:cpu_integer_maths_test', weight=0.05, label='PassMark integer math'), BenchmarkEntry(benchmark_id='passmark:cpu_compression_test', weight=0.05, label='PassMark compression'), BenchmarkEntry(benchmark_id='compression_text:compress', weight=0.05, label='Brotli compression (multi-core, level 0)', config_filter={'algo': 'brotli', 'compression_level': 0, 'cores': 'single'}), BenchmarkEntry(benchmark_id='passmark:cpu_string_sorting_test', weight=0.05, label='PassMark string sorting')])}
```

Workload profile definitions keyed by workload ID.
