/
githubmirror
/
nbs
Обзор
Документация
Войти
/
githubmirror
/
nbs
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
library/cpp/monlib/metrics/log_histogram_snapshot.cpp
35 строк
780 B
qkrorlqr
Initial NBS OpenSource export
28 апр 2023, 21:54
28 апр 2023, 21:54
783a858
Код
Авторство
О чём код?
#include "log_histogram_snapshot.h" #include <util/stream/output.h> #include <iostream> namespace { template <typename TStream> auto& Output(TStream& o, const NMonitoring::TLogHistogramSnapshot& hist) { o << TStringBuf("{"); for (auto i = 0u; i < hist.Count(); ++i) { o << hist.UpperBound(i) << TStringBuf(": ") << hist.Bucket(i); o << TStringBuf(", "); } o << TStringBuf("zeros: ") << hist.ZerosCount(); o << TStringBuf("}"); return o; } } // namespace std::ostream& operator<<(std::ostream& os, const NMonitoring::TLogHistogramSnapshot& hist) { return Output(os, hist); } template <> void Out<NMonitoring::TLogHistogramSnapshot>(IOutputStream& os, const NMonitoring::TLogHistogramSnapshot& hist) { Output(os, hist); }