Skip to content

Commit

Permalink
disable repeatable candles events
Browse files Browse the repository at this point in the history
  • Loading branch information
divhead committed Jan 13, 2025
1 parent ecc5bce commit eea8a8e
Showing 1 changed file with 22 additions and 18 deletions.
40 changes: 22 additions & 18 deletions src/domain/tradingview/DataFeed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -338,15 +338,17 @@ export class DataFeed extends EventTarget implements IBasicDataFeed {

metricsRequestId = metricsRequestId ?? getRequestId();

metrics.pushEvent<LoadingStartEvent>({
event: "candlesLoad.started",
isError: false,
time: metrics.getTime("candlesLoad", true),
data: {
requestId: metricsRequestId,
isFirstTimeLoad: isPrefetch,
},
});
if (isPrefetch) {
metrics.pushEvent<LoadingStartEvent>({
event: "candlesLoad.started",
isError: false,
time: metrics.getTime("candlesLoad", true),
data: {
requestId: metricsRequestId,
isFirstTimeLoad: isPrefetch,
},
});
}

metrics.startTimer("candlesLoad");

Expand Down Expand Up @@ -400,15 +402,17 @@ export class DataFeed extends EventTarget implements IBasicDataFeed {
}

if (success) {
metrics.pushEvent<LoadingSuccessEvent>({
event: "candlesLoad.success",
isError: false,
time: metrics.getTime("candlesLoad", true),
data: {
requestId: metricsRequestId!,
isFirstTimeLoad: isPrefetch,
},
});
if (isPrefetch) {
metrics.pushEvent<LoadingSuccessEvent>({
event: "candlesLoad.success",
isError: false,
time: metrics.getTime("candlesLoad", true),
data: {
requestId: metricsRequestId!,
isFirstTimeLoad: isPrefetch,
},
});
}
}

return result;
Expand Down

0 comments on commit eea8a8e

Please sign in to comment.