mirror of
https://github.com/hcengineering/platform.git
synced 2025-05-15 12:01:33 +00:00
QFIX: Fix huge statistics send (#8482)
Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
parent
14bdc38d75
commit
96d39ad728
@ -172,7 +172,7 @@ export function serveStats (ctx: MeasureContext, onClose?: () => void): void {
|
|||||||
const service = payload.extra?.service === 'true'
|
const service = payload.extra?.service === 'true'
|
||||||
const serviceName = (req.query.name as string) ?? ''
|
const serviceName = (req.query.name as string) ?? ''
|
||||||
if (service) {
|
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, {
|
statistics.set(serviceName, {
|
||||||
...(req.request.body as ServiceStatistics),
|
...(req.request.body as ServiceStatistics),
|
||||||
lastUpdate: Date.now()
|
lastUpdate: Date.now()
|
||||||
|
@ -705,11 +705,7 @@ export async function backup (
|
|||||||
blobsSize: 0,
|
blobsSize: 0,
|
||||||
backupSize: 0
|
backupSize: 0
|
||||||
}
|
}
|
||||||
ctx = ctx.newChild('backup', {
|
ctx = ctx.newChild('backup', {})
|
||||||
workspaceId: workspaceId.name,
|
|
||||||
force: options.force,
|
|
||||||
timeout: options.timeout
|
|
||||||
})
|
|
||||||
|
|
||||||
let _canceled = false
|
let _canceled = false
|
||||||
const canceled = (): boolean => {
|
const canceled = (): boolean => {
|
||||||
|
@ -265,7 +265,7 @@ class BackupWorker {
|
|||||||
rootCtx.warn('\n\nBACKUP WORKSPACE ', {
|
rootCtx.warn('\n\nBACKUP WORKSPACE ', {
|
||||||
workspace: ws.workspace
|
workspace: ws.workspace
|
||||||
})
|
})
|
||||||
const ctx = rootCtx.newChild(ws.workspace, { workspace: ws.workspace })
|
const ctx = rootCtx.newChild('doBackup', {})
|
||||||
let pipeline: Pipeline | undefined
|
let pipeline: Pipeline | undefined
|
||||||
try {
|
try {
|
||||||
const storage = await createStorageBackupStorage(
|
const storage = await createStorageBackupStorage(
|
||||||
@ -446,7 +446,7 @@ export async function doRestoreWorkspace (
|
|||||||
rootCtx.warn('\nRESTORE WORKSPACE ', {
|
rootCtx.warn('\nRESTORE WORKSPACE ', {
|
||||||
workspace: ws.workspace
|
workspace: ws.workspace
|
||||||
})
|
})
|
||||||
const ctx = rootCtx.newChild(ws.workspace, { workspace: ws.workspace })
|
const ctx = rootCtx.newChild('doRestoreWorkspace', {})
|
||||||
let pipeline: Pipeline | undefined
|
let pipeline: Pipeline | undefined
|
||||||
try {
|
try {
|
||||||
const storage = await createStorageBackupStorage(ctx, backupAdapter, getWorkspaceId(bucketName), ws.workspace)
|
const storage = await createStorageBackupStorage(ctx, backupAdapter, getWorkspaceId(bucketName), ws.workspace)
|
||||||
|
@ -177,8 +177,7 @@ export class WorkspaceWorker {
|
|||||||
void this.exec(async () => {
|
void this.exec(async () => {
|
||||||
await this.doWorkspaceOperation(
|
await this.doWorkspaceOperation(
|
||||||
ctx.newChild('workspaceOperation', {
|
ctx.newChild('workspaceOperation', {
|
||||||
workspace: workspace.workspace,
|
mode: workspace.mode
|
||||||
workspaceName: workspace.workspaceName
|
|
||||||
}),
|
}),
|
||||||
workspace,
|
workspace,
|
||||||
opt
|
opt
|
||||||
|
@ -39,7 +39,7 @@ export async function createWorkspace (
|
|||||||
) => Promise<void>,
|
) => Promise<void>,
|
||||||
external: boolean = false
|
external: boolean = false
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
const childLogger = ctx.newChild('createWorkspace', {}, { workspace: workspaceInfo.workspace })
|
const childLogger = ctx.newChild('createWorkspace', {}, {})
|
||||||
const ctxModellogger: ModelLogger = {
|
const ctxModellogger: ModelLogger = {
|
||||||
log: (msg, data) => {
|
log: (msg, data) => {
|
||||||
childLogger.info(msg, data)
|
childLogger.info(msg, data)
|
||||||
|
@ -135,7 +135,7 @@ export class AIControl {
|
|||||||
token,
|
token,
|
||||||
workspace,
|
workspace,
|
||||||
this,
|
this,
|
||||||
this.ctx.newChild(workspace, {}),
|
this.ctx.newChild('client', {}),
|
||||||
info
|
info
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@ -146,7 +146,7 @@ export class AIControl {
|
|||||||
token,
|
token,
|
||||||
workspace,
|
workspace,
|
||||||
this,
|
this,
|
||||||
this.ctx.newChild(workspace, {}),
|
this.ctx.newChild('client', {}),
|
||||||
info
|
info
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user