Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions apps/worker/src/services/stats-calculator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ export async function backfillHistoryIfNeeded() {
export async function calculateMinutelyHistory() {
const previousMinuteStart = getPreviousMinuteStart();

logger.info(
logger.debug(
`Starting minutely history calculation for ${previousMinuteStart.toISOString()}...`,
);

Expand All @@ -559,7 +559,7 @@ export async function calculateMinutelyHistory() {
const modelResult =
await calculateModelHistoryForMinute(previousMinuteStart);

logger.info(
logger.debug(
`Recorded history for ${mappingResult.totalMappings} model-provider mappings (${mappingResult.activeMappings} active, ${mappingResult.inactiveMappings} inactive) and ${modelResult.totalModels} models (${modelResult.activeModels} active, ${modelResult.inactiveModels} inactive)`,
);
} catch (error) {
Expand Down Expand Up @@ -594,7 +594,7 @@ export async function calculateCurrentMinuteHistory() {
* Calculate 5-minute aggregated statistics from historical data
*/
export async function calculateAggregatedStatistics() {
logger.info("Starting 5-minute aggregated statistics calculation...");
logger.debug("Starting 5-minute aggregated statistics calculation...");

try {
const database = db;
Expand Down Expand Up @@ -652,7 +652,7 @@ export async function calculateAggregatedStatistics() {
.where(eq(provider.id, aggregate.providerId));
}

logger.info(
logger.debug(
`Updated statistics for ${providerAggregates.length} providers`,
);

Expand Down Expand Up @@ -708,7 +708,7 @@ export async function calculateAggregatedStatistics() {
.where(eq(model.id, aggregate.modelId));
}

logger.info(`Updated statistics for ${modelAggregates.length} models`);
logger.debug(`Updated statistics for ${modelAggregates.length} models`);

// Update model-provider mapping statistics (aggregated from history)
const mappingAggregates = await database
Expand Down Expand Up @@ -782,10 +782,10 @@ export async function calculateAggregatedStatistics() {
}
}

logger.info(
logger.debug(
`Updated statistics for ${mappingAggregates.length} model-provider mappings`,
);
logger.info(
logger.debug(
"5-minute aggregated statistics calculation completed successfully",
);
} catch (error) {
Expand Down
6 changes: 3 additions & 3 deletions apps/worker/src/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,7 @@ export async function batchProcessLogs(): Promise<void> {
})
.where(eq(organization.id, orgId));

logger.info(
logger.debug(
`Deducted ${costNumber} credits from organization ${orgId}`,
);

Expand Down Expand Up @@ -706,7 +706,7 @@ export async function batchProcessLogs(): Promise<void> {
})
.where(eq(apiKey.id, apiKeyId));

logger.info(`Added ${costNumber} usage to API key ${apiKeyId}`);
logger.debug(`Added ${costNumber} usage to API key ${apiKeyId}`);
}
}

Expand All @@ -718,7 +718,7 @@ export async function batchProcessLogs(): Promise<void> {
})
.where(inArray(log.id, logIds));

logger.info(`Marked ${logIds.length} logs as processed`);
logger.debug(`Marked ${logIds.length} logs as processed`);
});
} catch (error) {
logger.error(
Expand Down