Profiler
实现 ProfilerInterface, IteratorAggregate, CountableProfilerInterface 的实现。
自 |
1.0 |
---|---|
包 |
Joomla 框架 |
方法
__construct
构造函数。
__construct( name, \Joomla\Profiler\ProfilerRendererInterface renderer = null, \Joomla\Profiler\ProfilePointInterface||string|int points = [], memoryRealUsage = false) :
自 |
1.0 |
---|---|
抛出 |
|
参数
- name
string
分析器名称。- renderer
ProfilerRendererInterface|null
渲染器。- points
array<string|int, ProfilePointInterface>
分析点数组。- memoryRealUsage
bool
获取实际内存使用情况为真。
响应
混合
__toString
使用渲染器将分析器转换为字符串。
__toString() :
自 |
1.0 |
---|
响应
string
渲染的分析器。
count
计算此分析器中的点数。
count() :
自 |
1.0 |
---|
响应
int
点数。
getIterator
获取分析器点上的迭代器。
getIterator() : \ArrayIterator
自 |
1.0 |
---|
响应
ArrayIterator
分析器点上的迭代器。
getMemoryBytesBetween
获取两个点之间分配的内存量(以字节为单位)。
getMemoryBytesBetween( first, second) :
自 |
1.0 |
---|---|
抛出 |
|
参数
- first
string
第一个点的名称。- second
string
第二个点的名称。
响应
int
这两个点之间的分配内存量(以字节为单位)。
getMemoryPeakBytes
获取分析器运行期间的内存峰值(以字节为单位)。
getMemoryPeakBytes() :
自 |
1.0 |
---|
响应
int
内存峰值(以字节为单位)。
getName
获取此分析器的名称。
getName() :
自 |
1.0 |
---|
响应
string
此分析器的名称。
getPoint
获取由给定名称标识的点。
getPoint( name, default = null) : \Joomla\Profiler\ProfilePointInterface|mixed
getPoints
获取此分析器中的点(从第一个到最后一个)。
getPoints() : \Joomla\Profiler\ProfilePointInterface||string|int
getRenderer
获取此分析器中当前使用的渲染器。
getRenderer() : \Joomla\Profiler\ProfilerRendererInterface
getTimeBetween
获取两个点之间经过的秒数。
getTimeBetween( first, second) :
自 |
1.0 |
---|---|
抛出 |
|
参数
- first
string
第一个点的名称。- second
string
第二个点的名称。
响应
float
这两个点之间经过的秒数。
hasPoint
检查分析器是否已标记给定点。
hasPoint( name) :
自 |
1.0 |
---|
参数
- name
string
点的名称。
响应
bool
如果分析器已标记该点,则为真,否则为假。
mark
标记分析点。
mark( name) : \Joomla\Profiler\ProfilerInterface
render
渲染分析器。
render() :
自 |
1.0 |
---|
响应
string
渲染的分析器。
setRenderer
设置渲染器以渲染此分析器。
setRenderer(\Joomla\Profiler\ProfilerRendererInterface renderer) : \Joomla\Profiler\Profiler
setStart
使用指定的开始时间和内存创建分析点。
setStart( timeStamp = 0.0, memoryBytes) : \Joomla\Profiler\ProfilerInterface
此方法仅在未添加其他点的情况下添加点,因为在更改开始点之前创建的 ProfilePointInterface 对象会导致测量不准确。
自 |
1.2.0 |
---|---|
抛出 |
|
参数
- timeStamp
float
分析器应开始测量时间的微秒时间戳。- memoryBytes
int
分析器应开始测量内存时的字节数。
响应
ProfilerInterface
此方法是可链接的。