aboutsummaryrefslogtreecommitdiffstats
path: root/container-core/src/main/java/com/yahoo/metrics/simple/MetricUpdater.java
blob: 69167711801d59dad9e2f170db7c2484d6ad4cba (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
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.metrics.simple;

import com.yahoo.concurrent.ThreadLocalDirectory.Updater;

/**
 * The link between each single thread and the central data store.
 *
 * @author Steinar Knutsen
 */
class MetricUpdater implements Updater<Bucket, Sample> {

    @Override
    public Bucket createGenerationInstance(Bucket previous) {
        return new Bucket();
    }

    @Override
    public Bucket update(Bucket current, Sample x) {
        current.put(x);
        return current;
    }

}