Mean time between failures (MTBF)¶
How long does an asset run, on average, before it fails?
Current value (maintenance case data): 118.0 h - ! Watch. Open the case.
| Field | Value |
|---|---|
| Definition | Total operating hours divided by the number of failures in the same scope and period. |
| Formula | sum(operating_hours) / sum(failures) |
| Unit | hours |
| Granularity | Asset x month; rolled up by asset class. |
| Direction | Higher is better ↑ |
| Target and thresholds | ≥ 150.0 h (amber ≥ 100.0 h) |
| Parameters | – |
| Owner | Reliability Engineer |
| Source | Process data (UCI AI4I 2020) mapped to an asset fleet + work-order generator |
| Input | table asset_periods, columns operating_hours, failures |
| Recommended chart | bar - Ranking assets: the lowest bars are the reliability backlog. |
| Related KPIs | Mean time to repair (MTTR), Availability, Planned maintenance share |
How to read it¶
Higher means more reliable. Compute it as a ratio of sums over the period, never as the average of monthly MTBFs (months with zero failures break that).
Common misreadings¶
- Averaging per-asset MTBF values instead of sum(hours)/sum(failures) overweights rarely-used assets.
- Using calendar hours instead of operating hours rewards idle assets.
- With very few failures the value is volatile; report the failure count next to it.
Worked example (from the test suite)¶
| asset_id | operating_hours | failures |
|---|---|---|
| A | 400.0 | 2 |
| A | 300.0 | 0 |
| B | 500.0 | 1 |
Expected result: 400.00 h. Ratio of sums: (400 + 300 + 500) / (2 + 0 + 1) = 1200 / 3 = 400 h. Averaging per-row MTBF would fail on the 0-failure row.
This example is asserted in tests/test_formulas.py against the Python function and in tests/test_sql.py against the SQL below.
Implementations¶
Python function (the single implementation used by the site):
@kpi("mtbf")
def mtbf(df: pd.DataFrame) -> float:
return safe_ratio(df["operating_hours"].sum(), df["failures"].sum())
Reference SQL (tested on SQLite):
SELECT CAST(SUM(operating_hours) AS REAL) / SUM(failures) FROM asset_periods