feat: refactor metrics (#2861)

This commit is contained in:
Alex Inkin
2025-04-01 00:22:54 +04:00
committed by GitHub
parent 1883c9666e
commit f51dcf23d6
12 changed files with 395 additions and 248 deletions

View File

@@ -123,6 +123,10 @@ export class MockApiService extends ApiService {
return from(this.initProgress()).pipe(
startWith(PROGRESS),
) as WebSocketSubject<T>
} else if (guid === 'metrics-guid') {
return interval(1000).pipe(
map(() => Mock.getMetrics()),
) as WebSocketSubject<T>
} else {
throw new Error('invalid guid type')
}
@@ -358,7 +362,7 @@ export class MockApiService extends ApiService {
): Promise<RR.FollowServerMetricsRes> {
await pauseFor(2000)
return {
guid: 'iqudh37um-i38u3-34-a51b-jkhd783ein',
guid: 'metrics-guid',
metrics: Mock.getMetrics(),
}
}