system.kanoa.cmms.getMaintenanceMTBFByAsset(startDate, endDate, assetId)
Computes Mean Time Between Failures (MTBF) for each asset over a specified date range, returning one row per asset.
MTBF is a reliability metric representing the average operating time between failures for an asset; a higher value indicates a more reliable asset over the period examined.
This function is typically used to populate an asset-reliability leaderboard or table on a maintenance/reliability dashboard, letting users compare failure frequency across assets and identify chronic problem equipment.
The optional assetId parameter can be used to scope the calculation to a single asset rather than returning MTBF for every asset in the given period.
Parameters
startDate DateTime: Start date
endDate DateTime: End date
assetId Integer: Pass None to include all assets
Returns
mtbfByAsset pyDataset
Example
# Compute MTBF by asset for the previous calendar month
startDate = system.date.addDays(system.date.now(), -90)
endDate = system.date.now()
assetId = None # Pass None to include all assets
data = system.kanoa.utilities.convertDatasetToJSON(system.kanoa.cmms.getMaintenanceMTBFByAsset(startDate, endDate, assetId))
for i, row in enumerate(data):
print 'Row %i'%i
for k,v in row.items():
print k,v
break #Just limiting to returning the columns from the first record for display purposes
>>>
Row 0
MTBF_Days 14.0
MTBF_Minutes 20242.0
lastFailureDate 2026-05-11 18:51:30.73
firstFailureDate 2026-05-11 18:51:30.73
assetId 901
assetPath Kanoa Box Co\Box Plant\Packaging\Box Line 1
intervalCount 1
assetName Box Line 1
failureCount 1
>>>