pub fn is_threshold_reached(
        &mut self,
        pattern_type: &PatternType,
        options: &SearchOptions,
    ) -> bool {
        trace!(
            "pattern_type={:?}, runifok={}",
            pattern_type,
            options.runifok
        );
        // increments thresholds and compare with possible defined limits and accumulate counters for plugin output
        match pattern_type {
            PatternType::critical => {
                //self.counters.critical_count += 1;
                if self.counters.critical_count <= options.criticalthreshold {
                    return false;
                }
            }
            PatternType::warning => {
                //self.counters.warning_count += 1;
                if self.counters.warning_count <= options.warningthreshold {
                    return false;
                }
            }
            // this special Ok pattern resets counters
            PatternType::ok => {
                //self.counters.ok_count += 1;
                self.counters.critical_count = 0;
                self.counters.warning_count = 0;

                // no need to process further: don't call a script if runifok is not set
                return options.runifok;
                //return true;
            }
        }
        true
    }
/// Return `true` if counters reach thresholds
Return `true` if counters reach thresholds
Return ` true ` if counters reach thresholds
pub fn is_threshold_reached(
        &mut self,
        pattern_type: &PatternType,
        options: &SearchOptions,
    ) -> bool {
        trace!(
            "pattern_type={:?}, runifok={}",
            pattern_type,
            options.runifok
        );
        // increments thresholds and compare with possible defined limits and accumulate counters for plugin output
        match pattern_type {
            PatternType::critical => {
                //self.counters.critical_count += 1;
                if self.counters.critical_count <= options.criticalthreshold {
                    return false;
                }
            }
            PatternType::warning => {
                //self.counters.warning_count += 1;
                if self.counters.warning_count <= options.warningthreshold {
                    return false;
                }
            }
            // this special Ok pattern resets counters
            PatternType::ok => {
                //self.counters.ok_count += 1;
                self.counters.critical_count = 0;
                self.counters.warning_count = 0;
                // no need to process further: don't call a script if runifok is not set
                return options.runifok;
                //return true;
            }
        }
        true
    }
pub fn is_threshold_reached ( & mut self , pattern_type : & PatternType , options : & SearchOptions , ) -> bool { trace ! ( " " pattern_type options runifok ) ; // increments thresholds and compare with possible defined limits and accumulate counters for plugin output match pattern_type { PatternType :: critical => { //self.counters.critical_count += 1; if self . counters . critical_count <= options . criticalthreshold { return false ; } } PatternType :: warning => { //self.counters.warning_count += 1; if self . counters . warning_count <= options . warningthreshold { return false ; } } // this special Ok pattern resets counters PatternType :: ok => { //self.counters.ok_count += 1; self . counters . critical_count = 0 ; self . counters . warning_count = 0 ; // no need to process further: don't call a script if runifok is not set return options . runifok ; //return true; } } true }
Return `true` if counters reach thresholds
Return ` true ` if counters reach thresholds
&mut self
pattern_type
&PatternType
options
&SearchOptions
&mut self
pattern_type
&PatternType
options
&SearchOptions