userver: utils::statistics::Storage Class Reference
⚠️ This is the documentation for an old userver version. Click here to switch to the latest version.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
utils::statistics::Storage Class Referencefinal

#include <userver/utils/statistics/storage.hpp>

Detailed Description

Storage of metrics, usually retrieved from components::StatisticsStorage.

See utils::statistics::Writer for an information on how to write metrics.

Definition at line 120 of file storage.hpp.

Public Member Functions

 Storage (const Storage &)=delete
 
formats::json::Value GetAsJson () const
 
void VisitMetrics (BaseFormatBuilder &out, const Request &request={}) const
 Visits all the metrics and calls out.HandleMetric for each metric.
 
Entry RegisterWriter (std::string common_prefix, WriterFunc func, std::vector< Label > add_labels={})
 Add a writer function. Note that func is called concurrently with other code, so it should be thread\coroutine safe.
 
Entry RegisterExtender (std::string prefix, ExtenderFunc func)
 
void UnregisterExtender (impl::StorageIterator iterator, impl::UnregisteringKind kind) noexcept
 

Member Function Documentation

◆ GetAsJson()

formats::json::Value utils::statistics::Storage::GetAsJson ( ) const

Creates new Json::Value and calls every deprecated registered extender func over it.

Deprecated
Use VisitMetrics instead.

◆ RegisterExtender()

Entry utils::statistics::Storage::RegisterExtender ( std::string prefix,
ExtenderFunc func )
Deprecated
Use RegisterWriter instead.

The documentation for this class was generated from the following file: