Seastar
High performance C++ framework for concurrent servers
Public Member Functions | List of all members
seastar::scheduling_group Class Reference

Detailed Description

Identifies function calls that are accounted as a group.

A scheduling_group is a tag that can be used to mark a function call. Executions of such tagged calls are accounted as a group.

#include <seastar/core/scheduling.hh>

Public Member Functions

constexpr scheduling_group () noexcept
 Creates a scheduling_group object denoting the default group.
 
bool active () const noexcept
 
const sstring & name () const noexcept
 
const sstring & short_name () const noexcept
 
bool operator== (scheduling_group x) const noexcept
 
bool operator!= (scheduling_group x) const noexcept
 
bool is_main () const noexcept
 
bool is_at_exit () const noexcept
 
template<typename T >
T & get_specific (scheduling_group_key key) noexcept
 
void set_shares (float shares) noexcept
 
float get_shares () const noexcept
 
future update_io_bandwidth (uint64_t bandwidth) const
 Updates the current IO bandwidth for a given scheduling group. More...
 

Member Function Documentation

◆ get_shares()

float seastar::scheduling_group::get_shares ( ) const
noexcept

Returns the number of shares the group has

Similarly to the set_shares, the returned value is only relevant to the calling shard

◆ get_specific()

template<typename T >
T& seastar::scheduling_group::get_specific ( scheduling_group_key  key)
inlinenoexcept

Returnes a reference to this scheduling group specific value

Template Parameters
T- the type of the scheduling specific type (cannot be deduced)
Parameters
key- the key of the value to retrieve.
Returns
A reference to this scheduling specific value.

◆ set_shares()

void seastar::scheduling_group::set_shares ( float  shares)
noexcept

Adjusts the number of shares allotted to the group.

Dynamically adjust the number of shares allotted to the group, increasing or decreasing the amount of CPU bandwidth it gets. The adjustment is local to the shard.

This can be used to reduce a background job's interference with a foreground load: the shares can be started at a low value, increased when the background job's backlog increases, and reduced again when the backlog decreases.

Parameters
sharesnumber of shares allotted to the group. Use numbers in the 1-1000 range.

◆ update_io_bandwidth()

future seastar::scheduling_group::update_io_bandwidth ( uint64_t  bandwidth) const

Updates the current IO bandwidth for a given scheduling group.

The bandwidth applied is NOT shard-local, instead it is applied so that all shards cannot consume more bytes-per-second altogether

Parameters
bandwidththe new bandwidth value in bytes/second
Returns
a future that is ready when the bandwidth update is applied

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