FRED™  3.0
FRED™: Framework for Rapid and Easy Development
Health Class Reference

Health checks. More...

Inheritance diagram for Health:
Component Thing

Public Member Functions

 check ()
 Perform all checks. More...
 
 data ($since=null)
 Get available data. More...
 
 graph ($width=640, $height=480, $since=null)
 Create a graph with all data points. More...
 
- Public Member Functions inherited from Component
 __construct ($fred, $config=null)
 
 __destruct ()
 
 clientConfig ()
 Public configuration. More...
 
 config ($key, $default=null)
 Retrieve a config value. More...
 
 ping ()
 Ping function. More...
 
 filemtime ($filename)
 Filemtime with session cache. More...
 
 component ($name)
 Get a component (local or default). More...
 
 components (... $names)
 Get multiple components in an array. More...
 
- Public Member Functions inherited from Thing
 propertyExists ($property)
 Check if a property exists (public or published). More...
 
 constants ($prefix=null)
 Return all constants. More...
 
 get ($key)
 Get one or more properties. More...
 
 set ($key, $value=null)
 Set one or more properties. More...
 
 __get ($key)
 
 __set ($key, $value)
 

Data Fields

 $retentionPeriod = 28
 Number of days to keep data. More...
 
 $interval = 60
 Minimal mail interval (minutes). More...
 
 $from = null
 Sender (defaults to default From address). More...
 
 $to = null
 Send mail to this address (or array for multiple; defaults to default From address). More...
 
 $subject = 'Health warning for *'
 Subject for the mail (an asterisk is replaced with the host name). More...
 
 $template = null
 Template for mail message. More...
 
 $graphFont = 3
 
 $graphColors = [[200,0,0],[0,200,0],[0,0,200],[200,200,0],[0,200,200],[200,0,200],[100,0,0],[0,100,0],[0,0,100],[100,100,0],[0,100,100],[100,0,100]]
 
 $graphIntervalFactors = [2.5,2,2]
 
 $graphSecondaryFactor = 5
 
- Data Fields inherited from Component
 $filemtimeTtl = 0
 
- Data Fields inherited from Thing
const HIDDEN = 0
 Property is hidden. More...
 
const READABLE = 1
 Property is readable. More...
 
const WRITEABLE = 2
 Property is writeable. More...
 
const READWRITE = 3
 Property is readable and writeable. More...
 

Protected Member Functions

 save ($data)
 Save the check results. More...
 
 send ($messages)
 
 getChecks ()
 
- Protected Member Functions inherited from Component
 init ()
 
 done ()
 
 getSession ()
 
- Protected Member Functions inherited from Thing
 publish ($property, $visibility=self::READABLE)
 Publish a property (or hide it again). More...
 
 alias ($alias, $property, $object=null)
 Define an alias for a property (of another object). More...
 
 configure ($config)
 Configure the object. More...
 
 _get ($key)
 Default getter if no specific setter is defined, and the property is also not published (readable). More...
 
 _set ($key, $value)
 Default setter if no specific setter is defined, and the property is also not published (writeable). More...
 

Protected Attributes

 $_checks = null
 Available checks (key = name, value = \Rsi\Fred\Health\Check). More...
 
- Protected Attributes inherited from Component
 $_fred = null
 
 $_config = null
 
 $_name = null
 
 $_components = []
 Local components (key = component name, value = component). More...
 
 $_session = null
 
- Protected Attributes inherited from Thing
 $_published = []
 Published properties (key = name of property, value = visibility). More...
 
 $_aliases = []
 Alias properties (key = alias, value = [object,property]). More...
 

Detailed Description

Health checks.

Definition at line 8 of file Health.php.

Member Function Documentation

◆ check()

check ( )

Perform all checks.

Definition at line 52 of file Health.php.

◆ data()

data (   $since = null)

Get available data.

Parameters
int$sinceReturn data since this timestamp (empty = all).
Returns
array Key = timestamp, value = record with key = check name, value = check result.

Definition at line 66 of file Health.php.

◆ getChecks()

getChecks ( )
protected

Definition at line 153 of file Health.php.

◆ graph()

graph (   $width = 640,
  $height = 480,
  $since = null 
)

Create a graph with all data points.

Parameters
int$widthWidth of image (pixels).
int$heightHeight of image (pixels).
int$sinceUse data since this timestamp (empty = all).
Returns
resource Image resource.

Definition at line 76 of file Health.php.

◆ save()

save (   $data)
protected

Save the check results.

Parameters
array$dataKey = check name, value = check result.

Definition at line 28 of file Health.php.

◆ send()

send (   $messages)
protected

Definition at line 31 of file Health.php.

Field Documentation

◆ $_checks

$_checks = null
protected

Available checks (key = name, value = \Rsi\Fred\Health\Check).

Definition at line 22 of file Health.php.

◆ $from

$from = null

Sender (defaults to default From address).

Definition at line 12 of file Health.php.

◆ $graphColors

$graphColors = [[200,0,0],[0,200,0],[0,0,200],[200,200,0],[0,200,200],[200,0,200],[100,0,0],[0,100,0],[0,0,100],[100,100,0],[0,100,100],[100,0,100]]

Definition at line 18 of file Health.php.

◆ $graphFont

$graphFont = 3

Definition at line 17 of file Health.php.

◆ $graphIntervalFactors

$graphIntervalFactors = [2.5,2,2]

Definition at line 19 of file Health.php.

◆ $graphSecondaryFactor

$graphSecondaryFactor = 5

Definition at line 20 of file Health.php.

◆ $interval

$interval = 60

Minimal mail interval (minutes).

Definition at line 11 of file Health.php.

◆ $retentionPeriod

$retentionPeriod = 28

Number of days to keep data.

Definition at line 10 of file Health.php.

◆ $subject

$subject = 'Health warning for *'

Subject for the mail (an asterisk is replaced with the host name).

Definition at line 14 of file Health.php.

◆ $template

$template = null

Template for mail message.

Definition at line 15 of file Health.php.

◆ $to

$to = null

Send mail to this address (or array for multiple; defaults to default From address).

Definition at line 13 of file Health.php.


The documentation for this class was generated from the following file: