TimeTracker implements SingletonInterface
Frontend Timetracking functions Is used to register how much time is used with operations in TypoScript
Table of Contents
Interfaces
- SingletonInterface
- "empty" interface for singletons (marker interface pattern)
Properties
- $currentHashPointer : array<string|int, mixed>
- $highlightLongerThan : int
- Log entries that take than this number of milliseconds (own time) will be highlighted during log display. Set 0 to disable highlighting.
- $LR : bool
- Log Rendering flag. If set, ->push() and ->pull() is called from the cObj->cObjGetSingle().
- $printConf : array<string|int, mixed>
- $starttime : int
- Is loaded with the millisecond time when this object is created
- $tsStack : array<string|int, mixed>
- $tsStackLevel : int
- $tsStackLevelMax : array<string|int, mixed>
- $tsStackLog : array<string|int, mixed>
- $tsStackPointer : int
- $uniqueCounter : int
- $wrapError : array<string|int, mixed>
- $wrapIcon : array<string|int, mixed>
- $finishtime : float
- Is set via finish() with the millisecond time when the request handler is finished.
- $isEnabled : bool
- If set to true (see constructor) then timetracking is enabled
Methods
- __construct() : mixed
- decStackPointer() : void
- Decreases the stack pointer
- finish() : void
- Usually called when the page generation and output is prepared.
- getDifferenceToStarttime() : int
- Gets the difference between a given microtime value and the starting time as milliseconds.
- getMilliseconds() : int
- Gets a microtime value as milliseconds value.
- getParseTime() : int
- Get total parse time in milliseconds
- incStackPointer() : void
- Increases the stack pointer
- printTSlog() : string
- Print TypoScript parsing log
- pull() : void
- Pulls an element from the TypoScript tracking array
- push() : void
- Pushes an element to the TypoScript tracking array
- setEnabled() : mixed
- setTSlogMessage() : mixed
- Logs the TypoScript entry
- setTSselectQuery() : void
- Set TSselectQuery - for messages in TypoScript debugger.
- start() : mixed
- Sets the starting time
- createHierarchyArray() : void
- Helper function for internal data manipulation
- fixCLen() : string
- Wraps the input content string in green colored span-tags IF the length of the input string exceeds $this->printConf['contentLength'] (or $this->printConf['contentLength_FILE'] if $v == "FILE"
- fixContent() : string
- Recursively generates the content to display
- fw() : string
- Wraps input string in a <span> tag
Properties
$currentHashPointer
public
array<string|int, mixed>
$currentHashPointer
= []
$highlightLongerThan
Log entries that take than this number of milliseconds (own time) will be highlighted during log display. Set 0 to disable highlighting.
public
int
$highlightLongerThan
= 0
$LR
Log Rendering flag. If set, ->push() and ->pull() is called from the cObj->cObjGetSingle().
public
bool
$LR
= true
This determines whether the TypoScript parsing activity is logged. But it also slows down the rendering.
$printConf
public
array<string|int, mixed>
$printConf
= [
'showParentKeys' => true,
'contentLength' => 10000,
// Determines max length of displayed content before it gets cropped.
'contentLength_FILE' => 400,
// Determines max length of displayed content FROM FILE cObjects before it gets cropped. Reason is that most FILE cObjects are huge and often used as template-code.
'flag_tree' => true,
'flag_messages' => true,
'flag_content' => false,
'allTime' => false,
'keyLgd' => 40,
]
$starttime
Is loaded with the millisecond time when this object is created
public
int
$starttime
= 0
$tsStack
public
array<string|int, mixed>
$tsStack
= [[]]
$tsStackLevel
public
int
$tsStackLevel
= 0
$tsStackLevelMax
public
array<string|int, mixed>
$tsStackLevelMax
= []
$tsStackLog
public
array<string|int, mixed>
$tsStackLog
= []
$tsStackPointer
public
int
$tsStackPointer
= 0
$uniqueCounter
public
int
$uniqueCounter
= 0
$wrapError
public
array<string|int, mixed>
$wrapError
= [\Psr\Log\LogLevel::INFO => ['', ''], \Psr\Log\LogLevel::NOTICE => ['<strong>', '</strong>'], \Psr\Log\LogLevel::WARNING => ['<strong style="color:#ff6600;">', '</strong>'], \Psr\Log\LogLevel::ERROR => ['<strong style="color:#ff0000;">', '</strong>']]
$wrapIcon
public
array<string|int, mixed>
$wrapIcon
= [\Psr\Log\LogLevel::INFO => '', \Psr\Log\LogLevel::NOTICE => 'actions-document-info', \Psr\Log\LogLevel::WARNING => 'status-dialog-warning', \Psr\Log\LogLevel::ERROR => 'status-dialog-error']
$finishtime
Is set via finish() with the millisecond time when the request handler is finished.
protected
float
$finishtime
= 0
$isEnabled
If set to true (see constructor) then timetracking is enabled
protected
bool
$isEnabled
= false
Methods
__construct()
public
__construct([bool $isEnabled = true ]) : mixed
Parameters
- $isEnabled : bool = true
decStackPointer()
Decreases the stack pointer
public
decStackPointer() : void
Tags
finish()
Usually called when the page generation and output is prepared.
public
finish() : void
Tags
getDifferenceToStarttime()
Gets the difference between a given microtime value and the starting time as milliseconds.
public
getDifferenceToStarttime([float|null $microtime = null ]) : int
Parameters
- $microtime : float|null = null
-
The microtime value - if not set the current time is used
Return values
int —The difference between a given microtime value and starting time as milliseconds
getMilliseconds()
Gets a microtime value as milliseconds value.
public
getMilliseconds([float|null $microtime = null ]) : int
Parameters
- $microtime : float|null = null
-
The microtime value - if not set the current time is used
Return values
int —The microtime value as milliseconds value
getParseTime()
Get total parse time in milliseconds
public
getParseTime() : int
Return values
intincStackPointer()
Increases the stack pointer
public
incStackPointer() : void
Tags
printTSlog()
Print TypoScript parsing log
public
printTSlog() : string
Return values
string —HTML table with the information about parsing times.
pull()
Pulls an element from the TypoScript tracking array
public
pull([string $content = '' ]) : void
Parameters
- $content : string = ''
-
The content string generated within the push/pull part.
Tags
push()
Pushes an element to the TypoScript tracking array
public
push(string $tslabel[, string $value = '' ]) : void
Parameters
- $tslabel : string
-
Label string for the entry, eg. TypoScript property name
- $value : string = ''
-
Additional value(?)
Tags
setEnabled()
public
setEnabled([bool $isEnabled = true ]) : mixed
Parameters
- $isEnabled : bool = true
setTSlogMessage()
Logs the TypoScript entry
public
setTSlogMessage(string $content[, string $logLevel = LogLevel::INFO ]) : mixed
Parameters
- $content : string
-
The message string
- $logLevel : string = LogLevel::INFO
-
Message type: see LogLevel constants
Tags
setTSselectQuery()
Set TSselectQuery - for messages in TypoScript debugger.
public
setTSselectQuery(array<string|int, mixed> $data[, string $msg = '' ]) : void
Parameters
- $data : array<string|int, mixed>
-
Query array
- $msg : string = ''
-
Message/Label to attach
start()
Sets the starting time
public
start([float|null $starttime = null ]) : mixed
Parameters
- $starttime : float|null = null
Tags
createHierarchyArray()
Helper function for internal data manipulation
protected
createHierarchyArray(array<string|int, mixed> &$arr, int $pointer, string $uniqueId) : void
Parameters
- $arr : array<string|int, mixed>
-
Array (passed by reference) and modified
- $pointer : int
-
Pointer value
- $uniqueId : string
-
Unique ID string
Tags
fixCLen()
Wraps the input content string in green colored span-tags IF the length of the input string exceeds $this->printConf['contentLength'] (or $this->printConf['contentLength_FILE'] if $v == "FILE"
protected
fixCLen(string $c, string $v) : string
Parameters
- $c : string
-
The content string
- $v : string
-
Command: If "FILE" then $this->printConf['contentLength_FILE'] is used for content length comparison, otherwise $this->printConf['contentLength']
Return values
stringfixContent()
Recursively generates the content to display
protected
fixContent(array<string|int, mixed> &$arr, string $content[, string $depthData = '' ][, string $vKey = '' ]) : string
Parameters
- $arr : array<string|int, mixed>
-
Array which is modified with content. Reference
- $content : string
-
Current content string for the level
- $depthData : string = ''
-
Prefixed icons for new PM icons
- $vKey : string = ''
-
Seems to be the previous tsStackLog key
Return values
string —Returns the $content string generated/modified. Also the $arr array is modified!
fw()
Wraps input string in a <span> tag
protected
fw(string $str) : string
Parameters
- $str : string
-
The string to be wrapped