Skip to content

Commit

Permalink
Merge "[ui] Fix Chrome scroll track" into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Timin authored and Gerrit Code Review committed Jan 27, 2025
2 parents be3c100 + 4294d52 commit 20ffe1e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export interface JankIntervalPlotDetails {

export async function getInputScrollDeltas(
engine: Engine,
scrollId: number,
scrollId: bigint,
): Promise<ScrollDeltaDetails[]> {
const queryResult = await engine.query(`
INCLUDE PERFETTO MODULE chrome.scroll_jank.scroll_offsets;
Expand Down Expand Up @@ -85,7 +85,7 @@ export async function getInputScrollDeltas(

export async function getPresentedScrollDeltas(
engine: Engine,
scrollId: number,
scrollId: bigint,
): Promise<ScrollDeltaDetails[]> {
const queryResult = await engine.query(`
INCLUDE PERFETTO MODULE chrome.scroll_jank.scroll_offsets;
Expand Down Expand Up @@ -126,7 +126,7 @@ export async function getPresentedScrollDeltas(

export async function getPredictorJankDeltas(
engine: Engine,
scrollId: number,
scrollId: bigint,
): Promise<ScrollDeltaDetails[]> {
const queryResult = await engine.query(`
INCLUDE PERFETTO MODULE chrome.scroll_jank.predictor_error;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ import {Trace} from '../../public/trace';

interface Data {
// Scroll ID.
id: number;
id: bigint;
// Timestamp of the beginning of this slice in nanoseconds.
ts: time;
// DurationWidget of this slice in nanoseconds.
Expand Down Expand Up @@ -86,7 +86,7 @@ export class ScrollDetailsPanel implements TrackEventDetailsPanel {

constructor(
private readonly trace: Trace,
private readonly id: number,
private readonly id: bigint,
) {}

async load() {
Expand All @@ -109,7 +109,7 @@ export class ScrollDetailsPanel implements TrackEventDetailsPanel {
FROM scrolls`);

const iter = queryResult.firstRow({
id: NUM,
id: LONG,
ts: LONG,
dur: LONG,
});
Expand Down Expand Up @@ -385,7 +385,7 @@ export class ScrollDetailsPanel implements TrackEventDetailsPanel {
}

const details = dictToTreeNodes({
'Scroll ID': this.data.id,
'Scroll ID': `${this.data.id}`,
'Start time': m(Timestamp, {ts: this.data.ts}),
'Duration': m(DurationWidget, {dur: this.data.dur}),
'SQL ID': m(SqlRef, {table: 'chrome_scrolls', id: this.id}),
Expand Down
8 changes: 6 additions & 2 deletions ui/src/plugins/org.chromium.ChromeScrollJank/scroll_track.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,21 @@ export function createTopLevelScrollTrack(trace: Trace, uri: string) {
dataset: new SourceDataset({
schema: {
id: NUM,
rawId: LONG,
ts: LONG,
dur: LONG,
name: STR,
},
src: `
SELECT
ROW_NUMBER() OVER (ORDER BY ts) as id,
id as rawId,
printf("Scroll %s", CAST(id AS STRING)) AS name,
*
ts,
dur
FROM chrome_scrolls
`,
}),
detailsPanel: (row) => new ScrollDetailsPanel(trace, row.id),
detailsPanel: (row) => new ScrollDetailsPanel(trace, row.rawId),
});
}

0 comments on commit 20ffe1e

Please sign in to comment.