Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion static/app/components/events/viewHierarchy/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {watchForResize} from 'sentry/utils/profiling/gl/utils';
import {Rect} from 'sentry/utils/profiling/speedscope';

export function useResizeCanvasObserver(canvases: Array<HTMLCanvasElement | null>): Rect {
const [bounds, setCanvasBounds] = useState(Rect.Empty());
const [bounds, setCanvasBounds] = useState(Rect.empty());

useLayoutEffect(() => {
if (!canvases.length) {
Expand Down
2 changes: 1 addition & 1 deletion static/app/components/profiling/boundTooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ interface BoundTooltipProps {
children?: React.ReactNode;
}

const DEFAULT_BOUNDS = Rect.Empty();
const DEFAULT_BOUNDS = Rect.empty();

function BoundTooltip({
canvas,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ function getProfileOffset(
startedAtMs: number | null
): Rect {
if (!profile || !startedAtMs) {
return Rect.Empty();
return Rect.empty();
}

return new Rect(profile.startedAt - startedAtMs, 0, 0, 0);
Expand All @@ -137,7 +137,7 @@ function getTransactionOffset(
startedAtMs: number | null
): Rect {
if (!transactionSpan || !startedAtMs) {
return Rect.Empty();
return Rect.empty();
}

return new Rect(
Expand Down
2 changes: 1 addition & 1 deletion static/app/utils/profiling/canvasView.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const makeCanvasAndView = (
canvas: HTMLCanvasElement,
flamegraph: Flamegraph,
origin: vec2 = vec2.fromValues(0, 0),
configSpaceTransform: Rect = Rect.Empty()
configSpaceTransform: Rect = Rect.empty()
) => {
const flamegraphCanvas = new FlamegraphCanvas(canvas, origin);
const canvasView = new CanvasView<Flamegraph>({
Expand Down
4 changes: 2 additions & 2 deletions static/app/utils/profiling/canvasView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import {
import {Rect} from 'sentry/utils/profiling/speedscope';

export class CanvasView<T extends {configSpace: Rect}> {
configView: Rect = Rect.Empty();
configSpace: Readonly<Rect> = Rect.Empty();
configView: Rect = Rect.empty();
configSpace: Readonly<Rect> = Rect.empty();
configSpaceTransform: mat3 = mat3.create();

inverted: boolean;
Expand Down
2 changes: 1 addition & 1 deletion static/app/utils/profiling/flamegraph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export class Flamegraph {
sort: 'left heavy' | 'alphabetical' | 'call order' = 'call order';

depth = 0;
configSpace: Rect = Rect.Empty();
configSpace: Rect = Rect.empty();
root: FlamegraphFrame = {
key: -1,
parent: null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const DEFAULT_FLAMEGRAPH_STATE: FlamegraphState = {
threadId: null,
},
position: {
view: Rect.Empty(),
view: Rect.empty(),
},
preferences: {
timelines: {
Expand Down
4 changes: 2 additions & 2 deletions static/app/utils/profiling/flamegraphCanvas.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ export class FlamegraphCanvas {
canvas: HTMLCanvasElement;
origin: vec2;

physicalSpace: Rect = Rect.Empty();
logicalSpace: Rect = Rect.Empty();
physicalSpace: Rect = Rect.empty();
logicalSpace: Rect = Rect.empty();

physicalToLogicalSpace: mat3 = mat3.create();
logicalToPhysicalSpace: mat3 = mat3.create();
Expand Down
2 changes: 1 addition & 1 deletion static/app/utils/profiling/flamegraphChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export class FlamegraphChart {
};

static MIN_RENDERABLE_POINTS = 2;
static Empty = new FlamegraphChart(Rect.Empty(), [], [[0, 0, 0, 0]]);
static Empty = new FlamegraphChart(Rect.empty(), [], [[0, 0, 0, 0]]);

constructor(
configSpace: Rect,
Expand Down
4 changes: 2 additions & 2 deletions static/app/utils/profiling/gl/utils.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,8 @@ describe('createShader', () => {

describe('Rect', () => {
it('initializes an empty rect as 0 width and height rect at 0,0 origin', () => {
expect(Rect.Empty()).toEqual(new Rect(0, 0, 0, 0));
expect(Rect.Empty().isEmpty()).toBe(true);
expect(Rect.empty()).toEqual(new Rect(0, 0, 0, 0));
expect(Rect.empty().isEmpty()).toBe(true);
});

it('clones rect', () => {
Expand Down
2 changes: 1 addition & 1 deletion static/app/utils/profiling/gl/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ export function safeGetContext(

export function measureText(string: string, ctx?: CanvasRenderingContext2D): Rect {
if (!string) {
return Rect.Empty();
return Rect.empty();
}

const context = ctx || getContext(document.createElement('canvas'), '2d');
Expand Down
2 changes: 1 addition & 1 deletion static/app/utils/profiling/speedscope.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export class Rect {
return this.width === 0 && this.height === 0;
}

static Empty(): Rect {
static empty(): Rect {
return new Rect(0, 0, 0, 0);
}

Expand Down
4 changes: 2 additions & 2 deletions static/app/utils/profiling/uiFrames.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class UIFrames {
frames: readonly UIFrameNode[] = [];
toUnit = 'nanoseconds';
minFrameDuration: number = Number.MAX_SAFE_INTEGER;
configSpace: Rect = Rect.Empty();
configSpace: Rect = Rect.empty();

formatter = makeFormatter('nanoseconds');
timelineFormatter = makeTimelineFormatter('nanoseconds');
Expand All @@ -54,7 +54,7 @@ class UIFrames {
slowOrDefaultFrames,
frozenOrDefaultFrames
);
this.configSpace = configSpace ?? Rect.Empty();
this.configSpace = configSpace ?? Rect.empty();

this.timelineFormatter = makeTimelineFormatter(this.toUnit);
this.formatter = makeFormatter(this.toUnit);
Expand Down
Loading