forked from firefox-devtools/profiler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconstants.js
137 lines (107 loc) · 5.24 KB
/
constants.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// @flow
import type { MarkerPhase } from 'firefox-profiler/types';
// The current version of the Gecko profile format.
// Please don't forget to update the gecko profile format changelog in
// `docs-developer/CHANGELOG-formats.md`.
export const GECKO_PROFILE_VERSION = 30;
// The current version of the "processed" profile format.
// Please don't forget to update the processed profile format changelog in
// `docs-developer/CHANGELOG-formats.md`.
export const PROCESSED_PROFILE_VERSION = 49;
// The following are the margin sizes for the left and right of the timeline. Independent
// components need to share these values.
export const TIMELINE_MARGIN_RIGHT = 15;
export const TIMELINE_MARGIN_LEFT = 150;
export const ACTIVE_TAB_TIMELINE_MARGIN_LEFT = 0;
// Export the value for tests, and for computing the max height of the timeline
// for the splitter.
export const FULL_TRACK_SCREENSHOT_HEIGHT = 50;
export const ACTIVE_TAB_TRACK_SCREENSHOT_HEIGHT = 30;
// The following values are for network track.
export const TRACK_NETWORK_ROW_HEIGHT = 5;
export const TRACK_NETWORK_ROW_REPEAT = 7;
export const TRACK_NETWORK_HEIGHT =
TRACK_NETWORK_ROW_HEIGHT * TRACK_NETWORK_ROW_REPEAT;
// The following values are for memory track.
export const TRACK_MEMORY_GRAPH_HEIGHT = 25;
export const TRACK_MEMORY_MARKERS_HEIGHT = 15;
export const TRACK_MEMORY_HEIGHT =
TRACK_MEMORY_GRAPH_HEIGHT + TRACK_MEMORY_MARKERS_HEIGHT;
export const TRACK_MEMORY_LINE_WIDTH = 2;
export const TRACK_MEMORY_COLOR = 'orange';
// The following values are for the bandwidth track.
export const TRACK_BANDWIDTH_HEIGHT = 25;
export const TRACK_BANDWIDTH_LINE_WIDTH = 2;
export const TRACK_BANDWIDTH_COLOR = 'blue';
// The following values are for experimental event delay track.
export const TRACK_EVENT_DELAY_HEIGHT = 40;
export const TRACK_EVENT_DELAY_LINE_WIDTH = 2;
// The following values are for IPC track.
export const TRACK_IPC_MARKERS_HEIGHT = 25;
export const TRACK_IPC_HEIGHT = TRACK_IPC_MARKERS_HEIGHT;
// The following values are the defaults for marker tracks
export const TRACK_MARKER_HEIGHT = 25;
export const TRACK_MARKER_LINE_WIDTH = 2;
export const TRACK_MARKER_DEFAULT_COLOR = 'grey';
// Height of the blank area in process track.
export const TRACK_PROCESS_BLANK_HEIGHT = 30;
// Height of timeline ruler.
export const TIMELINE_RULER_HEIGHT = 20;
// Height of the power track.
export const TRACK_POWER_HEIGHT = 25;
export const TRACK_POWER_LINE_WIDTH = 2;
export const TRACK_POWER_DEFAULT_COLOR = 'grey';
// Height of the process cpu track.
export const TRACK_PROCESS_CPU_HEIGHT = 25;
export const TRACK_PROCESS_CPU_LINE_WIDTH = 2;
// JS Tracer has very high fidelity information, and needs a more fine-grained zoom.
export const JS_TRACER_MAXIMUM_CHART_ZOOM = 0.001;
// The following values are for the visual progress tracks.
export const TRACK_VISUAL_PROGRESS_HEIGHT = 40;
export const TRACK_VISUAL_PROGRESS_LINE_WIDTH = 2;
// Height of the active tab resources panel header.
export const ACTIVE_TAB_TIMELINE_RESOURCES_HEADER_HEIGHT = 20;
// =============================================================================
// Storage and server-related constants
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// For the 2 values GOOGLE_STORAGE_BUCKET and PROFILER_SERVER_ORIGIN, several
// values are possible, so that you can easily switch between existing server
// (both local or remote).
//
// GOOGLE_STORAGE_BUCKET
// ---------------------
// This defines which bucket we fetch profile data at load time.
// Google storage bucket, where production profile data is stored:
export const GOOGLE_STORAGE_BUCKET = 'profile-store';
// You can also use one of the following values instead:
// To use the bucket used by the server deployment for the main branch:
// export const GOOGLE_STORAGE_BUCKET = 'moz-fx-dev-firefoxprofiler-bucket';
// To use the bucket developers usually use on their local working copy:
// export const GOOGLE_STORAGE_BUCKET = 'profile-store-julien-dev';
// PROFILER_SERVER_ORIGIN
// ----------------------
// This defines our server-side endpoint. This is currently used to publish
// profiles and manage shortlinks.
// This is the production server:
export const PROFILER_SERVER_ORIGIN = 'https://api.profiler.firefox.com';
// This is the deployment from the main branch:
// export const PROFILER_SERVER_ORIGIN = 'https://dev.firefoxprofiler.nonprod.cloudops.mozgcp.net';
// This is your local server:
// export const PROFILER_SERVER_ORIGIN = 'http://localhost:5252';
// SYMBOL_SERVER_URL
// -----------------
// Can be overridden with the URL parameter `symbolServer=SERVERURL`.
// You can change this to run a local symbol server (for example using profiler-symbol-server [1])
// and set it to e.g. 'http://localhost:8000/'.
//
// [1] https://github.com/mstange/profiler-symbol-server/
// This is the default server.
export const SYMBOL_SERVER_URL = 'https://symbolication.services.mozilla.com';
// See the MarkerPhase type for more information.
export const INSTANT: MarkerPhase = 0;
export const INTERVAL: MarkerPhase = 1;
export const INTERVAL_START: MarkerPhase = 2;
export const INTERVAL_END: MarkerPhase = 3;