Skip to content

agent-plugin-usage / Exports / RemoteUsageStorage

Class: RemoteUsageStorage

Remote storage implementation for usage statistics with batching

Implements

Table of contents

Constructors

Methods

Constructors

constructor

new RemoteUsageStorage(apiUrl, _apiKey, _timeout, _headers?, batchSize?, flushInterval?): RemoteUsageStorage

Parameters

NameTypeDefault value
apiUrlstringundefined
_apiKeystringundefined
_timeoutnumberundefined
_headersRecord<string, string>{}
batchSizenumber50
flushIntervalnumber60000

Returns

RemoteUsageStorage

Defined in

agent-plugin-usage/src/storages/remote-storage.ts:25

Methods

save

save(entry): Promise<void>

Parameters

NameType
entryIUsageStats

Returns

Promise<void>

Implementation of

IUsageStorage.save

Defined in

agent-plugin-usage/src/storages/remote-storage.ts:47


getStats

getStats(conversationId?, timeRange?): Promise<IUsageStats[]>

Parameters

NameType
conversationId?string
timeRange?Object
timeRange.startDate
timeRange.endDate

Returns

Promise<IUsageStats[]>

Implementation of

IUsageStorage.getStats

Defined in

agent-plugin-usage/src/storages/remote-storage.ts:55


getAggregatedStats

getAggregatedStats(timeRange?): Promise<IAggregatedUsageStats>

Parameters

NameType
timeRange?Object
timeRange.startDate
timeRange.endDate

Returns

Promise<IAggregatedUsageStats>

Implementation of

IUsageStorage.getAggregatedStats

Defined in

agent-plugin-usage/src/storages/remote-storage.ts:77


clear

clear(): Promise<void>

Returns

Promise<void>

Implementation of

IUsageStorage.clear

Defined in

agent-plugin-usage/src/storages/remote-storage.ts:89


flush

flush(): Promise<void>

Returns

Promise<void>

Implementation of

IUsageStorage.flush

Defined in

agent-plugin-usage/src/storages/remote-storage.ts:104


close

close(): Promise<void>

Returns

Promise<void>

Implementation of

IUsageStorage.close

Defined in

agent-plugin-usage/src/storages/remote-storage.ts:137

Released under the MIT License.