aboutsummaryrefslogtreecommitdiffstats
path: root/storage/src/vespa/storage/distributor/update_metric_set.cpp
blob: 1edde270517b5b7357c839f944e95590177cde70 (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
36
37
// Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#include "update_metric_set.h"
#include <vespa/metrics/loadmetric.hpp>
#include <vespa/metrics/summetric.hpp>

namespace storage {

using metrics::MetricSet;

UpdateMetricSet::UpdateMetricSet(MetricSet* owner)
    : PersistenceOperationMetricSet("updates", owner),
      diverging_timestamp_updates("diverging_timestamp_updates", {},
                                  "Number of updates that report they were performed against "
                                  "divergent version timestamps on different replicas", this),
      fast_path_restarts("fast_path_restarts", {}, "Number of safe path (write repair) updates "
                         "that were restarted as fast path updates because all replicas returned "
                         "documents with the same timestamp in the initial read phase", this)
{
}

UpdateMetricSet::~UpdateMetricSet() = default;

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

}

template class metrics::LoadMetric<storage::UpdateMetricSet>;
template class metrics::SumMetric<storage::UpdateMetricSet>;