[ Index ]

PHP Cross Reference of MediaWiki-1.24.0

title

Body

[close]

/includes/profiler/ -> ProfilerStandard.php (summary)

Common implementation class for profiling. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

File Size: 559 lines (16 kb)
Included or required:0 times
Referenced: 1 time
Includes or requires: 0 files

Defines 1 class

ProfilerStandard:: (22 methods):
  __construct()
  isStub()
  isPersistent()
  collateOnly()
  addInitialStack()
  getZeroEntry()
  getErrorEntry()
  updateEntry()
  profileIn()
  profileOut()
  close()
  logData()
  getOutput()
  getCallTree()
  remapCallTree()
  getCallTreeLine()
  collateData()
  getFunctionReport()
  getRawData()
  calculateOverhead()
  calltreeCount()
  getContentType()


Class: ProfilerStandard  - X-Ref

Standard profiler that tracks real time, cpu time, and memory deltas

This supports profile reports, the debug toolbar, and high-contention
DB query warnings. This does not persist the profiling data though.

__construct( array $params )   X-Ref

param: array $params

isStub()   X-Ref
Return whether this a stub profiler

return: bool

isPersistent()   X-Ref
Return whether this profiler stores data

return: bool

collateOnly()   X-Ref
Whether to internally just track aggregates and ignore the full stack trace

Only doing collation saves memory overhead but limits the use of certain
features like that of graph generation for the debug toolbar.

return: bool

addInitialStack()   X-Ref
Add the inital item in the stack.


getZeroEntry()   X-Ref

return: array Initial collation entry

getErrorEntry()   X-Ref

return: array Initial collation entry for errors

updateEntry($name, $elapsedCpu, $elapsedReal, $memChange, $subcalls = 0, $period = null)   X-Ref
Update the collation entry for a given method name

param: string $name
param: float $elapsedCpu
param: float $elapsedReal
param: int $memChange
param: int $subcalls
param: array|null $period Map of ('start','end','memory','subcalls')

profileIn( $functionname )   X-Ref
Called by wfProfieIn()

param: string $functionname

profileOut( $functionname )   X-Ref
Called by wfProfieOut()

param: string $functionname

close()   X-Ref
Close opened profiling sections


logData()   X-Ref
Log the data to some store or even the page output


getOutput()   X-Ref
Returns a profiling output to be stored in debug file

return: string

getCallTree()   X-Ref
Returns a tree of function call instead of a list of functions

return: string

remapCallTree( array $stack )   X-Ref
Recursive function the format the current profiling array into a tree

param: array $stack Profiling array
return: array

getCallTreeLine( $entry )   X-Ref
Callback to get a formatted line for the call tree

param: array $entry
return: string

collateData()   X-Ref
Populate mCollated


getFunctionReport()   X-Ref
Returns a list of profiled functions.

return: string

getRawData()   X-Ref

return: array

calculateOverhead( $profileCount )   X-Ref
Dummy calls to wfProfileIn/wfProfileOut to calculate its overhead

param: int $profileCount

calltreeCount( $stack, $start )   X-Ref
Counts the number of profiled function calls sitting under
the given point in the call graph. Not the most efficient algo.

param: array $stack
param: int $start
return: int

getContentType()   X-Ref
Get the content type sent out to the client.
Used for profilers that output instead of store data.

return: string



Generated: Fri Nov 28 14:03:12 2014 Cross-referenced by PHPXref 0.7.1