agents / 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
| Name | Type | Default value |
|---|---|---|
apiUrl | string | undefined |
_apiKey | string | undefined |
_timeout | number | undefined |
_headers | Record<string, string> | {} |
batchSize | number | 50 |
flushInterval | number | 60000 |
Returns
Defined in
packages/agents/src/plugins/usage/storages/remote-storage.ts:17
Methods
save
▸ save(entry): Promise<void>
Parameters
| Name | Type |
|---|---|
entry | UsageStats |
Returns
Promise<void>
Implementation of
Defined in
packages/agents/src/plugins/usage/storages/remote-storage.ts:33
getStats
▸ getStats(conversationId?, timeRange?): Promise<UsageStats[]>
Parameters
| Name | Type |
|---|---|
conversationId? | string |
timeRange? | Object |
timeRange.start | Date |
timeRange.end | Date |
Returns
Promise<UsageStats[]>
Implementation of
Defined in
packages/agents/src/plugins/usage/storages/remote-storage.ts:41
getAggregatedStats
▸ getAggregatedStats(timeRange?): Promise<AggregatedUsageStats>
Parameters
| Name | Type |
|---|---|
timeRange? | Object |
timeRange.start | Date |
timeRange.end | Date |
Returns
Promise<AggregatedUsageStats>
Implementation of
UsageStorage.getAggregatedStats
Defined in
packages/agents/src/plugins/usage/storages/remote-storage.ts:60
clear
▸ clear(): Promise<void>
Returns
Promise<void>
Implementation of
Defined in
packages/agents/src/plugins/usage/storages/remote-storage.ts:93
flush
▸ flush(): Promise<void>
Returns
Promise<void>
Implementation of
Defined in
packages/agents/src/plugins/usage/storages/remote-storage.ts:108
close
▸ close(): Promise<void>
Returns
Promise<void>
Implementation of
Defined in
packages/agents/src/plugins/usage/storages/remote-storage.ts:141