cloudsim-plus-master/cloudsim-plus-master/cloudsim-plus/src/main/java/org/cloudsimplus/faultinjection/HostFaultInjection.java
public double meanTimeBetweenHostFaultsInMinutes() {
        final List<Double> faultTimes = hostFaultsTimeSecsMap
                .values()
                .stream()
                .flatMap(list -> list.stream())
                .sorted()
                .collect(toList());
        if(faultTimes.isEmpty()){
            return 0;
        }

        //computes the differences between failure times t2 - t1
        double sum=0, previous=faultTimes.get(0);
        for(final Double v: faultTimes) {
            sum += (v - previous);
            previous = v;
        }

        final double seconds = sum/faultTimes.size();
        return (long)(seconds/60.0);
    }
/**
     * Computes the current Mean Time Between host Failures (MTBF) in minutes.
     * Since Hosts don't actually recover from failures,
     * there aren't recovery time to make easier the computation
     * of MTBF for Host as it is directly computed for VMs.
     *
     * @return the current mean time (in minutes) between Host failures (MTBF)
     * or zero if no failures have happened yet
     * @see #meanTimeBetweenVmFaultsInMinutes()
     */
Computes the current Mean Time Between host Failures (MTBF) in minutes.
Since Hosts don't actually recover from failures,
there aren't recovery time to make easier the computation
of MTBF for Host as it is directly computed for VMs.

@return the current mean time (in minutes) between Host failures (MTBF)
or zero if no failures have happened yet
@see #meanTimeBetweenVmFaultsInMinutes()
Computes the current Mean Time Between host Failures ( MTBF ) in minutes . Since Hosts don ' t actually recover from failures there aren ' t recovery time to make easier the computation of MTBF for Host as it is directly computed for VMs . @return the current mean time ( in minutes ) between Host failures ( MTBF ) or zero if no failures have happened yet @see #meanTimeBetweenVmFaultsInMinutes ()
public double meanTimeBetweenHostFaultsInMinutes() {
        final List<Double> faultTimes = hostFaultsTimeSecsMap
                .values()
                .stream()
                .flatMap(list -> list.stream())
                .sorted()
                .collect(toList());
        if(faultTimes.isEmpty()){
            return 0;
        }
        double sum=0, previous=faultTimes.get(0);
        for(final Double v: faultTimes) {
            sum += (v - previous);
            previous = v;
        }
        final double seconds = sum/faultTimes.size();
        return (long)(seconds/60.0);
    }
public double meanTimeBetweenHostFaultsInMinutes ( ) { final List < Double > faultTimes = hostFaultsTimeSecsMap . values ( ) . stream ( ) . flatMap ( list -> list . stream ( ) ) . sorted ( ) . collect ( toList ( ) ) ; if ( faultTimes . isEmpty ( ) ) { return 0 ; } double sum = 0 , previous = faultTimes . get ( 0 ) ; for ( final Double v : faultTimes ) { sum += ( v - previous ) ; previous = v ; } final double seconds = sum / faultTimes . size ( ) ; return ( long ) ( seconds / 60.0 ) ; }
Computes the current Mean Time Between host Failures (MTBF) in minutes.
Computes the current Mean Time Between host Failures ( MTBF ) in minutes .
//computes the differences between failure times t2 - t1