Skip to main content

default

chainalign-backend


chainalign-backend / services/meteringService / default

Class: default

Defined in: services/meteringService.js:4

Constructors

Constructor

new default(): MeteringService

Returns

MeteringService

Methods

recordUsage()

static recordUsage(tenantId, userId, eventType, traceId, internalCostData): Promise<void>

Defined in: services/meteringService.js:15

Records a usage event for a tenant and updates their billing cycle consumption. This is the core function of the IPU metering system.

Parameters

tenantId

string

The UUID of the tenant.

userId

string

The UUID of the user who triggered the event.

eventType

string

The type of the event (e.g., 'COMPLEX_SIMULATION').

traceId

string

A UUID to link this event to a specific decision/workflow run.

internalCostData

any = {}

A JSON object containing internal cost metrics (e.g., LLM tokens).

Returns

Promise<void>