From 6f445eca8a3de0e347ff66d1d67259ed197569c8 Mon Sep 17 00:00:00 2001 From: Andres Martinez Gotor Date: Fri, 21 Jul 2023 09:18:41 +0200 Subject: [PATCH] Chore: Remove liveTimer reference from testdata (#71997) --- .../plugins/datasource/testdata/runStreams.ts | 21 +++++++------------ 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/public/app/plugins/datasource/testdata/runStreams.ts b/public/app/plugins/datasource/testdata/runStreams.ts index dac0ab22c99..bb034e61036 100644 --- a/public/app/plugins/datasource/testdata/runStreams.ts +++ b/public/app/plugins/datasource/testdata/runStreams.ts @@ -13,8 +13,6 @@ import { DataFrameData, } from '@grafana/data'; // eslint-disable-next-line no-restricted-imports -- In the process from being removed -import { liveTimer } from 'app/features/dashboard/dashgrid/liveTimer'; -// eslint-disable-next-line no-restricted-imports -- In the process from being removed import { StreamingDataFrame } from 'app/features/live/data/StreamingDataFrame'; import { getRandomLine } from './LogIpsum'; @@ -104,18 +102,13 @@ export function runSignalStream( } const pushNextEvent = () => { - addNextRow(Date.now()); - - const elapsed = liveTimer.lastUpdate - lastSent; - if (elapsed > 1000 || liveTimer.ok) { - subscriber.next({ - data: [frame], - key: streamId, - state: LoadingState.Streaming, - }); - lastSent = liveTimer.lastUpdate; - } - + lastSent = Date.now(); + addNextRow(lastSent); + subscriber.next({ + data: [frame], + key: streamId, + state: LoadingState.Streaming, + }); timeoutId = setTimeout(pushNextEvent, speed); };