Skip to content

Commit 02ead2a

Browse files
committed
Separate query data and query delta data in TypeScript
1 parent a9246e6 commit 02ead2a

File tree

1 file changed

+19
-6
lines changed
  • site/frontend/src/pages/detailed-query

1 file changed

+19
-6
lines changed

site/frontend/src/pages/detailed-query/utils.ts

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,17 @@ export interface ProfileElement {
1414
label: string;
1515
self_time: number;
1616
percent_total_time: number;
17-
number_of_cache_misses?: number;
18-
number_of_cache_hits?: number;
17+
number_of_cache_misses: number;
18+
number_of_cache_hits: number;
1919
invocation_count: number;
20-
blocked_time?: number;
20+
blocked_time: number;
21+
incremental_load_time: number;
22+
}
23+
24+
export interface ProfileElementDelta {
25+
self_time: number;
26+
invocation_count: number;
27+
number_of_cache_hits: number;
2128
incremental_load_time: number;
2229
}
2330

@@ -34,7 +41,13 @@ export interface ProfileData {
3441

3542
export interface SelfProfileResponse {
3643
profile: ProfileData;
37-
base_profile_delta?: ProfileData;
44+
base_profile_delta?: ProfileDataDelta;
45+
}
46+
47+
export interface ProfileDataDelta {
48+
totals: ProfileElementDelta;
49+
query_data: ProfileElementDelta[];
50+
artifact_sizes: ArtifactSize[];
3851
}
3952

4053
export function toSeconds(time: number): number {
@@ -221,7 +234,7 @@ export interface DeltaData {
221234
isIntegral: boolean;
222235
}
223236

224-
interface TableRowData {
237+
export interface TableRowData {
225238
isTotal: boolean;
226239
label: string;
227240
timePercent: {value: number; formatted: string; title: string};
@@ -258,7 +271,7 @@ export function createTableData(
258271
function createRowData(
259272
isTotal: boolean,
260273
value: ProfileElement,
261-
delta?: ProfileElement
274+
delta: ProfileElementDelta | undefined
262275
): TableRowData {
263276
return {
264277
isTotal,

0 commit comments

Comments
 (0)