QFIX: Fix huge statistics send (#8482)

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev 2025-04-07 13:55:04 +07:00 committed by GitHub
parent 14bdc38d75
commit 96d39ad728
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 8 additions and 13 deletions

View File

@ -172,7 +172,7 @@ export function serveStats (ctx: MeasureContext, onClose?: () => void): void {
const service = payload.extra?.service === 'true'
const serviceName = (req.query.name as string) ?? ''
if (service) {
ctx.info('put stats', { service: req.query.name })
ctx.info('put stats', { service: req.query.name, len: req.request.length })
statistics.set(serviceName, {
...(req.request.body as ServiceStatistics),
lastUpdate: Date.now()

View File

@ -705,11 +705,7 @@ export async function backup (
blobsSize: 0,
backupSize: 0
}
ctx = ctx.newChild('backup', {
workspaceId: workspaceId.name,
force: options.force,
timeout: options.timeout
})
ctx = ctx.newChild('backup', {})
let _canceled = false
const canceled = (): boolean => {

View File

@ -265,7 +265,7 @@ class BackupWorker {
rootCtx.warn('\n\nBACKUP WORKSPACE ', {
workspace: ws.workspace
})
const ctx = rootCtx.newChild(ws.workspace, { workspace: ws.workspace })
const ctx = rootCtx.newChild('doBackup', {})
let pipeline: Pipeline | undefined
try {
const storage = await createStorageBackupStorage(
@ -446,7 +446,7 @@ export async function doRestoreWorkspace (
rootCtx.warn('\nRESTORE WORKSPACE ', {
workspace: ws.workspace
})
const ctx = rootCtx.newChild(ws.workspace, { workspace: ws.workspace })
const ctx = rootCtx.newChild('doRestoreWorkspace', {})
let pipeline: Pipeline | undefined
try {
const storage = await createStorageBackupStorage(ctx, backupAdapter, getWorkspaceId(bucketName), ws.workspace)

View File

@ -177,8 +177,7 @@ export class WorkspaceWorker {
void this.exec(async () => {
await this.doWorkspaceOperation(
ctx.newChild('workspaceOperation', {
workspace: workspace.workspace,
workspaceName: workspace.workspaceName
mode: workspace.mode
}),
workspace,
opt

View File

@ -39,7 +39,7 @@ export async function createWorkspace (
) => Promise<void>,
external: boolean = false
): Promise<void> {
const childLogger = ctx.newChild('createWorkspace', {}, { workspace: workspaceInfo.workspace })
const childLogger = ctx.newChild('createWorkspace', {}, {})
const ctxModellogger: ModelLogger = {
log: (msg, data) => {
childLogger.info(msg, data)

View File

@ -135,7 +135,7 @@ export class AIControl {
token,
workspace,
this,
this.ctx.newChild(workspace, {}),
this.ctx.newChild('client', {}),
info
)
}
@ -146,7 +146,7 @@ export class AIControl {
token,
workspace,
this,
this.ctx.newChild(workspace, {}),
this.ctx.newChild('client', {}),
info
)
}