MTBF

hemanth_
Kilo Explorer

Hi All,

Can anyone suggest me how to create MTBF Report for incidents?

Regards,

Kumar

1 ACCEPTED SOLUTION

You may want to try creating an Outage record for Incidents related to a service interruption (or CI outage).   The Outage record tracks the start time, end time and duration of an outage for a CI.  



Using Wikipedia's definition (Mean time between failures - Wikipedia, the free encyclopedia) MTBF is calculated by:



Sum of (start of downtime - start of uptime)


---------------------------------------------------------


                                number of failures



Using Outage records, you should be able to calculate the time difference between Outages (difference of end time of one Outage and start time of following Outage), and divide their sum by the number of Outages for a given service/CI.   A business rule triggered by an end time being inserted into an Outage record could calculate the MTBF value.



You could add a custom field to the CI record to store the calculated MTBF value and use that for reporting.



Hope this helps.


View solution in original post

5 REPLIES 5

mike_bush
Kilo Guru

As with all reporting requirements you need to turn the English phrase "MTBF report for incidents" into :-



What does MTBF mean in my set up


Which Fields hold the data I need


What Query will I run to get the correct records



Until you understand where the data is you cannot begin to write a report


Hi All,



Apology for my mistake.



MTBF : Stands for Mean Time Between Failure


It calculates the sum of the time when a service was up and divide it by the number of failures.



Mean Time Between Failure = (Sum of time between failure)/(Total number of failures)


here I am trying to find calculate the MTBF of a Configuration Item based on P1 and status is closed. I also need to publish a report for the same.



I think, it should include the number of failures and the sum of the time between failures.


Eg. if two P1 cases are created. Hence I need to find the time between these two P1's ie. the time between the first P1 closed and the time the second P1 raised.



I have tried the below code for testing however it is giving a result as 0.



function onChange(control, oldValue, newValue, isLoading, isTemplate) {
    if (isLoading || newValue == '') {
          return;
    }
var rec = new GlideRecord('incident');
rec.addQuery('state',7);
rec.addQuery('priority',1);
rec.orderBy('sys_created_on');
rec.query();
var M = 0;
while (rec.next())
{
var rec1 = new GlideRecord('incident');
rec1.addQuery('state',7);
rec1.addQuery('priority',1);
rec1.orderBy('sys_created_on');
rec1.query();
while(rec1.next())
{
if((rec.number==rec1.number) && (rec.sys_created_on<rec1.sys_created_on))
{
M=(rec1.sys_created_on-rec.closed_at) + M;
return;
}
}
}
g_form.setValue('u_mean_time',M);
    //Type appropriate comment here, and begin script below
}






Waiting for the response from anyone please.


You may want to try creating an Outage record for Incidents related to a service interruption (or CI outage).   The Outage record tracks the start time, end time and duration of an outage for a CI.  



Using Wikipedia's definition (Mean time between failures - Wikipedia, the free encyclopedia) MTBF is calculated by:



Sum of (start of downtime - start of uptime)


---------------------------------------------------------


                                number of failures



Using Outage records, you should be able to calculate the time difference between Outages (difference of end time of one Outage and start time of following Outage), and divide their sum by the number of Outages for a given service/CI.   A business rule triggered by an end time being inserted into an Outage record could calculate the MTBF value.



You could add a custom field to the CI record to store the calculated MTBF value and use that for reporting.



Hope this helps.


You can also generate these numbers live using Explore Analytics. There's a native calculation functionality that you can use calculate that for users, if you're tracking outages on the outage table.



Here's an example that includes the number of outages, alongside the cost of outage, uptime, and mean time between failures:



https://my.exploreanalytics.com/pub/view/1ba69900b76e4fc195a72344273fbbad



Didn't require any javascript, just this:


Screenshot 2015-01-22 07.40.30.png