Skip to content

agent-plugin-usage / Exports / FileUsageStorage

Class: FileUsageStorage

File storage implementation for usage statistics

Implements

Table of contents

Constructors

Methods

Constructors

constructor

new FileUsageStorage(filePath): FileUsageStorage

Parameters

NameType
filePathstring

Returns

FileUsageStorage

Defined in

agent-plugin-usage/src/storages/file-storage.ts:12

Methods

save

save(entry): Promise<void>

Parameters

NameType
entryIUsageStats

Returns

Promise<void>

Implementation of

IUsageStorage.save

Defined in

agent-plugin-usage/src/storages/file-storage.ts:17


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/file-storage.ts:40


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/file-storage.ts:61


clear

clear(): Promise<void>

Returns

Promise<void>

Implementation of

IUsageStorage.clear

Defined in

agent-plugin-usage/src/storages/file-storage.ts:73


flush

flush(): Promise<void>

Returns

Promise<void>

Implementation of

IUsageStorage.flush

Defined in

agent-plugin-usage/src/storages/file-storage.ts:88


close

close(): Promise<void>

Returns

Promise<void>

Implementation of

IUsageStorage.close

Defined in

agent-plugin-usage/src/storages/file-storage.ts:102

Released under the MIT License.