Add approximate heap/memory tracker for ingested logs (ticket 011)
Tracks a running total of ingested log bytes (approximated as each log's raw UTF-8 text length), incremented on ingest and decremented in evict_excess_logs when a log is dropped. Exposed via StatsDto's new approx_bytes_total field on GET /api/stats, and displayed in NavMenu's stats panel formatted with toLocaleString() (comma separators). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XFUNZwCvz3kcod3352ZR2o
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
b1e509efbd
commit
0834c246d6
@@ -87,6 +87,7 @@ export function NavMenu({ stats }: { stats: Stats | null }) {
|
||||
<div>
|
||||
seq {stats.first_sequence ?? 0}–{stats.last_sequence ?? 0}
|
||||
</div>
|
||||
<div>{stats.approx_bytes_total.toLocaleString()} bytes</div>
|
||||
</>
|
||||
) : (
|
||||
<div>connecting…</div>
|
||||
|
||||
@@ -39,6 +39,8 @@ export interface Stats {
|
||||
last_sequence: number | null
|
||||
first_timestamp_ms: number | null
|
||||
last_timestamp_ms: number | null
|
||||
/** Ticket 011: running approximate byte size of all currently-ingested logs. */
|
||||
approx_bytes_total: number
|
||||
}
|
||||
|
||||
export type ParamRole = 'label' | 'value'
|
||||
|
||||
Reference in New Issue
Block a user