MentorAgent Docs
Menu

Questa pagina non è ancora tradotta in italiano: qui la trovi in inglese.

ReferencePackage: Novior.MentorAgent

MentorTokenUsage class

The MentorTokenUsage class of Novior.MentorAgent.Core: Lightweight, thread-safe accumulator of LLM token usage (Wave 1 · #1). Registered as a singleton so…

On this page

Lightweight, thread-safe accumulator of LLM token usage (Wave 1 · #1). Registered as a singleton so usage is aggregated across the whole app lifetime. This is a developer/operator measurement aid — it is the instrument used to verify the token-reduction work; it is never surfaced to end users. A future admin dashboard (roadmap #9) can read these counters; full OpenTelemetry (roadmap #8) supersedes it for production observability.

Namespace: Novior.MentorAgent.Core. Package: Novior.MentorAgent.

public sealed class MentorTokenUsage

Terminal
dotnet add package Novior.MentorAgent

public MentorTokenUsage()

public long LastInputTokens { get; }

Input tokens of the most recent recorded model call.

public long LastOutputTokens { get; }

Output tokens of the most recent recorded model call.

public long RequestCount { get; }

Number of model round-trips recorded.

public long TotalInputTokens { get; }

Cumulative input (prompt) tokens since process start.

public long TotalOutputTokens { get; }

Cumulative output (completion) tokens since process start.

public long TotalTokens { get; }

Cumulative total tokens since process start.

public void Record(long inputTokens, long outputTokens)

Records one model round-trip's token usage.

public void Reset()

Resets all counters (e.g. when starting a fresh measurement run).

public void Seed(long totalInput, long totalOutput, long requestCount)

Seeds the cumulative totals from a persisted snapshot (roadmap #9 durable dashboard), so counts continue across a restart. Overwrites the running totals; "last call" fields are left at zero.