add more documentation
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2026-01-22 20:30:02 +11:00
parent 68ee2838e4
commit c8f04efd51
7 changed files with 500 additions and 325 deletions

View File

@@ -48,6 +48,34 @@ templ Index(info BuildInfo) {
<p class="mt-3 text-xl font-semibold">{info.GoVersion}</p>
</div>
</section>
<section class="grid gap-6 lg:grid-cols-3">
<div class="web2-card">
<h2 class="text-lg font-semibold">Overview</h2>
<p class="mt-2 text-sm text-slate-600">
vCTP is a vSphere Chargeback Tracking Platform.
</p>
</div>
<div class="web2-card">
<h2 class="text-lg font-semibold">Snapshots and Reports</h2>
<ul class="mt-3 space-y-2 text-sm text-slate-600 list-disc pl-5">
<li>Hourly snapshots capture inventory per vCenter (concurrency via `hourly_snapshot_concurrency`).</li>
<li>Daily summaries aggregate the hourly snapshots for the day; monthly summaries aggregate daily summaries for the month (or hourly snapshots if configured).</li>
<li>Snapshots are registered in `snapshot_registry` so regeneration via `/api/snapshots/aggregate` can locate the correct tables (fallback scanning is also supported).</li>
<li>Reports (XLSX with totals/charts) are generated automatically after hourly, daily, and monthly jobs and written to a reports directory.</li>
</ul>
</div>
<div class="web2-card">
<h2 class="text-lg font-semibold">Prorating and Aggregation</h2>
<ul class="mt-3 space-y-2 text-sm text-slate-600 list-disc pl-5">
<li>SamplesPresent is the count of snapshots in which the VM appears; TotalSamples is the count of unique snapshot times for the vCenter.</li>
<li>AvgIsPresent = SamplesPresent / TotalSamples (0 when TotalSamples is 0).</li>
<li>Daily AvgVcpuCount/AvgRamGB/AvgProvisionedDisk = AvgIsPresent * last observed value for the day.</li>
<li>Daily pool percentages use pool hits divided by SamplesPresent, so they reflect only the time the VM existed.</li>
<li>Monthly aggregation weights daily averages by daily total samples, then divides by monthly total samples.</li>
</ul>
</div>
</section>
</main>
</body>
@core.Footer()