CalculateAvailability
Questions answered by this recipe
How can I use special PmWiki markup to help me calculate (estimate) the availability of a system consisting of components connected in series?
How can I use special PmWiki markup to help me calculate (estimate) the availability of a system based on its parameters for mean time between failure (MTBF) and mean time to repear (MTTR)?
Description
Special markup for calculating availability
Notes
 Availability for a system of serially connected components are calculated
according to the formula
{$ A_{system} = A_1 * A_2 * ... A_n $}where {$ A_{system} $} is the availability of the system, and {$ A_i $} is the availability of component i.
 The markup makes it easy to calculate the availability of a single component
based on estimates of its MTBF and MTTR according to the formula
{$ A = \frac{MTBF}{MTBF + MTTR} $}
 Calculation of availability for components "in parallel" is not supported, although it could be added given a suitable markup.
 Calculation of MTBF from availability and MTTR is not supported, although it could be added given a suitable arkup.
Installation and use
To install the script, download calculate_availability.phpΔ and place it for instance in your cookbook directory. Then add something like the following line to your configuration file.
include_once("$FarmD
/cookbook/calculate_availability.php");
Usage
Syntax synopsis:
 Form 1:
(:calcavail <nn>% :)
(:calcavail 99.99% :)
 Form 2:
(:calcavail mtbf=<MTBF><unit> mttr=<MTTR><unit> :)
(:calcavail mtbf=5.5y mttr=12h :)
 Form 3:
(:calcavail :)
(:calcavail :)
The arguments are used as follows
<nn> A number 0100 of availability in percent, e.g. 99.9. % The percent sign after the number is mandatory. <MTBF> A number (e.g. 12.5) indicating mean time between failure. <unit> A mandatory character indicating the unit, where 'y' = Year (365 days per week) 'm' = Month (30 days per week) 'w' = Week (7 days/per week) 'd' = Day 'h' = Hour (24 hours per day) <MTTR> A number (e.g. .5) indicating mean time to repeair. <unit> A character indicating the unit, same as described above.
The first form, e.g. (:calcavail 99%:)
simply "adds" another component with
an availability to the combined availability. Mathematically it just multiplies
99% (in this example) with the accmulated availability.
The second form works like the first form, except that instead of specifying the availability in percent, you specify it in terms of MTBF and MTTR.
The third form prints the accumulated availability, and then resets the accumulated availability to 1 so that a new calculation can be started.
Examples
Two examples of how to use the markup.
Example 1
Simple example, calculating availability of two components in series with availabilities of 99.9% and 99.5% respectively.
Markup 
Result 
* Availability of component 1: (:calcavail 99.9% :) * Availability of component 2: (:calcavail 99.5% :) * Combined availability: (:calcavail :) 

Example 2
Markup 
Result 
* Calculating availability of component 1: (:calcavail mtbf=5y mttr=44h :) * Calculating availability of component 2: (:calcavail mtbf=33400h mttr=7d :) * Combined availability: (:calcavail :) 

Release Notes
 20061202
 Release 1  probably the only release. I wrote this for a onetime use and don't think I will need further functionality. Others are of course welcome to use and expand on this work.
See Also
 Availability [wikipedia.com]
 Basics of reliability availability [eventhelix.com]
 System reliability availability [eventhelix.com]
Contributors
 Christian Ridderström  please contact me via the PmWiki developers' list
Comments
See discussion at CalculateAvailabilityTalk
User notes? : If you use, used or reviewed this recipe, you can add your name. These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki.