Skip to content

Detector catalog / Cost

CSTOR

Cache utilization

A cached dataset does not fit in memory or spills to disk.

Outcome
Cost
Scope
Judged on the whole run
Usual fix
A change in the job code
Dashboard
Shown in the reference region, below the action widgets. It informs; it does not rank a fix.
CI gate
No budget flag: gate it with --fail-on-introduced against a baseline

An example finding

Where you see it

Dashboard

The CSTOR tag marks it in the reference region of the dashboard, below the action widgets. How to read it in the findings guide.

Agent (MCP)

An assistant can read this entry with the list_detectors tool and its background with get_finding_documentation. The call and the response below come from a real run of the MCP server.

Call

{
  "tool": "list_detectors",
  "arguments": {
    "type": "cacheUtilization"
  }
}

Response

{
  "count": 1,
  "detectors": [
    {
      "type": "cacheUtilization",
      "name": "cache utilization",
      "tag": "CSTOR",
      "tagSharedWith": [],
      "family": "cost",
      "pitch": "A cached dataset does not fit in memory or spills to disk.",
      "region": "reference",
      "scope": "app",
      "fixEffort": "code",
      "thresholdSummary": "cached partitions evicted or spilled to disk",
      "detectors": [
        {
          "detector": "cacheUtilization",
          "version": 2,
          "thresholds": {
            "cachedRatioWarn": 0.5,
            "cachedRatioInfo": 0.9,
            "diskRatioWarn": 0.4,
            "diskRatioInfo": 0.15
          }
        }
      ],
      "pages": {
        "catalog": "docs/detectors/cacheUtilization.html",
        "guide": "docs/user-guide/understanding-findings.html#cstor"
      },
      "tuning": {
        "kind": "section",
        "anchor": "#bottleneck-cache-utilization",
        "path": "docs/tuning-reference/memory-model.html#bottleneck-cache-utilization"
      },
      "gate": null
    }
  ]
}

get_finding_documentation call

{
  "tool": "get_finding_documentation",
  "arguments": {
    "type": "cacheUtilization"
  }
}

Its response, with each Markdown body replaced by its length

{
  "type": "cacheUtilization",
  "name": "Cache Utilization",
  "detectionDoc": {
    "tag": "CSTOR",
    "title": "Cache storage",
    "content": "<715 characters of Markdown>"
  },
  "tuningDoc": {
    "anchor": "#bottleneck-cache-utilization",
    "title": "Memory Management",
    "content": "<16687 characters of Markdown>"
  }
}

CI (CLI)

List this entry from the command line. The output below is a real run of the command. Budgets and exit codes are in the CI guide.

sparkforensics-analyze detectors --type cacheUtilization --format md
# Detectors (1)

## Cost

| Tag | Type | Scope | Fix | Gate | What it finds |
| --- | --- | --- | --- | --- | --- |
| CSTOR | `cacheUtilization` | app | code |  | A cached dataset does not fit in memory or spills to disk. |

Report only this finding type for a run with --type:

sparkforensics-analyze <event-log> --type cacheUtilization --impact critical,warning,info

It has no budget flag. Fail a build on a new one by comparing against a baseline with --fail-on-introduced.

Airflow

The operator has no budget parameter for it. Use fail_on_introduced with a baseline.

check_spark_job = SparkForensicsOperator(
    task_id="check_spark_job",
    log_source=...,
    backend=SubprocessAnalyzeHook(),
    baseline_log_source=...,
    fail_on_introduced="critical",
)

The operator works per run, and its summary counts findings per impact band. See the operator for its parameters.

How it is measured

Thresholds

Cached partitions evicted or spilled to disk.

cacheUtilization version 2

ThresholdDefault
cachedRatioWarn0.5
cachedRatioInfo0.9
diskRatioWarn0.4
diskRatioInfo0.15

Each rule's impact bands and fixed fallbacks are in the threshold tables.

Override a default per run with --thresholds; see Tuning detector thresholds.

Docs