aboutsummaryrefslogtreecommitdiffstats
path: root/storage/src/vespa/storage/distributor/update_metric_set.cpp
blob: 9c92e15ba0e56ca47d779ccbe6b71784267ed25a (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
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#include "update_metric_set.h"

namespace storage::distributor {

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));
}

}