userver: userver/utils/statistics/storage.hpp File Reference
Loading...
Searching...
No Matches
storage.hpp File Reference

Detailed Description

Definition in file storage.hpp.

Go to the source code of this file.

#include <atomic>
#include <functional>
#include <list>
#include <string>
#include <vector>
#include <userver/engine/shared_mutex.hpp>
#include <userver/formats/json/value_builder.hpp>
#include <userver/utils/assert.hpp>
#include <userver/utils/statistics/entry.hpp>
#include <userver/utils/statistics/request.hpp>
#include <userver/utils/statistics/writer.hpp>
+ This graph shows which files directly or indirectly include this file:

Classes

struct  utils::statistics::StatisticsRequest
 Used in legacy statistics extenders. More...
 
class  utils::statistics::Storage
 

Namespaces

namespace  utils
 Utilities.
 

Typedefs

using utils::statistics::ExtenderFunc = std::function<formats::json::ValueBuilder(const StatisticsRequest&)>
 
using utils::statistics::WriterFunc = std::function<void(Writer&)>
 

Functions

void utils::statistics::RegisterWriterScope (ResourceScopeStorage &scope_storage, Storage &storage, std::string common_prefix, WriterFunc func, std::vector< Label > add_labels={})
 Add a writer function to Storage (usually obtained from components::StatisticsStorage). It automatically calls utils::statistics::Storage::RegisterWriter() just after the component construction and utils::statistics::Entry::Unregister() just before the component destructor.
 

Typedef Documentation

◆ ExtenderFunc

using utils::statistics::ExtenderFunc = std::function<formats::json::ValueBuilder(const StatisticsRequest&)>

Definition at line 30 of file storage.hpp.

◆ WriterFunc

using utils::statistics::WriterFunc = std::function<void(Writer&)>

Definition at line 32 of file storage.hpp.

Function Documentation

◆ RegisterWriterScope()

void utils::statistics::RegisterWriterScope ( ResourceScopeStorage & scope_storage,
Storage & storage,
std::string common_prefix,
WriterFunc func,
std::vector< Label > add_labels = {} )

Add a writer function to Storage (usually obtained from components::StatisticsStorage). It automatically calls utils::statistics::Storage::RegisterWriter() just after the component construction and utils::statistics::Entry::Unregister() just before the component destructor.

See also
Storage::RegisterWriter.