aboutsummaryrefslogtreecommitdiffstats
path: root/slobrok/src/vespa/slobrok/backoff.h
blob: 32a23c78776a625e5d97989b4c570e5bb033b8a4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once

#include <cstdio>

namespace slobrok::api {

class BackOff
{
private:
    double _time;
    double _since_last_warn;
    size_t _nextwarn_idx;

public:
    BackOff();
    void reset();
    double get();
    bool shouldWarn();
};

}