@gooddata/sdk-ui-analytical-designer 11.69.0-alpha.3 → 11.69.0-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NOTICE +45 -45
- package/esm/backend.d.ts +15 -1
- package/esm/backend.d.ts.map +1 -1
- package/esm/backend.js +26 -2
- package/esm/components/Report.d.ts +3 -1
- package/esm/components/Report.d.ts.map +1 -1
- package/esm/components/Report.js +13 -4
- package/esm/components/report/executionProgress/ExecutionProgressPanel.d.ts +12 -0
- package/esm/components/report/executionProgress/ExecutionProgressPanel.d.ts.map +1 -0
- package/esm/components/report/executionProgress/ExecutionProgressPanel.js +157 -0
- package/esm/components/report/executionProgress/ExecutionProgressSteps.d.ts +17 -0
- package/esm/components/report/executionProgress/ExecutionProgressSteps.d.ts.map +1 -0
- package/esm/components/report/executionProgress/ExecutionProgressSteps.js +122 -0
- package/esm/components/report/executionProgress/ExecutionStats.d.ts +10 -0
- package/esm/components/report/executionProgress/ExecutionStats.d.ts.map +1 -0
- package/esm/components/report/executionProgress/ExecutionStats.js +105 -0
- package/esm/components/report/executionProgress/timeline.d.ts +34 -0
- package/esm/components/report/executionProgress/timeline.d.ts.map +1 -0
- package/esm/components/report/executionProgress/timeline.js +51 -0
- package/esm/reducers/combined_root_reducer.d.ts +3 -0
- package/esm/reducers/combined_root_reducer.d.ts.map +1 -1
- package/esm/reducers/combined_root_reducer.js +2 -0
- package/esm/sagas/sagas.d.ts.map +1 -1
- package/esm/sagas/sagas.js +4 -0
- package/esm/selectors/feature_flag_selector.d.ts +23 -2
- package/esm/selectors/feature_flag_selector.d.ts.map +1 -1
- package/esm/selectors/feature_flag_selector.js +2 -0
- package/esm/selectors/report_visualization_selector.d.ts +4 -0
- package/esm/selectors/report_visualization_selector.d.ts.map +1 -1
- package/esm/services/buckets_service.d.ts +1 -0
- package/esm/services/buckets_service.d.ts.map +1 -1
- package/esm/store/execution_progress/execution_loading_view_model.d.ts +72 -0
- package/esm/store/execution_progress/execution_loading_view_model.d.ts.map +1 -0
- package/esm/store/execution_progress/execution_loading_view_model.js +122 -0
- package/esm/store/execution_progress/execution_progress_actions.d.ts +42 -0
- package/esm/store/execution_progress/execution_progress_actions.d.ts.map +1 -0
- package/esm/store/execution_progress/execution_progress_actions.js +19 -0
- package/esm/store/execution_progress/execution_progress_mock.d.ts +31 -0
- package/esm/store/execution_progress/execution_progress_mock.d.ts.map +1 -0
- package/esm/store/execution_progress/execution_progress_mock.js +458 -0
- package/esm/store/execution_progress/execution_progress_saga.d.ts +56 -0
- package/esm/store/execution_progress/execution_progress_saga.d.ts.map +1 -0
- package/esm/store/execution_progress/execution_progress_saga.js +226 -0
- package/esm/store/execution_progress/execution_progress_selectors.d.ts +66 -0
- package/esm/store/execution_progress/execution_progress_selectors.d.ts.map +1 -0
- package/esm/store/execution_progress/execution_progress_selectors.js +7 -0
- package/esm/store/execution_progress/execution_progress_slice.d.ts +4 -0
- package/esm/store/execution_progress/execution_progress_slice.d.ts.map +1 -0
- package/esm/store/execution_progress/execution_progress_slice.js +95 -0
- package/esm/store/execution_progress/execution_progress_state.d.ts +54 -0
- package/esm/store/execution_progress/execution_progress_state.d.ts.map +1 -0
- package/esm/store/execution_progress/execution_progress_state.js +12 -0
- package/esm/store/execution_progress/execution_progress_view_model.d.ts +136 -0
- package/esm/store/execution_progress/execution_progress_view_model.d.ts.map +1 -0
- package/esm/store/execution_progress/execution_progress_view_model.js +378 -0
- package/esm/store/execution_progress/execution_stats_view_model.d.ts +42 -0
- package/esm/store/execution_progress/execution_stats_view_model.d.ts.map +1 -0
- package/esm/store/execution_progress/execution_stats_view_model.js +51 -0
- package/esm/store/types.d.ts +3 -0
- package/esm/store/types.d.ts.map +1 -1
- package/esm/translations/en-US.json +180 -0
- package/package.json +21 -21
- package/styles/css/execution_progress.css +486 -0
- package/styles/css/execution_progress.css.map +1 -0
- package/styles/css/main.css +485 -0
- package/styles/css/main.css.map +1 -1
- package/styles/scss/_ad_partials.scss +1 -0
- package/styles/scss/execution_progress.scss +547 -0
|
@@ -0,0 +1,458 @@
|
|
|
1
|
+
// (C) 2026 GoodData Corporation
|
|
2
|
+
import { IS_DEBUG } from "../../buildParams.js";
|
|
3
|
+
const SCENARIOS = [
|
|
4
|
+
"fresh",
|
|
5
|
+
"federation",
|
|
6
|
+
"cacheHit",
|
|
7
|
+
"cacheHitNoProfile",
|
|
8
|
+
"failure",
|
|
9
|
+
];
|
|
10
|
+
const ROOT = "root-xtab";
|
|
11
|
+
const MAIN = "main-afm";
|
|
12
|
+
function freshScenario() {
|
|
13
|
+
return [
|
|
14
|
+
{ at: 0, resultId: ROOT, parentResultId: null, type: "STARTED" },
|
|
15
|
+
{ at: 20, resultId: ROOT, parentResultId: null, type: "PREPROCESSING_STARTED" },
|
|
16
|
+
{
|
|
17
|
+
at: 80,
|
|
18
|
+
resultId: ROOT,
|
|
19
|
+
parentResultId: null,
|
|
20
|
+
type: "CHILDREN_REQUESTED",
|
|
21
|
+
children: [
|
|
22
|
+
{ resultId: MAIN, role: "main", dataSourceId: "demo-ds", dataSourceName: "Demo PostgreSQL" },
|
|
23
|
+
],
|
|
24
|
+
},
|
|
25
|
+
{ at: 90, resultId: MAIN, parentResultId: ROOT, role: "main", type: "STARTED" },
|
|
26
|
+
{
|
|
27
|
+
at: 120,
|
|
28
|
+
resultId: MAIN,
|
|
29
|
+
parentResultId: ROOT,
|
|
30
|
+
type: "SQL_GENERATION_STARTED",
|
|
31
|
+
dataSourceId: "demo-ds",
|
|
32
|
+
dataSourceName: "Demo PostgreSQL",
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
at: 450,
|
|
36
|
+
resultId: MAIN,
|
|
37
|
+
parentResultId: ROOT,
|
|
38
|
+
type: "SQL_GENERATION_FINISHED",
|
|
39
|
+
dataSourceId: "demo-ds",
|
|
40
|
+
dataSourceName: "Demo PostgreSQL",
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
at: 470,
|
|
44
|
+
resultId: MAIN,
|
|
45
|
+
parentResultId: ROOT,
|
|
46
|
+
type: "DATABASE_QUERY_REQUESTED",
|
|
47
|
+
dataSourceId: "demo-ds",
|
|
48
|
+
dataSourceName: "Demo PostgreSQL",
|
|
49
|
+
},
|
|
50
|
+
// the late timestamps arrive together with the child's FINISHED
|
|
51
|
+
{
|
|
52
|
+
at: 3500,
|
|
53
|
+
happenedAt: 600,
|
|
54
|
+
resultId: MAIN,
|
|
55
|
+
parentResultId: ROOT,
|
|
56
|
+
type: "DATABASE_QUERY_STARTED",
|
|
57
|
+
dataSourceId: "demo-ds",
|
|
58
|
+
dataSourceName: "Demo PostgreSQL",
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
at: 3505,
|
|
62
|
+
happenedAt: 3480,
|
|
63
|
+
resultId: MAIN,
|
|
64
|
+
parentResultId: ROOT,
|
|
65
|
+
type: "DATABASE_QUERY_RESULT_STREAMING_STARTED",
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
at: 3520,
|
|
69
|
+
resultId: MAIN,
|
|
70
|
+
parentResultId: ROOT,
|
|
71
|
+
type: "FINISHED",
|
|
72
|
+
status: "success",
|
|
73
|
+
cacheHit: false,
|
|
74
|
+
rows: 120,
|
|
75
|
+
columns: 4,
|
|
76
|
+
// relative times, shifted to absolute ones like the timestamps
|
|
77
|
+
timing: {
|
|
78
|
+
started: 90,
|
|
79
|
+
databaseQueryRequested: 470,
|
|
80
|
+
databaseQueryStarted: 600,
|
|
81
|
+
databaseQueryResultsStreamingStarted: 3480,
|
|
82
|
+
finished: 3520,
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
at: 3540,
|
|
87
|
+
resultId: ROOT,
|
|
88
|
+
parentResultId: null,
|
|
89
|
+
type: "POSTPROCESSING_STARTED",
|
|
90
|
+
postprocessingType: "XTAB",
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
at: 3900,
|
|
94
|
+
resultId: ROOT,
|
|
95
|
+
parentResultId: null,
|
|
96
|
+
type: "FINISHED",
|
|
97
|
+
status: "success",
|
|
98
|
+
cacheHit: false,
|
|
99
|
+
rows: 30,
|
|
100
|
+
columns: 4,
|
|
101
|
+
},
|
|
102
|
+
];
|
|
103
|
+
}
|
|
104
|
+
const FEDERATION_INPUTS = [
|
|
105
|
+
{
|
|
106
|
+
resultId: "input-postgres",
|
|
107
|
+
dataSourceId: "postgres-sales",
|
|
108
|
+
dataSourceName: "Sales (PostgreSQL)",
|
|
109
|
+
requested: 700,
|
|
110
|
+
dbStarted: 760,
|
|
111
|
+
finished: 1900,
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
resultId: "input-snowflake",
|
|
115
|
+
dataSourceId: "snowflake-dwh",
|
|
116
|
+
dataSourceName: "Data warehouse (Snowflake)",
|
|
117
|
+
requested: 720,
|
|
118
|
+
dbStarted: 1500,
|
|
119
|
+
finished: 5200,
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
resultId: "input-csv",
|
|
123
|
+
dataSourceId: "gdstorage-csv",
|
|
124
|
+
dataSourceName: "CSV uploads",
|
|
125
|
+
requested: 730,
|
|
126
|
+
dbStarted: 735,
|
|
127
|
+
finished: 1100,
|
|
128
|
+
},
|
|
129
|
+
];
|
|
130
|
+
function federationScenario() {
|
|
131
|
+
const inputs = FEDERATION_INPUTS;
|
|
132
|
+
return [
|
|
133
|
+
{ at: 0, resultId: ROOT, parentResultId: null, type: "STARTED" },
|
|
134
|
+
{ at: 20, resultId: ROOT, parentResultId: null, type: "PREPROCESSING_STARTED" },
|
|
135
|
+
{
|
|
136
|
+
at: 60,
|
|
137
|
+
resultId: ROOT,
|
|
138
|
+
parentResultId: null,
|
|
139
|
+
type: "CHILDREN_REQUESTED",
|
|
140
|
+
children: [{ resultId: MAIN, role: "main" }],
|
|
141
|
+
},
|
|
142
|
+
{ at: 70, resultId: MAIN, parentResultId: ROOT, role: "main", type: "STARTED" },
|
|
143
|
+
{
|
|
144
|
+
at: 100,
|
|
145
|
+
resultId: MAIN,
|
|
146
|
+
parentResultId: ROOT,
|
|
147
|
+
type: "SQL_GENERATION_STARTED",
|
|
148
|
+
dataSourceId: "postgres-sales",
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
at: 650,
|
|
152
|
+
resultId: MAIN,
|
|
153
|
+
parentResultId: ROOT,
|
|
154
|
+
type: "SQL_GENERATION_FINISHED",
|
|
155
|
+
dataSourceId: "postgres-sales",
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
at: 680,
|
|
159
|
+
resultId: MAIN,
|
|
160
|
+
parentResultId: ROOT,
|
|
161
|
+
type: "CHILDREN_REQUESTED",
|
|
162
|
+
children: inputs.map(({ resultId, dataSourceId, dataSourceName }) => ({
|
|
163
|
+
resultId,
|
|
164
|
+
dataSourceId,
|
|
165
|
+
dataSourceName,
|
|
166
|
+
role: "blendingInput",
|
|
167
|
+
})),
|
|
168
|
+
},
|
|
169
|
+
...inputs.flatMap(({ resultId, dataSourceId, requested, dbStarted, finished }) => [
|
|
170
|
+
{
|
|
171
|
+
at: requested,
|
|
172
|
+
resultId,
|
|
173
|
+
parentResultId: MAIN,
|
|
174
|
+
role: "blendingInput",
|
|
175
|
+
type: "DATABASE_QUERY_REQUESTED",
|
|
176
|
+
dataSourceId,
|
|
177
|
+
},
|
|
178
|
+
// the backend sends the query start late, together with the input's FINISHED
|
|
179
|
+
{
|
|
180
|
+
at: finished - 1,
|
|
181
|
+
happenedAt: dbStarted,
|
|
182
|
+
resultId,
|
|
183
|
+
parentResultId: MAIN,
|
|
184
|
+
type: "DATABASE_QUERY_STARTED",
|
|
185
|
+
dataSourceId,
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
at: finished,
|
|
189
|
+
resultId,
|
|
190
|
+
parentResultId: MAIN,
|
|
191
|
+
type: "FINISHED",
|
|
192
|
+
status: "success",
|
|
193
|
+
cacheHit: false,
|
|
194
|
+
},
|
|
195
|
+
]),
|
|
196
|
+
{
|
|
197
|
+
at: 5220,
|
|
198
|
+
resultId: MAIN,
|
|
199
|
+
parentResultId: ROOT,
|
|
200
|
+
type: "POSTPROCESSING_STARTED",
|
|
201
|
+
postprocessingType: "DATA_BLENDING",
|
|
202
|
+
},
|
|
203
|
+
{ at: 5600, resultId: MAIN, parentResultId: ROOT, type: "FINISHED", status: "success" },
|
|
204
|
+
{
|
|
205
|
+
at: 5620,
|
|
206
|
+
resultId: ROOT,
|
|
207
|
+
parentResultId: null,
|
|
208
|
+
type: "POSTPROCESSING_STARTED",
|
|
209
|
+
postprocessingType: "XTAB",
|
|
210
|
+
},
|
|
211
|
+
{ at: 5800, resultId: ROOT, parentResultId: null, type: "FINISHED", status: "success" },
|
|
212
|
+
];
|
|
213
|
+
}
|
|
214
|
+
const HOUR = 60 * 60 * 1000;
|
|
215
|
+
/** the cached result was computed 2 hours ago, querying two data sources */
|
|
216
|
+
function cachedProfile() {
|
|
217
|
+
const computedAt = -2 * HOUR;
|
|
218
|
+
return {
|
|
219
|
+
v: 1,
|
|
220
|
+
computedAt,
|
|
221
|
+
startedAt: computedAt - 3700,
|
|
222
|
+
finishedAt: computedAt,
|
|
223
|
+
totalDurationMs: 3700,
|
|
224
|
+
sources: [
|
|
225
|
+
{
|
|
226
|
+
resultId: "input-postgres",
|
|
227
|
+
dataSourceId: "postgres-sales",
|
|
228
|
+
dataSourceName: "Sales (PostgreSQL)",
|
|
229
|
+
queryRequestedAt: computedAt - 3400,
|
|
230
|
+
queryStartedAt: computedAt - 3300,
|
|
231
|
+
streamingStartedAt: computedAt - 200,
|
|
232
|
+
finishedAt: computedAt - 100,
|
|
233
|
+
dbDurationMs: 3100,
|
|
234
|
+
totalDurationMs: 3200,
|
|
235
|
+
queryFinishedAt: computedAt - 80,
|
|
236
|
+
queryDurationMs: 3320,
|
|
237
|
+
rows: 42,
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
resultId: "input-csv",
|
|
241
|
+
dataSourceId: "gdstorage-csv",
|
|
242
|
+
dataSourceName: "CSV uploads",
|
|
243
|
+
queryStartedAt: computedAt - 900,
|
|
244
|
+
finishedAt: computedAt - 500,
|
|
245
|
+
dbDurationMs: 350,
|
|
246
|
+
totalDurationMs: 400,
|
|
247
|
+
rows: 12,
|
|
248
|
+
},
|
|
249
|
+
],
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
function cacheHitScenario() {
|
|
253
|
+
return cacheHitNoProfileScenario().map((event) => event.type === "CACHE_HIT" ? { ...event, profile: cachedProfile() } : event);
|
|
254
|
+
}
|
|
255
|
+
function cacheHitNoProfileScenario() {
|
|
256
|
+
return [
|
|
257
|
+
{ at: 0, resultId: ROOT, parentResultId: null, type: "STARTED" },
|
|
258
|
+
{ at: 15, resultId: ROOT, parentResultId: null, type: "CACHE_HIT" },
|
|
259
|
+
{
|
|
260
|
+
at: 18,
|
|
261
|
+
resultId: ROOT,
|
|
262
|
+
parentResultId: null,
|
|
263
|
+
type: "FINISHED",
|
|
264
|
+
status: "success",
|
|
265
|
+
cacheHit: true,
|
|
266
|
+
rows: 30,
|
|
267
|
+
columns: 4,
|
|
268
|
+
},
|
|
269
|
+
];
|
|
270
|
+
}
|
|
271
|
+
function failureScenario() {
|
|
272
|
+
return [
|
|
273
|
+
...freshScenario().filter((event) => event.at <= 470),
|
|
274
|
+
{
|
|
275
|
+
at: 2100,
|
|
276
|
+
resultId: MAIN,
|
|
277
|
+
parentResultId: ROOT,
|
|
278
|
+
type: "FINISHED",
|
|
279
|
+
status: "failure",
|
|
280
|
+
errorType: "DATA_SOURCE_ERROR",
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
at: 2110,
|
|
284
|
+
resultId: ROOT,
|
|
285
|
+
parentResultId: null,
|
|
286
|
+
type: "FINISHED",
|
|
287
|
+
status: "failure",
|
|
288
|
+
errorType: "DATA_SOURCE_ERROR",
|
|
289
|
+
},
|
|
290
|
+
];
|
|
291
|
+
}
|
|
292
|
+
const SCENARIO_BUILDERS = {
|
|
293
|
+
fresh: freshScenario,
|
|
294
|
+
federation: federationScenario,
|
|
295
|
+
cacheHit: cacheHitScenario,
|
|
296
|
+
cacheHitNoProfile: cacheHitNoProfileScenario,
|
|
297
|
+
failure: failureScenario,
|
|
298
|
+
};
|
|
299
|
+
function buildMockSchedule(scenario, startTime, executionId) {
|
|
300
|
+
return SCENARIO_BUILDERS[scenario]()
|
|
301
|
+
.sort((a, b) => a.at - b.at)
|
|
302
|
+
.map(({ at, happenedAt, profile, timing, ...event }, index) => ({
|
|
303
|
+
sendAt: at,
|
|
304
|
+
event: {
|
|
305
|
+
...event,
|
|
306
|
+
...(timing
|
|
307
|
+
? {
|
|
308
|
+
timing: Object.fromEntries(Object.entries(timing).map(([key, value]) => [
|
|
309
|
+
key,
|
|
310
|
+
typeof value === "number" ? startTime + value : value,
|
|
311
|
+
])),
|
|
312
|
+
}
|
|
313
|
+
: {}),
|
|
314
|
+
...(profile ? { profile: shiftProfile(profile, startTime) } : {}),
|
|
315
|
+
seq: index + 1,
|
|
316
|
+
executionId,
|
|
317
|
+
timestamp: startTime + (happenedAt ?? at),
|
|
318
|
+
},
|
|
319
|
+
}));
|
|
320
|
+
}
|
|
321
|
+
const shift = (value, startTime) => typeof value === "number" ? startTime + value : value;
|
|
322
|
+
function shiftProfile(profile, startTime) {
|
|
323
|
+
return {
|
|
324
|
+
...profile,
|
|
325
|
+
computedAt: shift(profile.computedAt, startTime),
|
|
326
|
+
startedAt: shift(profile.startedAt, startTime),
|
|
327
|
+
finishedAt: shift(profile.finishedAt, startTime),
|
|
328
|
+
sources: profile.sources?.map((source) => ({
|
|
329
|
+
...source,
|
|
330
|
+
queryRequestedAt: shift(source.queryRequestedAt, startTime),
|
|
331
|
+
queryFinishedAt: shift(source.queryFinishedAt, startTime),
|
|
332
|
+
queryStartedAt: shift(source.queryStartedAt, startTime),
|
|
333
|
+
streamingStartedAt: shift(source.streamingStartedAt, startTime),
|
|
334
|
+
finishedAt: shift(source.finishedAt, startTime),
|
|
335
|
+
})),
|
|
336
|
+
};
|
|
337
|
+
}
|
|
338
|
+
/**
|
|
339
|
+
* The events of a scenario in the order the backend sends them, with absolute timestamps from
|
|
340
|
+
* `startTime`.
|
|
341
|
+
*/
|
|
342
|
+
export function buildMockExecutionProgressEvents(scenario, startTime, executionId = "mock-execution") {
|
|
343
|
+
return buildMockSchedule(scenario, startTime, executionId).map(({ event }) => event);
|
|
344
|
+
}
|
|
345
|
+
function readMockScenario() {
|
|
346
|
+
if (typeof window === "undefined") {
|
|
347
|
+
return undefined;
|
|
348
|
+
}
|
|
349
|
+
let value = null;
|
|
350
|
+
try {
|
|
351
|
+
value =
|
|
352
|
+
new URLSearchParams(window.location.search).get("executionProgressMock") ??
|
|
353
|
+
window.localStorage?.getItem("executionProgressMock") ??
|
|
354
|
+
null;
|
|
355
|
+
}
|
|
356
|
+
catch {
|
|
357
|
+
return undefined;
|
|
358
|
+
}
|
|
359
|
+
return SCENARIOS.find((scenario) => scenario === value);
|
|
360
|
+
}
|
|
361
|
+
/**
|
|
362
|
+
* The profile the backend stores with the result of a scenario (how it was computed), as served by
|
|
363
|
+
* the result metadata; null when none is stored. Times in absolute ms from `startTime`.
|
|
364
|
+
*/
|
|
365
|
+
export function buildMockComputationProfile(scenario, startTime) {
|
|
366
|
+
switch (scenario) {
|
|
367
|
+
case "cacheHit":
|
|
368
|
+
return shiftProfile(cachedProfile(), startTime);
|
|
369
|
+
case "fresh":
|
|
370
|
+
return shiftProfile({
|
|
371
|
+
v: 1,
|
|
372
|
+
computedAt: 3900,
|
|
373
|
+
startedAt: 0,
|
|
374
|
+
finishedAt: 3900,
|
|
375
|
+
totalDurationMs: 3900,
|
|
376
|
+
sources: [
|
|
377
|
+
{
|
|
378
|
+
resultId: MAIN,
|
|
379
|
+
dataSourceId: "demo-ds",
|
|
380
|
+
dataSourceName: "Demo PostgreSQL",
|
|
381
|
+
queryRequestedAt: 470,
|
|
382
|
+
queryStartedAt: 600,
|
|
383
|
+
streamingStartedAt: 3480,
|
|
384
|
+
finishedAt: 3520,
|
|
385
|
+
dbDurationMs: 2880,
|
|
386
|
+
totalDurationMs: 2920,
|
|
387
|
+
queryFinishedAt: 3520,
|
|
388
|
+
queryDurationMs: 3050,
|
|
389
|
+
rows: 120,
|
|
390
|
+
},
|
|
391
|
+
],
|
|
392
|
+
}, startTime);
|
|
393
|
+
case "federation":
|
|
394
|
+
return shiftProfile({
|
|
395
|
+
v: 1,
|
|
396
|
+
computedAt: 5800,
|
|
397
|
+
startedAt: 0,
|
|
398
|
+
finishedAt: 5800,
|
|
399
|
+
totalDurationMs: 5800,
|
|
400
|
+
sources: FEDERATION_INPUTS.map(({ resultId, dataSourceId, dataSourceName, requested, dbStarted, finished }) => ({
|
|
401
|
+
resultId,
|
|
402
|
+
dataSourceId,
|
|
403
|
+
dataSourceName,
|
|
404
|
+
queryRequestedAt: requested,
|
|
405
|
+
queryStartedAt: dbStarted,
|
|
406
|
+
finishedAt: finished,
|
|
407
|
+
dbDurationMs: finished - dbStarted - 20,
|
|
408
|
+
totalDurationMs: finished - dbStarted,
|
|
409
|
+
queryFinishedAt: finished,
|
|
410
|
+
queryDurationMs: finished - requested,
|
|
411
|
+
rows: 100,
|
|
412
|
+
})),
|
|
413
|
+
}, startTime);
|
|
414
|
+
default:
|
|
415
|
+
return null;
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
/**
|
|
419
|
+
* The mocked stream opener and result metadata when a mock scenario is enabled, otherwise
|
|
420
|
+
* undefined. The events are emitted at their scenario times, so the panel animates like with the
|
|
421
|
+
* real backend.
|
|
422
|
+
*/
|
|
423
|
+
export function getExecutionProgressMock() {
|
|
424
|
+
// development builds only, like the other debug tools (see backend.ts)
|
|
425
|
+
if (!IS_DEBUG) {
|
|
426
|
+
return undefined;
|
|
427
|
+
}
|
|
428
|
+
const scenario = readMockScenario();
|
|
429
|
+
if (!scenario) {
|
|
430
|
+
return undefined;
|
|
431
|
+
}
|
|
432
|
+
let startTime = Date.now();
|
|
433
|
+
return {
|
|
434
|
+
loadComputationProfile: () => new Promise((resolve) => setTimeout(() => resolve(buildMockComputationProfile(scenario, startTime)), 300)),
|
|
435
|
+
stream: (signal) => {
|
|
436
|
+
startTime = Date.now();
|
|
437
|
+
const schedule = buildMockSchedule(scenario, startTime, "mock-execution");
|
|
438
|
+
const timers = [];
|
|
439
|
+
return new ReadableStream({
|
|
440
|
+
start(controller) {
|
|
441
|
+
const stop = () => timers.forEach((timer) => clearTimeout(timer));
|
|
442
|
+
signal.addEventListener("abort", stop);
|
|
443
|
+
schedule.forEach(({ sendAt, event }, index) => {
|
|
444
|
+
timers.push(setTimeout(() => {
|
|
445
|
+
controller.enqueue(event);
|
|
446
|
+
if (index === schedule.length - 1) {
|
|
447
|
+
controller.close();
|
|
448
|
+
}
|
|
449
|
+
}, sendAt));
|
|
450
|
+
});
|
|
451
|
+
},
|
|
452
|
+
cancel() {
|
|
453
|
+
timers.forEach((timer) => clearTimeout(timer));
|
|
454
|
+
},
|
|
455
|
+
});
|
|
456
|
+
},
|
|
457
|
+
};
|
|
458
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { type EventChannel } from "redux-saga";
|
|
2
|
+
import { type IComputationProfile, type IExecutionProgressEvent } from "@gooddata/sdk-backend-tiger";
|
|
3
|
+
import { reportExecutionStarted } from "../../actions/report_actions.js";
|
|
4
|
+
import { executionStatsOpened } from "./execution_progress_actions.js";
|
|
5
|
+
import { type IExecutionProgressState } from "./execution_progress_state.js";
|
|
6
|
+
type StreamMessage = {
|
|
7
|
+
type: "event";
|
|
8
|
+
event: IExecutionProgressEvent;
|
|
9
|
+
} | {
|
|
10
|
+
type: "error";
|
|
11
|
+
error: unknown;
|
|
12
|
+
} | {
|
|
13
|
+
type: "done";
|
|
14
|
+
};
|
|
15
|
+
export declare function trackReportExecutionProgress(action: ReturnType<typeof reportExecutionStarted>): Generator<import("redux-saga/effects").CallEffect<EventChannel<StreamMessage>> | import("redux-saga/effects").CallEffect<import("@gooddata/sdk-backend-spi").IExecutionResult | undefined> | import("redux-saga/effects").ChannelTakeEffect<{
|
|
16
|
+
type: "event";
|
|
17
|
+
event: IExecutionProgressEvent;
|
|
18
|
+
} | {
|
|
19
|
+
type: "error";
|
|
20
|
+
error: unknown;
|
|
21
|
+
} | {
|
|
22
|
+
type: "done";
|
|
23
|
+
}> | import("redux-saga/effects").PutEffect<{
|
|
24
|
+
payload: {
|
|
25
|
+
reportExecutionId: string;
|
|
26
|
+
};
|
|
27
|
+
type: string;
|
|
28
|
+
}> | import("redux-saga/effects").SelectEffect, void, ((false & import("@gooddata/sdk-backend-spi").IExecutionResult) | (true & import("@gooddata/sdk-backend-spi").IExecutionResult)) & (EventChannel<StreamMessage> & StreamMessage)>;
|
|
29
|
+
/**
|
|
30
|
+
* Each report execution follows its own progress; a new execution cancels the previous stream.
|
|
31
|
+
*/
|
|
32
|
+
export declare function watchExecutionProgress(): Generator<import("redux-saga/effects").ForkEffect<never>, void, unknown>;
|
|
33
|
+
/**
|
|
34
|
+
* Loads the stored profile of the result the first time the execution stats are opened. A reopen
|
|
35
|
+
* while the profile loads restarts the load (takeLatest cancels the previous one, which leaves the
|
|
36
|
+
* status at `loading`), so only a loaded profile is skipped.
|
|
37
|
+
*/
|
|
38
|
+
export declare function loadExecutionStatsProfile(action: ReturnType<typeof executionStatsOpened>): Generator<import("redux-saga/effects").CallEffect<IComputationProfile | null> | import("redux-saga/effects").CancelledEffect | import("redux-saga/effects").PutEffect<{
|
|
39
|
+
payload: {
|
|
40
|
+
reportExecutionId: string;
|
|
41
|
+
};
|
|
42
|
+
type: string;
|
|
43
|
+
}> | import("redux-saga/effects").SelectEffect, void, IExecutionProgressState & ((IComputationProfile & false) | (IComputationProfile & true))>;
|
|
44
|
+
export declare function watchExecutionStats(): Generator<import("redux-saga/effects").ForkEffect<never>, void, unknown>;
|
|
45
|
+
/**
|
|
46
|
+
* The stats of the last report execution are stale once the report does not execute any more: the
|
|
47
|
+
* buckets were emptied (Clear, undo to an empty state), a new or non-executable insight is open.
|
|
48
|
+
*/
|
|
49
|
+
export declare function shouldClearExecutionProgress(isExecutable: boolean, state: IExecutionProgressState): boolean;
|
|
50
|
+
export declare function clearStaleExecutionProgress(): Generator<import("redux-saga/effects").PutEffect<{
|
|
51
|
+
payload: undefined;
|
|
52
|
+
type: "EXECUTION_PROGRESS_CLEARED";
|
|
53
|
+
}> | import("redux-saga/effects").SelectEffect, void, boolean & IExecutionProgressState>;
|
|
54
|
+
export declare function watchExecutionProgressReset(): Generator<import("redux-saga/effects").CallEffect<void> | import("redux-saga/effects").TakeEffect, void, unknown>;
|
|
55
|
+
export {};
|
|
56
|
+
//# sourceMappingURL=execution_progress_saga.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execution_progress_saga.d.ts","sourceRoot":"","sources":["../../../src/store/execution_progress/execution_progress_saga.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,YAAY,EAAgB,MAAM,YAAY,CAAC;AAY7D,OAAO,EACH,KAAK,mBAAmB,EACxB,KAAK,uBAAuB,EAE/B,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAKzE,OAAO,EAMH,oBAAoB,EAIvB,MAAM,iCAAiC,CAAC;AAGzC,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AAsC7E,KAAK,aAAa,GACZ;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,uBAAuB,CAAA;CAAE,GACjD;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,GACjC;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AA2DvB,wBAAiB,4BAA4B,CAAC,MAAM,EAAE,UAAU,CAAC,OAAO,sBAAsB,CAAC;UA7DjF,OAAO;WAAS,uBAAuB;;UACvC,OAAO;WAAS,OAAO;;UACvB,MAAM;;;;;;wOAmInB;AAED;;GAEG;AACH,wBAAiB,sBAAsB,6EAEtC;AAED;;;;GAIG;AACH,wBAAiB,yBAAyB,CAAC,MAAM,EAAE,UAAU,CAAC,OAAO,oBAAoB,CAAC;;;;;gJAwBzF;AAED,wBAAiB,mBAAmB,6EAEnC;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAAC,YAAY,EAAE,OAAO,EAAE,KAAK,EAAE,uBAAuB,GAAG,OAAO,CAE3G;AAED,wBAAiB,2BAA2B;;;yFAe3C;AAED,wBAAiB,2BAA2B,sHAO3C"}
|