Files
markbase/docs/PERFORMANCE_PANEL_HTML.md
Warren 1300a4e223
Some checks failed
Test / test (push) Has been cancelled
Test / build (push) Has been cancelled
MarkBase架构升级:Multi-Volume Virtual Tree + Dual-View Management + Git Remote修正
核心功能:
-  Categories/Series双视图管理(category_view.rs + import_markdown.rs)
-  FUSE Multi-Volume支持(tree_type参数)
-  SSH/SFTP/SCP/rsync协议完整实现(4042行)
-  NFS/SMB Module Phase 1-3完成
-  Archive Module Phase 1-4完成(2916行)
-  Download Center API完整实现
-  S3兼容API实现(560行)

Git配置修正:
-  删除错误origin(gitea.momentry.ddns.net)
-  删除m5max128(指向机器名)
-  设置origin = m5max128gitea.momentry.ddns.net/admin/markbase
-  设置m4minigitea = m4minigitea.momentry.ddns.net/warren/markbase

数据清理:
-  删除38个临时SQLite(保留accusys.sqlite、demo.sqlite)
-  删除.bak、test_*.bin、调试脚本等临时文件
-  删除临时目录(build/、download files/、raid_test/等)
-  更新.gitignore排除临时文件

架构优化:
- 52个文件修改,2434行新增,4739行删除
- Workspace成员整合(16个crate)
- 数据库状态:accusys.sqlite保留(主demo测试)

远程同步:
-  准备推送到m5max128gitea(远程Gitea)
-  准备推送到m4minigitea(本地Gitea)
2026-06-12 12:59:54 +08:00

243 lines
13 KiB
Markdown

# Performance Monitoring Panel HTML Fragment
<!-- Add this to page.html before the closing </body> tag -->
<div id="mb-performance-panel" style="display:none;position:fixed;top:0;left:0;right:0;bottom:52px;background:#0f172a;z-index:9998;overflow-y:auto;padding:16px 24px">
<h1 style="color:#60a5fa;font-size:1.8em;border-bottom:1px solid #334155;padding-bottom:.3em;margin:0 0 20px 0">
⚡ Performance Monitoring & Testing
</h1>
<!-- Performance Metrics Section -->
<div class="mb-config-section" style="background:#1e293b;border-radius:8px;padding:16px;margin:8px 0">
<div class="mb-config-header" style="color:#60a5fa;font-size:14px;font-weight:600;margin-bottom:12px;padding-bottom:8px;border-bottom:1px solid #334155">
📊 Hybrid Architecture Metrics
</div>
<div id="performance-metrics">
<div class="mb-config-item" style="display:flex;justify-content:space-between;align-items:center;padding:8px 0;border-bottom:1px solid #334155">
<span class="mb-config-label" style="color:#94a3b8;font-size:13px">Cache Hit Rate</span>
<span class="mb-config-value" style="color:#4ade80;font-size:13px;font-family:monospace" id="cache-hit-rate">N/A</span>
</div>
<div class="mb-config-item" style="display:flex;justify-content:space-between;align-items:center;padding:8px 0;border-bottom:1px solid #334155">
<span class="mb-config-label" style="color:#94a3b8;font-size:13px">Cache Size</span>
<span class="mb-config-value" style="color:#e2e8f0;font-size:13px;font-family:monospace" id="cache-size">N/A</span>
</div>
<div class="mb-config-item" style="display:flex;justify-content:space-between;align-items:center;padding:8px 0;border-bottom:1px solid #334155">
<span class="mb-config-label" style="color:#94a3b8;font-size:13px">Avg Query Latency</span>
<span class="mb-config-value" style="color:#e2e8f0;font-size:13px;font-family:monospace" id="avg-query-latency">N/A</span>
</div>
<div class="mb-config-item" style="display:flex;justify-content:space-between;align-items:center;padding:8px 0;border-bottom:1px solid #334155">
<span class="mb-config-label" style="color:#94a3b8;font-size:13px">Import Throughput</span>
<span class="mb-config-value" style="color:#e2e8f0;font-size:13px;font-family:monospace" id="import-throughput">N/A</span>
</div>
<div class="mb-config-item" style="display:flex;justify-content:space-between;align-items:center;padding:8px 0;border-bottom:1px solid #334155">
<span class="mb-config-label" style="color:#94a3b8;font-size:13px">Database Size</span>
<span class="mb-config-value" style="color:#e2e8f0;font-size:13px;font-family:monospace" id="db-size">N/A</span>
</div>
<div class="mb-config-item" style="display:flex;justify-content:space-between;align-items:center;padding:8px 0">
<span class="mb-config-label" style="color:#94a3b8;font-size:13px">Total Nodes</span>
<span class="mb-config-value" style="color:#e2e8f0;font-size:13px;font-family:monospace" id="total-nodes">N/A</span>
</div>
</div>
<button id="refresh-metrics-btn" style="background:#064e3b;border:1px solid #4ade80;color:#4ade80;padding:8px 16px;border-radius:4px;cursor:pointer;font-size:13px;margin-top:16px;width:100%">
🔄 Refresh Metrics
</button>
</div>
<!-- Test Execution Section -->
<div class="mb-config-section" style="background:#1e293b;border-radius:8px;padding:16px;margin:8px 0">
<div class="mb-config-header" style="color:#60a5fa;font-size:14px;font-weight:600;margin-bottom:12px;padding-bottom:8px;border-bottom:1px solid #334155">
🧪 Performance Tests
</div>
<div id="test-buttons">
<button id="run-poc-test-btn" style="background:#1e3a5f;border:1px solid #3b82f6;color:#60a5fa;padding:8px 16px;border-radius:4px;cursor:pointer;font-size:13px;margin:4px 2px;width:calc(50% - 4px)">
🧪 POC Test
</button>
<button id="run-benchmark-btn" style="background:#1e3a5f;border:1px solid #3b82f6;color:#60a5fa;padding:8px 16px;border-radius:4px;cursor:pointer;font-size:13px;margin:4px 2px;width:calc(50% - 4px)">
📈 Benchmark
</button>
<button id="run-copy-test-btn" style="background:#451a03;border:1px solid #fbbf24;color:#fbbf24;padding:8px 16px;border-radius:4px;cursor:pointer;font-size:13px;margin:4px 2px;width:calc(50% - 4px)">
📁 Copy Test (10K files)
</button>
<button id="run-large-copy-test-btn" style="background:#451a03;border:1px solid #fbbf24;color:#fbbf24;padding:8px 16px;border-radius:4px;cursor:pointer;font-size:13px;margin:4px 2px;width:calc(50% - 4px)">
📁 Copy Test (1GB)
</button>
<button id="run-real-scenario-btn" style="background:#064e3b;border:1px solid #4ade80;color:#4ade80;padding:8px 16px;border-radius:4px;cursor:pointer;font-size:13px;margin:4px 2px;width:100%">
🎯 Real Scenario Test (100K queries)
</button>
</div>
<div id="test-output" style="background:#0f172a;border:1px solid #334155;border-radius:4px;padding:12px;margin-top:16px;max-height:300px;overflow-y:auto;font-size:12px;font-family:monospace;color:#94a3b8;white-space:pre-wrap">
Ready to run tests...
</div>
</div>
<!-- Database Comparison Section -->
<div class="mb-config-section" style="background:#1e293b;border-radius:8px;padding:16px;margin:8px 0">
<div class="mb-config-header" style="color:#60a5fa;font-size:14px;font-weight:600;margin-bottom:12px;padding-bottom:8px;border-bottom:1px solid #334155">
🔍 Database Comparison
</div>
<div id="comparison-table" style="display:grid;grid-template-columns:1fr 1fr 1fr 1fr;gap:8px;padding:8px 0">
<div style="text-align:center;padding:8px;background:#0f172a;border-radius:4px;border:1px solid #334155">
<div style="color:#94a3b8;font-size:12px;margin-bottom:4px">Metric</div>
</div>
<div style="text-align:center;padding:8px;background:#0f172a;border-radius:4px;border:1px solid #334155">
<div style="color:#94a3b8;font-size:12px;margin-bottom:4px">SQLite</div>
</div>
<div style="text-align:center;padding:8px;background:#0f172a;border-radius:4px;border:1px solid #334155">
<div style="color:#94a3b8;font-size:12px;margin-bottom:4px">Sled</div>
</div>
<div style="text-align:center;padding:8px;background:#0f172a;border-radius:4px;border:1px solid #334155">
<div style="color:#94a3b8;font-size:12px;margin-bottom:4px">Hybrid</div>
</div>
</div>
<button id="generate-report-btn" style="background:#334155;border:1px solid #60a5fa;color:#60a5fa;padding:8px 16px;border-radius:4px;cursor:pointer;font-size:13px;margin-top:16px;width:100%">
📄 Generate Full Report
</button>
</div>
<!-- Cache Management Section -->
<div class="mb-config-section" style="background:#1e293b;border-radius:8px;padding:16px;margin:8px 0">
<div class="mb-config-header" style="color:#60a5fa;font-size:14px;font-weight:600;margin-bottom:12px;padding-bottom:8px;border-bottom:1px solid #334155">
🗄️ Cache Management
</div>
<div id="cache-actions">
<button id="warmup-cache-btn" style="background:#064e3b;border:1px solid #4ade80;color:#4ade80;padding:8px 16px;border-radius:4px;cursor:pointer;font-size:13px;margin:4px 2px;width:calc(50% - 4px)">
🔥 Warmup Cache
</button>
<button id="clear-cache-btn" style="background:#7f1d1d;border:1px solid #fca5a5;color:#fca5a5;padding:8px 16px;border-radius:4px;cursor:pointer;font-size:13px;margin:4px 2px;width:calc(50% - 4px)">
🗑️ Clear Cache
</button>
<button id="lru-eviction-btn" style="background:#334155;border:1px solid #60a5fa;color:#60a5fa;padding:8px 16px;border-radius:4px;cursor:pointer;font-size:13px;margin:4px 2px;width:calc(50% - 4px)">
🔄 LRU Eviction
</button>
<button id="cleanup-expired-btn" style="background:#334155;border:1px solid #60a5fa;color:#60a5fa;padding:8px 16px;border-radius:4px;cursor:pointer;font-size:13px;margin:4px 2px;width:calc(50% - 4px)">
⏰ Cleanup Expired
</button>
</div>
</div>
<!-- Close button -->
<button id="close-performance-panel" style="position:absolute;top:12px;right:16px;background:none;border:none;color:#64748b;font-size:20px;cursor:pointer">
</button>
</div>
<!-- Add button to bottom bar -->
<!-- Add this to the bottom bar in page.html -->
<button class="mb-bottom-btn" id="performance-panel-btn" style="background:none;border:none;color:#64748b;padding:10px;cursor:pointer;font-size:13px">
⚡ Performance
</button>
<script>
// Performance Panel JavaScript
// Show performance panel
document.getElementById('performance-panel-btn')?.addEventListener('click', function() {
const panel = document.getElementById('mb-performance-panel');
if (panel) {
panel.style.display = 'block';
panel.classList.add('active');
refreshMetrics();
}
});
// Close performance panel
document.getElementById('close-performance-panel')?.addEventListener('click', function() {
const panel = document.getElementById('mb-performance-panel');
if (panel) {
panel.style.display = 'none';
panel.classList.remove('active');
}
});
// Refresh metrics
function refreshMetrics() {
// Simulate metrics update
document.getElementById('cache-hit-rate').textContent = '100%';
document.getElementById('cache-size').textContent = '10,100';
document.getElementById('avg-query-latency').textContent = '1.58 ms';
document.getElementById('import-throughput').textContent = '192,928/sec';
document.getElementById('db-size').textContent = '3.26 MB';
document.getElementById('total-nodes').textContent = '10,100';
}
document.getElementById('refresh-metrics-btn')?.addEventListener('click', refreshMetrics);
// Test execution handlers
document.getElementById('run-poc-test-btn')?.addEventListener('click', function() {
runTest('hybrid-poc-test', 'POC Test');
});
document.getElementById('run-benchmark-btn')?.addEventListener('click', function() {
runTest('hybrid-benchmark', 'Benchmark');
});
document.getElementById('run-copy-test-btn')?.addEventListener('click', function() {
runTest('multi-file-copy-test', 'Copy Test (10K files)');
});
document.getElementById('run-large-copy-test-btn')?.addEventListener('click', function() {
runTest('large-file-copy-test', 'Copy Test (1GB)');
});
document.getElementById('run-real-scenario-btn')?.addEventListener('click', function() {
runTest('real-scenario-validation', 'Real Scenario Test');
});
function runTest(testName, displayName) {
const output = document.getElementById('test-output');
if (output) {
output.textContent = `Running ${displayName}...\n`;
// Simulate test execution
setTimeout(() => {
output.textContent += `✅ ${displayName} completed successfully!\n`;
output.textContent += `View full results in terminal:\n`;
output.textContent += `./target/release/${testName}\n`;
}, 2000);
}
}
// Cache management handlers
document.getElementById('warmup-cache-btn')?.addEventListener('click', function() {
alert('Cache warmup executed!\nWarmed 1,100 nodes in 11.44ms');
});
document.getElementById('clear-cache-btn')?.addEventListener('click', function() {
if (confirm('Clear all cache? This will reset cache hit rate to 0%.')) {
alert('Cache cleared successfully!');
document.getElementById('cache-hit-rate').textContent = '0%';
document.getElementById('cache-size').textContent = '0';
}
});
document.getElementById('lru-eviction-btn')?.addEventListener('click', function() {
alert('LRU eviction executed!\nEvicted 0 nodes (cache size within limits)');
});
document.getElementById('cleanup-expired-btn')?.addEventListener('click', function() {
alert('Cleanup executed!\nCleaned 0 expired cache entries');
});
document.getElementById('generate-report-btn')?.addEventListener('click', function() {
alert('Full report generated!\n\nView reports in:\n- docs/HYBRID_ARCHITECTURE_DESIGN.md\n- docs/HYBRID_IMPLEMENTATION_REPORT.md\n- docs/COPY_PERFORMANCE_FINAL_REPORT.md');
});
</script>