Advanced Reliability & Incident Metrics Calculator
body { font-family: -apple-system, system-ui, sans-serif; line-height: 1.4; max-width: 1000px; margin: 20px auto; padding: 20px; background-color: #f0f2f5; }
.container { display: flex; gap: 20px; flex-wrap: wrap; }
.card { background: white; padding: 20px; border-radius: 12px; box-shadow: 0 4px 6px rgba(0,0,0,0.05); flex: 1; min-width: 350px; }
h1, h2 { color: #1a73e8; margin-top: 0; }
.input-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 20px; }
label { font-size: 0.85rem; font-weight: 600; color: #5f6368; }
input { width: 100%; padding: 8px; border: 1px solid #dadce0; border-radius: 4px; box-sizing: border-box; }
.results-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.metric { background: #f8f9fa; padding: 12px; border-radius: 8px; border-top: 3px solid #1a73e8; }
.metric-title { font-size: 0.75rem; color: #70757a; font-weight: bold; }
.metric-value { font-size: 1.1rem; font-weight: 700; color: #202124; margin-top: 4px; }
.section-header { grid-column: 1 / -1; font-weight: bold; margin-top: 10px; color: #3c4043; border-bottom: 1px solid #eee; }
Reliability Metrics Calculator
function calc() {
const val = id => parseFloat(document.getElementById(id).value) || 0;
const set = (id, num) => document.getElementById(id).innerText = isFinite(num) && num > 0 ? num.toFixed(2) + “h” : “-“;
const uptime = val(‘uptime’), fails = val(‘failures’), repair = val(‘repairTime’);
const down = val(‘downtime’), detect = val(‘detectTime’), ident = val(‘identTime’);
const ack = val(‘ackTime’), verify = val(‘verifyTime’);
if (fails > 0) {
set(‘m-mtbf’, uptime / fails);
set(‘m-mttf’, (uptime + down) / fails);
set(‘m-mtbsi’, (uptime / fails) + (down / fails));
set(‘m-mttr’, repair / fails);
set(‘m-mtrs’, down / fails);
set(‘m-mtta’, ack / fails);
set(‘m-mttd’, detect / fails);
set(‘m-mtti’, ident / fails);
set(‘m-mttv’, verify / fails);
}
}