MetricsApi
A class for interfacing with the Vecto Metric API.
Methods:
usage
Retrieves the monthly usage metrics for a specified vector space.
async usage(requestParameters: UsageRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<MonthlyUsageResponse>
Args:
requestParameters (UsageRequest): Object containing identifiers for the usage data retrieval.
vectorSpaceId
(string): Identifier of the vector space.month
(number): Numeric representation of the month.year
(number): Numeric representation of the year.
initOverrides (RequestInit | runtime.InitOverrideFunction): Optional overrides for the request initialization settings.
Returns:
- MonthlyUsageResponse: Contains the usage metrics for the specified vector space and month, structured as follows:
year
(number): The year for which usage metrics are provided.month
(number): The month for which usage metrics are provided.usage
(VectoUsageMetrics): Object containing detailed usage metrics.lookups
(UsageMetric): Metrics specific to lookup operations.dailyMetrics
(Array(DailyUsageMetric)): Array of daily usage metrics.date
(Date): The date for the metric.count
(number): The operation count for the specific date.cumulativeCount
(number): The cumulative count of operations until the specific date.
indexing
(UsageMetric): Metrics specific to indexing operations.dailyMetrics
(Same structure aslookups
).
Example:
import { Configuration, MetricsApi, UsageRequest } from 'vecto-sdk';
const config = new Configuration({
accessToken: 'your-access-token'
});
const api = new MetricsApi(config);
const usageRequest: UsageRequest = {
vectorSpaceId: 'your-vector-space-id',
month: 1,
year: 2023
};
const usageMetrics = await api.usage(usageRequest);