<commit_before>#
# Copyright 2019 Centreon (http://www.centreon.com/)
#
# Centreon is a full-fledged industry-strength solution that meets
# the needs in IT infrastructure and application monitoring for
# service performance.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

package apps::centreon::local::mode::centenginestats;

use base qw(centreon::plugins::templates::counter);

use strict;
use warnings;
use centreon::plugins::misc;

sub custom_hosts_execution_time_output {
    my ($self, %options) = @_;

    return sprintf(
        'hosts active execution time (avg/min/max): %.3f/%.3f/%.3f sec',
        $self->{result_values}->{avg_absolute},
        $self->{result_values}->{min_absolute},
        $self->{result_values}->{max_absolute}
    );
}

sub custom_services_execution_time_output {
    my ($self, %options) = @_;

    return sprintf(
        'services active execution time (avg/min/max): %.3f/%.3f/%.3f sec',
        $self->{result_values}->{avg_absolute},
        $self->{result_values}->{min_absolute},
        $self->{result_values}->{max_absolute}
    );
}

sub custom_hosts_checked_output {
    my ($self, %options) = @_;

    return sprintf(
        'hosts active checked 1/5/15/60 min: %d/%d/%d/%d',
        $self->{result_values}->{last1min_absolute},
        $self->{result_values}->{last5min_absolute},
        $self->{result_values}->{last15min_absolute},
        $self->{result_values}->{last60min_absolute},
    );
}

sub custom_services_checked_output {
    my ($self, %options) = @_;

    return sprintf(
        'services active checked 1/5/15/60 min: %d/%d/%d/%d',
        $self->{result_values}->{last1min_absolute},
        $self->{result_values}->{last5min_absolute},
        $self->{result_values}->{last15min_absolute},
        $self->{result_values}->{last60min_absolute},
    );
}

sub custom_hosts_latency_output {
    my ($self, %options) = @_;

    return sprintf(
        'hosts active latency (avg/min/max): %.3f/%.3f/%.3f sec',
        $self->{result_values}->{avg_absolute},
        $self->{result_values}->{min_absolute},
        $self->{result_values}->{max_absolute}
    );
}

sub custom_services_latency_output {
    my ($self, %options) = @_;

    return sprintf(
        'services active latency (avg/min/max): %.3f/%.3f/%.3f sec',
        $self->{result_values}->{avg_absolute},
        $self->{result_values}->{min_absolute},
        $self->{result_values}->{max_absolute}<commit_msg>enhance output<commit_after>#
# Copyright 2019 Centreon (http://www.centreon.com/)
#
# Centreon is a full-fledged industry-strength solution that meets
# the needs in IT infrastructure and application monitoring for
# service performance.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

package apps::centreon::local::mode::centenginestats;

use base qw(centreon::plugins::templates::counter);

use strict;
use warnings;
use centreon::plugins::misc;

sub custom_hosts_execution_time_output {
    my ($self, %options) = @_;

    return sprintf(
        'hosts active execution time (avg/min/max): %.3f/%.3f/%.3f sec',
        $self->{result_values}->{avg_absolute},
        $self->{result_values}->{min_absolute},
        $self->{result_values}->{max_absolute}
    );
}

sub custom_services_execution_time_output {
    my ($self, %options) = @_;

    return sprintf(
        'services active execution time (avg/min/max): %.3f/%.3f/%.3f sec',
        $self->{result_values}->{avg_absolute},
        $self->{result_values}->{min_absolute},
        $self->{result_values}->{max_absolute}
    );
}

sub custom_hosts_checked_output {
    my ($self, %options) = @_;

    return sprintf(
        'hosts active checked last 1/5/15/60 min: %d/%d/%d/%d',
        $self->{result_values}->{last1min_absolute},
        $self->{result_values}->{last5min_absolute},
        $self->{result_values}->{last15min_absolute},
        $self->{result_values}->{last60min_absolute},
    );
}

sub custom_services_checked_output {
    my ($self, %options) = @_;

    return sprintf(
        'services active checked last 1/5/15/60 min: %d/%d/%d/%d',
        $self->{result_values}->{last1min_absolute},
        $self->{result_values}->{last5min_absolute},
        $self->{result_values}->{last15min_absolute},
        $self->{result_values}->{last60min_absolute},
    );
}

sub custom_hosts_latency_output {
    my ($self, %options) = @_;

    return sprintf(
        'hosts active latency (avg/min/max): %.3f/%.3f/%.3f sec',
        $self->{result_values}->{avg_absolute},
        $self->{result_values}->{min_absolute},
        $self->{result_values}->{max_absolute}
    );
}

sub custom_services_latency_output {
    my ($self, %options) = @_;

    return sprintf(
        'services active latency (avg/min/max): %.3f/%.3f/%.3f sec',
        $self->{result_values}->{avg_absolute},
        $self->{result_values}->{min_absolute},
        $self->{result_values}->{max_absolute}
{'fraction_non_alphanumeric': 0.15087302932700458, 'fraction_numerical': 0.014917782675029667, 'mean_word_length': 3.50381679389313, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 83, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3509487', 'n_tokens_mistral': 1945, 'n_tokens_neox': 1889, 'n_words': 428}