-
-
Notifications
You must be signed in to change notification settings - Fork 34.5k
Expand file tree
/
Copy pathconstants.py
More file actions
65 lines (52 loc) · 1.52 KB
/
constants.py
File metadata and controls
65 lines (52 loc) · 1.52 KB
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
"""Constants for the live profiling collector."""
# Time conversion constants
MICROSECONDS_PER_SECOND = 1_000_000
# Display update constants
DISPLAY_UPDATE_HZ = 10
DISPLAY_UPDATE_INTERVAL_SEC = 1.0 / DISPLAY_UPDATE_HZ # 0.1 seconds
# Terminal size constraints
MIN_TERMINAL_WIDTH = 60
MIN_TERMINAL_HEIGHT = 12
# Column width thresholds
WIDTH_THRESHOLD_SAMPLE_PCT = 80
WIDTH_THRESHOLD_TOTTIME = 100
WIDTH_THRESHOLD_CUMUL_PCT = 120
WIDTH_THRESHOLD_CUMTIME = 140
# Display layout constants
HEADER_LINES = 10 # Increased to include thread status line
FOOTER_LINES = 2
SAFETY_MARGIN = 1
TOP_FUNCTIONS_DISPLAY_COUNT = 3
# Column widths for data display
COL_WIDTH_NSAMPLES = 13
COL_SPACING = 2
COL_WIDTH_SAMPLE_PCT = 5
COL_WIDTH_TIME = 10
# Function name display
MIN_FUNC_NAME_WIDTH = 10
MAX_FUNC_NAME_WIDTH = 40
MIN_AVAILABLE_SPACE = 10
# Progress bar display
MIN_BAR_WIDTH = 10
MAX_SAMPLE_RATE_BAR_WIDTH = 30
MAX_EFFICIENCY_BAR_WIDTH = 60
# Sample rate scaling
MIN_SAMPLE_RATE_FOR_SCALING = 100
# Finished banner display
FINISHED_BANNER_EXTRA_LINES = 3 # Blank line + banner + blank line
# Opcode panel display
OPCODE_PANEL_HEIGHT = 12 # Height reserved for opcode statistics panel
# Color pair IDs
COLOR_PAIR_SAMPLES = 1
COLOR_PAIR_FILE = 2
COLOR_PAIR_FUNC = 3
COLOR_PAIR_HEADER_BG = 4
COLOR_PAIR_CYAN = 5
COLOR_PAIR_YELLOW = 6
COLOR_PAIR_GREEN = 7
COLOR_PAIR_MAGENTA = 8
COLOR_PAIR_RED = 9
COLOR_PAIR_SORTED_HEADER = 10
# Default display settings
DEFAULT_SORT_BY = "nsamples" # Number of samples in leaf (self time)
DEFAULT_DISPLAY_LIMIT = 20