com.lokorin.lokorin.lib
[ class tree: com.lokorin.lokorin.lib ] [ index: com.lokorin.lokorin.lib ] [ all elements ]

Procedural File: lib_performance.php

Source Location: /_includes/lib_performance.php



Classes:

PerformanceData
Describes a collection of all performance data related to a specified URI.


Page Details:

Describes a library that handles everything that has to do with the performance monitoring of the site.



Tags:

filesource:  Source Code for this file
license:  GNU Lesser General Public License
version:  $Revision: 1.3 $
author:  Andreas Launila







PERFORMANCE_DB [line 22]

PERFORMANCE_DB = 1
Performance type specific identifiers. The constants decide what performance time that should be looked at.



Tags:

access:  public

[ Top ]



PERFORMANCE_HITS [line 28]

PERFORMANCE_HITS = 7
Performance type specific identifiers. The constants decide what performance time that should be looked at.



Tags:

access:  public

[ Top ]



PERFORMANCE_PAGE [line 23]

PERFORMANCE_PAGE = 2
Performance type specific identifiers. The constants decide what performance time that should be looked at.



Tags:

access:  public

[ Top ]



PERFORMANCE_PAGE_WITHOUT_DB [line 24]

PERFORMANCE_PAGE_WITHOUT_DB = 3
Performance type specific identifiers. The constants decide what performance time that should be looked at.



Tags:

access:  public

[ Top ]



PERFORMANCE_PER_QUERY [line 25]

PERFORMANCE_PER_QUERY = 4
Performance type specific identifiers. The constants decide what performance time that should be looked at.



Tags:

access:  public

[ Top ]



PERFORMANCE_QUERIES [line 26]

PERFORMANCE_QUERIES = 5
Performance type specific identifiers. The constants decide what performance time that should be looked at.



Tags:

access:  public

[ Top ]



PERFORMANCE_SIZE [line 27]

PERFORMANCE_SIZE = 6
Performance type specific identifiers. The constants decide what performance time that should be looked at.



Tags:

access:  public

[ Top ]




formatMicroseconds [line 158]

string formatMicroseconds( integer $microseconds)

Formats microseconds by rewriting them as seconds.



Tags:

return:  The formatted value in seconds.
access:  public


Parameters

integer   $microseconds   The value in microseconds that should be formatted.
[ Top ]



formatTimestampToDate [line 147]

string formatTimestampToDate( integer $time)

formats a unix timestamp into a date representation.



Tags:

return:  The date that corresponds to the given timestamp.
access:  public


Parameters

integer   $time   The unix timestamp that should be formatted.
[ Top ]



getFieldExpression [line 126]

string getFieldExpression( mixed $selectType, [string $function = "%s"], integer $select)

Gets the expression of the field that is connected to the specified select type constant. The function can also wrap the expression in an optional printf pattern if possible.



Tags:

return:  A field expression that counts as a valid SQL field.
access:  private
throws:  IllegalArgumentException If the provided select type constant is not valid.


Parameters

integer   $select   Type A performance constant describing the type of performance that should be looked at.
string   $function   The printf pattern that the expression should be wrapped in, if allowed by the expression. The first instance of %s will be replaced by the field expression if possible, otherwise the expression will be returned without being sent through the pattern.
[ Top ]



getSelectField [line 99]

string getSelectField( integer $selectType, boolean $average, boolean $descending)

Gets the select parameter that should be used when selecting the specified select type from the performance database.



Tags:

return:  A string that can be entered after SELECT in a query.
access:  private
throws:  IllegalArgumentException If the provided select type constant is not valid.


Parameters

integer   $selectType   A performance constant describing the type of performance that should be looked at.
boolean   $average   Whether or not the average performance should be used. If true then the average performance is looked at, otherwise the peak performance is looked at.
boolean   $descending   Whether or not the slowest performance should be considered greatest. If true then the slowest performance will be shown first in the list, otherwise the fastest performance will be shown first.
[ Top ]



getTopList [line 57]

array getTopList( integer $selectType, [boolean $average = true], [boolean $descending = true], [integer $count = 10], [integer $minLoggedData = 30])

Gets a top list of the performance of the specified type.



Tags:

return:  An array with the requested uri as key and the corresponding measured value in microseconds as array value. The array is sorted descendingly is $slowest equals true, otherwise it's sorted ascendingly.
access:  public
throws:  IllegalArgumentException If the provided select type constant is not valid.


Parameters

integer   $selectType   A performance constant describing the type of performance that should be looked at.
boolean   $average   Whether or not the average performance should be used. If true then the average performance is looked at, otherwise the peak performance is looked at.
boolean   $descending   Whether or not the slowest performance should be considered greatest. If true then the slowest performance will be shown first in the list, otherwise the fastest performance will be shown first.
integer   $count   The maximum number of entries that should be displayed in the top lost. E.g. 10 means that a maximum number of 10 entries will be shown. Fewer entries will be shown if there are not at least 10 entries to show.
integer   $minLoggedData   The minimum amount of times that data about the returned urls have to have been requested to be included in the result.
[ Top ]



Documentation generated on Sun, 16 Apr 2006 21:03:44 +0200 by phpDocumentor 1.3.0RC4