aboutsummaryrefslogtreecommitdiffstats
path: root/storage/src/vespa/storage/distributor/visitormetricsset.cpp
blob: cbc2f0e25d3280c98f816c5976296b5ebb816dea (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#include "visitormetricsset.h"

namespace storage::distributor {

using metrics::MetricSet;

VisitorMetricSet::VisitorMetricSet(MetricSet* owner)
    : PersistenceOperationMetricSet("visitor", owner),
      buckets_per_visitor("buckets_per_visitor", {},
                          "The number of sub buckets visited as part of a "
                          "single client visitor command", this),
      docs_per_visitor("docs_per_visitor", {},
                       "The number of documents visited on content nodes as "
                       "part of a single client visitor command", this),
      bytes_per_visitor("bytes_per_visitor", {},
                        "The number of bytes visited on content nodes as part "
                        "of a single client visitor command", this)
{
}

VisitorMetricSet::~VisitorMetricSet() = default;

MetricSet *
VisitorMetricSet::clone(std::vector<Metric::UP>& ownerList, CopyType copyType,
                        MetricSet* owner, bool includeUnused) const
{
    if (copyType == INACTIVE) {
        return MetricSet::clone(ownerList, INACTIVE, owner, includeUnused);
    }
    return (VisitorMetricSet*) (new VisitorMetricSet(owner))->assignValues(*this);
}

}