Seastar
High performance C++ framework for concurrent servers
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 <seastar/core/sstring.hh>
#include <seastar/core/shared_ptr.hh>
#include <seastar/core/metrics_registration.hh>
#include <boost/lexical_cast.hpp>
#include <map>
#include <seastar/core/metrics_types.hh>
#include <seastar/util/std-compat.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::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
 
struct  seastar::metrics::impl::is_callable< T, typename std::enable_if< std::is_fundamental< T >::value, std::true_type >::type >
 

Namespaces

 seastar
 Seastar API namespace.
 
 seastar::metrics
 metrics creation and registration
 
 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::impl::metric_function = std::function< metric_value()>
 

Enumerations

enum  data_type : uint8_t {
  COUNTER, GAUGE, DERIVE, ABSOLUTE,
  HISTOGRAM
}
 

Functions

instance_id_type seastar::metrics::impl::shard ()
 
template<typename T , typename = std::enable_if_t<is_callable<T>::value>>
metric_function seastar::metrics::impl::make_function (T val, data_type dt)
 
template<typename T , typename = std::enable_if_t<!is_callable<T>::value>>
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_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_total_bytes (metric_name_type name, T &&val, description d=description(), std::vector< label_instance > labels={}, instance_id_type instance=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 instance=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 instance=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 instance=impl::shard())
 create a total operation metric. More...
 

Variables

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