TimeTracker implements SingletonInterface
Frontend Timetracking functions Is used to register how much time is used with operations in TypoScript.
Note: Only push() (with first argument only), pull() and setTSlogMessage() are considered API, everything else is internal.
Table of Contents
Interfaces
- SingletonInterface
- "empty" interface for singletons (marker interface pattern)
Properties
- $LR : bool
- Log Rendering flag. If set, ->push() and ->pull() is called from the cObj->cObjGetSingle().
- $currentHashPointer : 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
- $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>
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.
- getParseTime() : int
- Get total parse time in milliseconds
- getTypoScriptLogStack() : array<string|int, mixed>
- incStackPointer() : void
- Increases the stack pointer
- isEnabled() : bool
- pull() : void
- Pulls an element from the TypoScript tracking array
- push() : void
- Pushes an element to the TypoScript tracking array
- setEnabled() : void
- setTSlogMessage() : void
- Logs the TypoScript entry
- start() : void
- Sets the starting time
- getMilliseconds() : int
- Gets a microtime value as milliseconds value.
Properties
$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.
$currentHashPointer
protected
array<string|int, mixed>
$currentHashPointer
= []
$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
$starttime
Is loaded with the millisecond time when this object is created
protected
int
$starttime
= 0
$tsStack
protected
array<string|int, mixed>
$tsStack
= [[]]
$tsStackLevel
protected
int
$tsStackLevel
= 0
$tsStackLevelMax
protected
array<string|int, mixed>
$tsStackLevelMax
= []
$tsStackLog
protected
array<string|int, mixed>
$tsStackLog
= []
$tsStackPointer
protected
int
$tsStackPointer
= 0
$uniqueCounter
protected
int
$uniqueCounter
= 0
$wrapError
protected
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
protected
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']
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
getParseTime()
Get total parse time in milliseconds
public
getParseTime() : int
Return values
intgetTypoScriptLogStack()
public
getTypoScriptLogStack() : array<string|int, mixed>
Return values
array<string|int, mixed>incStackPointer()
Increases the stack pointer
public
incStackPointer() : void
Tags
isEnabled()
public
isEnabled() : bool
Return values
boolpull()
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 (@internal, may vanish)
Tags
setEnabled()
public
setEnabled([bool $isEnabled = true ]) : void
Parameters
- $isEnabled : bool = true
setTSlogMessage()
Logs the TypoScript entry
public
setTSlogMessage(string $content[, string $logLevel = LogLevel::INFO ]) : void
Parameters
- $content : string
-
The message string
- $logLevel : string = LogLevel::INFO
-
Message type: see LogLevel constants
Tags
start()
Sets the starting time
public
start([float|null $starttime = null ]) : void
Parameters
- $starttime : float|null = null
Tags
getMilliseconds()
Gets a microtime value as milliseconds value.
protected
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