AWR Report Analysis Tool
Paste AWR Report Text
No report analyzed yet. Paste your report content in the first tab and click "Analyze".
Could not find key AWR sections. Please ensure you have pasted a valid, full AWR text report.
';
showTab(1);
return;
}
renderOutput(dbTime, elapsed, logicalReads, transactions, topWaits, topSqlElapsed);
showTab(1);
}
function renderOutput(dbTime, elapsed, logicalReads, transactions, topWaits, topSqlElapsed) {
outputContainer.innerHTML = `
Report Summary
Elapsed Time (mins)
${elapsed}
Logical Reads
${logicalReads}
Transactions
${transactions}
Top Timed Foreground Events
`;
renderChartAndTable('awr-waits-chart', 'awr-waits-table', topWaits, 'Event', 'Time(s)', Object.keys(topWaits[0] || {}));
renderChartAndTable('awr-sql-chart', 'awr-sql-table', topSqlElapsed.slice(0,5), 'SQL Id', 'Elapsed Time (s)', Object.keys(topSqlElapsed[0] || {}));
}
function renderChartAndTable(canvasId, tableId, data, labelKey, dataKey, headers) {
const table = document.getElementById(tableId);
table.innerHTML = `
${headers.map(h => `| ${h} | `).join('')}
${data.map(row => `${headers.map(h => `| ${row[h] || ''} | `).join('')}
`).join('')}`;
const ctx = document.getElementById(canvasId).getContext('2d');
new Chart(ctx, {
type: 'bar',
data: {
labels: data.map(d => d[labelKey]),
datasets: [{
label: dataKey,
data: data.map(d => parseFloat(d[dataKey].replace(/,/g, '')) || 0),
backgroundColor: '#0369a1'
}]
},
options: { indexAxis: 'y', responsive: true, maintainAspectRatio: false, plugins: { legend: { display: false } } }
});
}
analyzeBtn.addEventListener('click', analyzeReport);
showTab(0);
});