<commit_before>// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#include "executor_metrics.h"

namespace proton {

void
ExecutorMetrics::update(const vespalib::ThreadStackExecutorBase::Stats &stats)
{
    maxPending.set(stats.queueSize.max());
    accepted.inc(stats.acceptedTasks);
    rejected.inc(stats.rejectedTasks);
    const vespalib::ThreadStackExecutorBase::Stats::QueueSizeT & qSize = stats.queueSize;
    queueSize.addValueBatch(qSize.average(), qSize.count(), qSize.min(), qSize.max());
}

ExecutorMetrics::ExecutorMetrics(const std::string &name, metrics::MetricSet *parent)
    : metrics::MetricSet(name, {}, "Instance specific thread executor metrics", parent),
      maxPending("maxpending", {}, "Maximum number of pending (active + queued) tasks", this),
      accepted("accepted", {}, "Number of accepted tasks", this),
      rejected("rejected", {}, "Number of rejected tasks", this),
      queueSize("queuesize", {}, "size of task queue", this)
{
}

ExecutorMetrics::~ExecutorMetrics() = default;

} // namespace proton
<commit_msg>Use auto and captitalize first word in sentence.<commit_after>// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#include "executor_metrics.h"

namespace proton {

void
ExecutorMetrics::update(const vespalib::ThreadStackExecutorBase::Stats &stats)
{
    maxPending.set(stats.queueSize.max());
    accepted.inc(stats.acceptedTasks);
    rejected.inc(stats.rejectedTasks);
    const auto & qSize = stats.queueSize;
    queueSize.addValueBatch(qSize.average(), qSize.count(), qSize.min(), qSize.max());
}

ExecutorMetrics::ExecutorMetrics(const std::string &name, metrics::MetricSet *parent)
    : metrics::MetricSet(name, {}, "Instance specific thread executor metrics", parent),
      maxPending("maxpending", {}, "Maximum number of pending (active + queued) tasks", this),
      accepted("accepted", {}, "Number of accepted tasks", this),
      rejected("rejected", {}, "Number of rejected tasks", this),
      queueSize("queuesize", {}, "Size of task queue", this)
{
}

ExecutorMetrics::~ExecutorMetrics() = default;

} // namespace proton

{'fraction_non_alphanumeric': 0.13927451858486342, 'fraction_numerical': 0.005373936408419167, 'mean_word_length': 5.222841225626741, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '3436590', 'n_tokens_mistral': 640, 'n_tokens_neox': 628, 'n_words': 171}