RunCostRecalculationService
AgentPrism.Core.dllMaintenance service that recalculates the cost of all runs against the current pricing source (catalog/configuration).
public sealed class RunCostRecalculationServiceInheritance
Section titled “Inheritance”object ← RunCostRecalculationService
Inherited Members
Section titled “Inherited Members”object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Remarks
Section titled “Remarks”Used only by the POST /api/stats/recalculate-costs endpoint. Every
call is a full recalculation — there is no “only unknown
ones” filter, because the endpoint’s purpose is to apply the current
pricing to history as-is. Since the provider is not stored on historical
rows, resolution is done by model name alone.
Constructors
Section titled “Constructors”RunCostRecalculationService(IRunStore, IRunPricingResolver)
Section titled “ RunCostRecalculationService(IRunStore, IRunPricingResolver)”Creates a new recalculation service.
public RunCostRecalculationService(IRunStore store, IRunPricingResolver resolver)Parameters
Section titled “Parameters”store IRunStore
The run store.
resolver IRunPricingResolver
The cost resolver.
Exceptions
Section titled “Exceptions”One of the dependencies is null.
Methods
Section titled “Methods”RecalculateAsync(string, CancellationToken)
Section titled “ RecalculateAsync(string, CancellationToken)”Recalculates the cost of all runs for a tenant.
public ValueTask<RunCostRecalculationResult> RecalculateAsync(string tenantId, CancellationToken cancellationToken = default)Parameters
Section titled “Parameters”tenantId string
The tenant identity.
cancellationToken CancellationToken
The cancellation token.
Returns
Section titled “Returns”ValueTask<RunCostRecalculationResult>
The counts of runs considered, updated, and still unknown.