aboutsummaryrefslogtreecommitdiffstats
path: root/vespalib/src/vespa/vespalib/net/http/simple_health_producer.h
blob: b2a7725b89eb40ce14ea56da2f54015b3ed25444 (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
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#pragma once

#include "health_producer.h"
#include <mutex>

namespace vespalib {

class SimpleHealthProducer : public HealthProducer
{
private:
    mutable std::mutex _lock;
    HealthProducer::Health _health;

public:
    SimpleHealthProducer();
    ~SimpleHealthProducer() override;
    void setOk();
    void setFailed(const vespalib::string &msg);
    Health getHealth() const override;
};

} // namespace vespalib