2019-06-15 14:48:48 +00:00
|
|
|
#ifndef LLARP_METRICS_STREAM_PUBLISHER_HPP
|
|
|
|
#define LLARP_METRICS_STREAM_PUBLISHER_HPP
|
|
|
|
|
2019-09-01 12:58:27 +00:00
|
|
|
#include <util/metrics/core.hpp>
|
2019-06-15 14:48:48 +00:00
|
|
|
|
|
|
|
#include <iosfwd>
|
|
|
|
|
|
|
|
namespace llarp
|
|
|
|
{
|
|
|
|
namespace metrics
|
|
|
|
{
|
|
|
|
class StreamPublisher final : public Publisher
|
|
|
|
{
|
|
|
|
std::ostream& m_stream;
|
|
|
|
|
|
|
|
public:
|
|
|
|
StreamPublisher(std::ostream& stream) : m_stream(stream)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2019-07-30 23:42:13 +00:00
|
|
|
~StreamPublisher() override = default;
|
2019-06-15 14:48:48 +00:00
|
|
|
|
|
|
|
void
|
|
|
|
publish(const Sample& values) override;
|
|
|
|
};
|
|
|
|
} // namespace metrics
|
|
|
|
|
|
|
|
} // namespace llarp
|
|
|
|
|
|
|
|
#endif
|