Seastar
High performance C++ framework for concurrent servers
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
Classes | Namespaces | Typedefs | Enumerations | Functions | Variables
metrics.hh File Reference

Detailed Description

header for metrics creation.

This header file contains the metrics creation method with their helper function. Include this file when need to create metrics. Typically this will be in your source file.

Code that is under the impl namespace should not be used directly.

#include <functional>
#include <limits>
#include <map>
#include <type_traits>
#include <variant>
#include <fmt/format.h>
#include <seastar/core/sstring.hh>
#include <seastar/core/shared_ptr.hh>
#include <seastar/core/metrics_registration.hh>
#include <seastar/core/metrics_types.hh>
#include <seastar/util/std-compat.hh>
#include <seastar/util/bool_class.hh>
#include <seastar/util/modules.hh>

Go to the source code of this file.

Classes

class  seastar::metrics::double_registration
 
class  seastar::metrics::description
 Human-readable description of a metric/group. More...
 
class  seastar::metrics::label_instance
 Label a metrics. More...
 
class  seastar::metrics::label
 Class that creates label instances. More...
 
struct  seastar::metrics::impl::real_counter_type_traits< callable, T >
 
struct  seastar::metrics::impl::real_counter_type_traits< true, T >
 
struct  seastar::metrics::impl::counter_type_traits< T >
 
class  seastar::metrics::impl::metric_value
 A helper class that used to return metrics value. More...
 
struct  seastar::metrics::impl::metric_type
 
struct  seastar::metrics::impl::metric_definition_impl
 
class  seastar::metrics::impl::metric_groups_def
 

Namespaces

namespace  seastar
 Seastar API namespace.
 
namespace  seastar::metrics
 metrics creation and registration
 
namespace  impl
 holds the implementation parts of the metrics layer, do not use directly.
 

Typedefs

using seastar::metrics::metric_type_def = sstring
 
using seastar::metrics::metric_name_type = sstring
 
using seastar::metrics::instance_id_type = sstring
 
using seastar::metrics::skip_when_empty = bool_class< class skip_when_empty_tag >
 
using seastar::metrics::impl::metric_function = std::function< metric_value()>
 

Enumerations

enum class  data_type : uint8_t {
  COUNTER , REAL_COUNTER , GAUGE , HISTOGRAM ,
  SUMMARY
}
 

Functions

instance_id_type seastar::metrics::impl::shard ()
 
template<typename T , typename = std::enable_if_t<std::is_invocable_v<T>>>
metric_function seastar::metrics::impl::make_function (T val, data_type dt)
 
template<typename T , typename = std::enable_if_t<!std::is_invocable_v<T>>>
metric_function seastar::metrics::impl::make_function (T &val, data_type dt)
 
template<typename T >
impl::metric_definition_impl seastar::metrics::make_gauge (metric_name_type name, T &&val, description d=description(), std::vector< label_instance > labels={})
 Gauge are a general purpose metric. More...
 
template<typename T >
impl::metric_definition_impl seastar::metrics::make_gauge (metric_name_type name, description d, T &&val)
 Gauge are a general purpose metric. More...
 
template<typename T >
impl::metric_definition_impl seastar::metrics::make_gauge (metric_name_type name, description d, std::vector< label_instance > labels, T &&val)
 Gauge are a general purpose metric. More...
 
template<typename T >
impl::metric_definition_impl seastar::metrics::make_derive (metric_name_type name, T &&val, description d=description(), std::vector< label_instance > labels={})
 Derive are used when a rate is more interesting than the value. More...
 
template<typename T >
impl::metric_definition_impl seastar::metrics::make_derive (metric_name_type name, description d, T &&val)
 Derive are used when a rate is more interesting than the value. More...
 
template<typename T >
impl::metric_definition_impl seastar::metrics::make_derive (metric_name_type name, description d, std::vector< label_instance > labels, T &&val)
 Derive are used when a rate is more interesting than the value. More...
 
template<typename T >
impl::metric_definition_impl seastar::metrics::make_counter (metric_name_type name, T &&val, description d=description(), std::vector< label_instance > labels={})
 create a counter metric More...
 
template<typename T >
impl::metric_definition_impl seastar::metrics::make_counter (metric_name_type name, description d, T &&val)
 create a counter metric More...
 
template<typename T >
impl::metric_definition_impl seastar::metrics::make_counter (metric_name_type name, description d, std::vector< label_instance > labels, T &&val)
 create a counter metric More...
 
template<typename T >
impl::metric_definition_impl seastar::metrics::make_absolute (metric_name_type name, T &&val, description d=description(), std::vector< label_instance > labels={})
 create an absolute metric. More...
 
template<typename T >
impl::metric_definition_impl seastar::metrics::make_histogram (metric_name_type name, T &&val, description d=description(), std::vector< label_instance > labels={})
 create a histogram metric. More...
 
template<typename T >
impl::metric_definition_impl seastar::metrics::make_histogram (metric_name_type name, description d, std::vector< label_instance > labels, T &&val)
 create a histogram metric. More...
 
template<typename T >
impl::metric_definition_impl seastar::metrics::make_histogram (metric_name_type name, description d, T &&val)
 create a histogram metric. More...
 
template<typename T >
impl::metric_definition_impl seastar::metrics::make_summary (metric_name_type name, description d, T &&val)
 create a summary metric. More...
 
template<typename T >
impl::metric_definition_impl seastar::metrics::make_total_bytes (metric_name_type name, T &&val, description d=description(), std::vector< label_instance > labels={}, instance_id_type=impl::shard())
 create a total_bytes metric. More...
 
template<typename T >
impl::metric_definition_impl seastar::metrics::make_current_bytes (metric_name_type name, T &&val, description d=description(), std::vector< label_instance > labels={}, instance_id_type=impl::shard())
 create a current_bytes metric. More...
 
template<typename T >
impl::metric_definition_impl seastar::metrics::make_queue_length (metric_name_type name, T &&val, description d=description(), std::vector< label_instance > labels={}, instance_id_type=impl::shard())
 create a queue_length metric. More...
 
template<typename T >
impl::metric_definition_impl seastar::metrics::make_total_operations (metric_name_type name, T &&val, description d=description(), std::vector< label_instance > labels={}, instance_id_type=impl::shard())
 create a total operation metric. More...
 

Variables

const bool seastar::metrics::metric_disabled
 
label seastar::metrics::shard_label