FUIPerformanceTracerOverlay
extends FUIView
in package
Table of Contents
Properties
- $captureKey : int
- Key Binding for capture/freeze tracing
- $children : array<string|int, FUIView>
- An array of child views
- $homeKey : int
- Key Binding for home
- $nextViewModeKey : int
- Key Binding to switch to the next view mode
- $padding : Vec4
- Padding is represented as a Vec4 x = left padding y = right padding z = top padding w = bottom padding
- $pageDownKey : int
- Key Binding for page down
- $pageUpKey : int
- Key Binding for page up
- $scrollDownKey : int
- Key Binding for scrolling down
- $scrollUpKey : int
- Key Binding for scrolling up
- $toggleKey : int
- Key Binding to toggle the overlay
- $toggleMethodsKey : int
- Key Binding to toggle method visibility inside the tree view
- $backgroundColor : VGColor
- Background color for the overlay
- $borderColor : VGColor
- Border color for the overlay
- $isFrozen : bool
- Whether tracing is currently frozen (captured)
- $lineHeight : float
- Height of each line in scrollable views
- $maxTraces : int
- Maximum number of traces to keep in memory
- $scrollOffset : float
- Current scroll offset for scrollable views
- $showMethods : bool
- Whether to display individual methods inside the tree view
- $textColor : VGColor
- Text color for the overlay
- $traces : array<string|int, FUIPerformanceTrace>
- Array of collected performance traces
- $viewMode : string
- Current view mode
- $viewModes : array<string|int, string>
- Available view modes
Methods
- __construct() : mixed
- Constructor
- addTrace() : void
- Add a performance trace to the collection
- clearTraces() : void
- Clear all collected traces
- getEstimatedSize() : Vec2
- Calculate estimated size for the overlay
- getHelpText() : string
- Get help text for the current view mode
- getLatestTrace() : FUIPerformanceTrace|null
- Get the latest trace
- getTraceCount() : int
- Get the number of collected traces
- getViewMode() : string
- Get the current view mode
- handleKeyPress() : bool
- Handle keyboard input for the overlay
- isFrozen() : bool
- Check if tracing is currently frozen
- nextViewMode() : void
- Switch to the next view mode
- padding() : self
- Sets the views padding Padding is the space inside the view to its content
- paddingAll() : self
- Sets all padding values to the same value Padding is the space inside the view to its content
- paddingBottom() : self
- Sets the views bottom padding Padding is the space inside the view to its content
- paddingFull() : self
- Sets the views padding with individual values Padding is the space inside the view to its content
- paddingLeft() : self
- Sets the views left padding Padding is the space inside the view to its content
- paddingRight() : self
- Sets the views right padding Padding is the space inside the view to its content
- paddingTop() : self
- Sets the views top padding Padding is the space inside the view to its content
- paddingX() : self
- Sets the views horizontal padding (left and right) Padding is the space inside the view to its content
- paddingY() : self
- Sets the views vertical padding (top and bottom) Padding is the space inside the view to its content
- previousViewMode() : void
- Switch to the previous view mode
- render() : void
- Render the overlay
- scroll() : void
- Scroll the view by the given amount
- setColors() : void
- Set overlay colors
- setFrozen() : void
- Set the frozen state of tracing
- setKeybindings() : void
- Configure all keybindings for the overlay
- setMaxTraces() : void
- Set the maximum number of traces to keep
- setViewMode() : void
- Set the view mode
- toggleFrozen() : void
- Toggle the frozen state of tracing
- drawAxes() : void
- Draw axes and labels for the performance graph
- drawDataPoints() : void
- Draw data points for recent samples
- drawGrid() : void
- Draw background grid for the performance graph
- drawLegend() : void
- Draw legend for the performance graph
- drawPerformanceLines() : void
- Draw the performance data lines
- drawThresholdLines() : void
- Draw performance threshold indicator lines
- getAverageMetrics() : array{totalTime: float, totalViews: float, renderCalls: float, count: int}
- Calculate average performance metrics across all traces
- renderHistoryContent() : void
- Render history content as a performance graph
- renderHistoryView() : void
- Render the history view (list of all traces)
- renderNoDataMessage() : void
- Render a message when no data is available
- renderSummaryView() : void
- Render the summary view (small bar at bottom)
- renderTreeContent() : void
- Render tree content
- renderTreeView() : void
- Render the tree view (detailed overlay)
Properties
$captureKey
Key Binding for capture/freeze tracing
public
int
$captureKey
= \VISU\OS\Key::C
$children
An array of child views
public
array<string|int, FUIView>
$children
= []
$homeKey
Key Binding for home
public
int
$homeKey
= \VISU\OS\Key::HOME
$nextViewModeKey
Key Binding to switch to the next view mode
public
int
$nextViewModeKey
= \VISU\OS\Key::TAB
$padding
Padding is represented as a Vec4 x = left padding y = right padding z = top padding w = bottom padding
public
Vec4
$padding
$pageDownKey
Key Binding for page down
public
int
$pageDownKey
= \VISU\OS\Key::PAGE_DOWN
$pageUpKey
Key Binding for page up
public
int
$pageUpKey
= \VISU\OS\Key::PAGE_UP
$scrollDownKey
Key Binding for scrolling down
public
int
$scrollDownKey
= \VISU\OS\Key::DOWN
$scrollUpKey
Key Binding for scrolling up
public
int
$scrollUpKey
= \VISU\OS\Key::UP
$toggleKey
Key Binding to toggle the overlay
public
int
$toggleKey
= \VISU\OS\Key::F6
$toggleMethodsKey
Key Binding to toggle method visibility inside the tree view
public
int
$toggleMethodsKey
= \VISU\OS\Key::M
$backgroundColor
Background color for the overlay
private
VGColor
$backgroundColor
$borderColor
Border color for the overlay
private
VGColor
$borderColor
$isFrozen
Whether tracing is currently frozen (captured)
private
bool
$isFrozen
= false
$lineHeight
Height of each line in scrollable views
private
float
$lineHeight
= 16.0
$maxTraces
Maximum number of traces to keep in memory
private
int
$maxTraces
$scrollOffset
Current scroll offset for scrollable views
private
float
$scrollOffset
= 0.0
$showMethods
Whether to display individual methods inside the tree view
private
bool
$showMethods
= false
$textColor
Text color for the overlay
private
VGColor
$textColor
$traces
Array of collected performance traces
private
array<string|int, FUIPerformanceTrace>
$traces
= []
$viewMode
Current view mode
private
string
$viewMode
= 'summary'
$viewModes
Available view modes
private
array<string|int, string>
$viewModes
= ['summary', 'tree', 'history']
Methods
__construct()
Constructor
public
__construct([int $maxTraces = 50 ]) : mixed
Parameters
- $maxTraces : int = 50
addTrace()
Add a performance trace to the collection
public
addTrace(FUIPerformanceTrace $trace) : void
Parameters
- $trace : FUIPerformanceTrace
clearTraces()
Clear all collected traces
public
clearTraces() : void
getEstimatedSize()
Calculate estimated size for the overlay
public
getEstimatedSize(FUIRenderContext $ctx) : Vec2
Parameters
- $ctx : FUIRenderContext
Return values
Vec2getHelpText()
Get help text for the current view mode
public
getHelpText() : string
Return values
stringgetLatestTrace()
Get the latest trace
public
getLatestTrace() : FUIPerformanceTrace|null
Return values
FUIPerformanceTrace|nullgetTraceCount()
Get the number of collected traces
public
getTraceCount() : int
Return values
intgetViewMode()
Get the current view mode
public
getViewMode() : string
Return values
stringhandleKeyPress()
Handle keyboard input for the overlay
public
handleKeyPress(int $key) : bool
Parameters
- $key : int
Return values
boolisFrozen()
Check if tracing is currently frozen
public
isFrozen() : bool
Return values
boolnextViewMode()
Switch to the next view mode
public
nextViewMode() : void
padding()
Sets the views padding Padding is the space inside the view to its content
public
padding(float $horizontal, float $vertical) : self
Parameters
- $horizontal : float
- $vertical : float
Return values
selfpaddingAll()
Sets all padding values to the same value Padding is the space inside the view to its content
public
paddingAll(float $padding) : self
Parameters
- $padding : float
Return values
selfpaddingBottom()
Sets the views bottom padding Padding is the space inside the view to its content
public
paddingBottom(float $paddingBottom) : self
Parameters
- $paddingBottom : float
Return values
selfpaddingFull()
Sets the views padding with individual values Padding is the space inside the view to its content
public
paddingFull(float $left, float $right, float $top, float $bottom) : self
Parameters
- $left : float
- $right : float
- $top : float
- $bottom : float
Return values
selfpaddingLeft()
Sets the views left padding Padding is the space inside the view to its content
public
paddingLeft(float $paddingLeft) : self
Parameters
- $paddingLeft : float
Return values
selfpaddingRight()
Sets the views right padding Padding is the space inside the view to its content
public
paddingRight(float $paddingRight) : self
Parameters
- $paddingRight : float
Return values
selfpaddingTop()
Sets the views top padding Padding is the space inside the view to its content
public
paddingTop(float $paddingTop) : self
Parameters
- $paddingTop : float
Return values
selfpaddingX()
Sets the views horizontal padding (left and right) Padding is the space inside the view to its content
public
paddingX(float $paddingX) : self
Parameters
- $paddingX : float
Return values
selfpaddingY()
Sets the views vertical padding (top and bottom) Padding is the space inside the view to its content
public
paddingY(float $paddingY) : self
Parameters
- $paddingY : float
Return values
selfpreviousViewMode()
Switch to the previous view mode
public
previousViewMode() : void
render()
Render the overlay
public
render(FUIRenderContext $ctx) : void
Parameters
- $ctx : FUIRenderContext
scroll()
Scroll the view by the given amount
public
scroll(float $delta) : void
Parameters
- $delta : float
setColors()
Set overlay colors
public
setColors(VGColor $background, VGColor $border, VGColor $text) : void
Parameters
- $background : VGColor
- $border : VGColor
- $text : VGColor
setFrozen()
Set the frozen state of tracing
public
setFrozen(bool $frozen) : void
Parameters
- $frozen : bool
setKeybindings()
Configure all keybindings for the overlay
public
setKeybindings([int $toggleKey = Key::F6 ][, int $nextViewModeKey = Key::TAB ][, int $scrollUpKey = Key::UP ][, int $scrollDownKey = Key::DOWN ][, int $pageUpKey = Key::PAGE_UP ][, int $pageDownKey = Key::PAGE_DOWN ][, int $homeKey = Key::HOME ][, int $captureKey = Key::C ][, int $toggleMethodsKey = Key::M ]) : void
Parameters
- $toggleKey : int = Key::F6
- $nextViewModeKey : int = Key::TAB
- $scrollUpKey : int = Key::UP
- $scrollDownKey : int = Key::DOWN
- $pageUpKey : int = Key::PAGE_UP
- $pageDownKey : int = Key::PAGE_DOWN
- $homeKey : int = Key::HOME
- $captureKey : int = Key::C
- $toggleMethodsKey : int = Key::M
setMaxTraces()
Set the maximum number of traces to keep
public
setMaxTraces(int $maxTraces) : void
Parameters
- $maxTraces : int
setViewMode()
Set the view mode
public
setViewMode(string $mode) : void
Parameters
- $mode : string
toggleFrozen()
Toggle the frozen state of tracing
public
toggleFrozen() : void
drawAxes()
Draw axes and labels for the performance graph
private
drawAxes(FUIRenderContext $ctx, float $x, float $y, float $width, float $height, float $graphX, float $graphY, float $graphWidth, float $graphHeight, float $maxTime) : void
Parameters
- $ctx : FUIRenderContext
- $x : float
- $y : float
- $width : float
- $height : float
- $graphX : float
- $graphY : float
- $graphWidth : float
- $graphHeight : float
- $maxTime : float
drawDataPoints()
Draw data points for recent samples
private
drawDataPoints(FUIRenderContext $ctx, float $x, float $y, float $width, float $height, float $maxTime) : void
Parameters
- $ctx : FUIRenderContext
- $x : float
- $y : float
- $width : float
- $height : float
- $maxTime : float
drawGrid()
Draw background grid for the performance graph
private
drawGrid(FUIRenderContext $ctx, float $x, float $y, float $width, float $height, float $maxTime) : void
Parameters
- $ctx : FUIRenderContext
- $x : float
- $y : float
- $width : float
- $height : float
- $maxTime : float
drawLegend()
Draw legend for the performance graph
private
drawLegend(FUIRenderContext $ctx, float $x, float $y) : void
Parameters
- $ctx : FUIRenderContext
- $x : float
- $y : float
drawPerformanceLines()
Draw the performance data lines
private
drawPerformanceLines(FUIRenderContext $ctx, float $x, float $y, float $width, float $height, float $maxTime) : void
Parameters
- $ctx : FUIRenderContext
- $x : float
- $y : float
- $width : float
- $height : float
- $maxTime : float
drawThresholdLines()
Draw performance threshold indicator lines
private
drawThresholdLines(FUIRenderContext $ctx, float $x, float $y, float $width, float $height, float $maxTime) : void
Parameters
- $ctx : FUIRenderContext
- $x : float
- $y : float
- $width : float
- $height : float
- $maxTime : float
getAverageMetrics()
Calculate average performance metrics across all traces
private
getAverageMetrics() : array{totalTime: float, totalViews: float, renderCalls: float, count: int}
Return values
array{totalTime: float, totalViews: float, renderCalls: float, count: int}renderHistoryContent()
Render history content as a performance graph
private
renderHistoryContent(FUIRenderContext $ctx, float $x, float $y, float $width, float $height) : void
Parameters
- $ctx : FUIRenderContext
- $x : float
- $y : float
- $width : float
- $height : float
renderHistoryView()
Render the history view (list of all traces)
private
renderHistoryView(FUIRenderContext $ctx) : void
Parameters
- $ctx : FUIRenderContext
renderNoDataMessage()
Render a message when no data is available
private
renderNoDataMessage(FUIRenderContext $ctx) : void
Parameters
- $ctx : FUIRenderContext
renderSummaryView()
Render the summary view (small bar at bottom)
private
renderSummaryView(FUIRenderContext $ctx) : void
Parameters
- $ctx : FUIRenderContext
renderTreeContent()
Render tree content
private
renderTreeContent(FUIRenderContext $ctx, FUIPerformanceTrace $trace, float $x, float $y, float $width, float $height) : void
Parameters
- $ctx : FUIRenderContext
- $trace : FUIPerformanceTrace
- $x : float
- $y : float
- $width : float
- $height : float
renderTreeView()
Render the tree view (detailed overlay)
private
renderTreeView(FUIRenderContext $ctx) : void
Parameters
- $ctx : FUIRenderContext