Seastar
High performance C++ framework for concurrent servers

describes a request that passes through the fair_queue.
A ticket is specified by a weight
and a size
. For example, one can specify a request of weight
1 and size
16kB. If the fair_queue accepts one such request per second, it will sustain 1 IOPS at 16kB/s bandwidth.
#include <seastar/core/fair_queue.hh>
Public Member Functions  
fair_queue_ticket (uint32_t weight, uint32_t size)  
fair_queue_ticket  operator+ (fair_queue_ticket desc) const 
fair_queue_ticket  operator (fair_queue_ticket desc) const 
fair_queue_ticket &  operator+= (fair_queue_ticket desc) 
fair_queue_ticket &  operator= (fair_queue_ticket desc) 
bool  strictly_less (fair_queue_ticket rhs) const 
operator bool () const  
float  normalize (fair_queue_ticket axis) const 
seastar::fair_queue_ticket::fair_queue_ticket  (  uint32_t  weight, 
uint32_t  size  
) 
Constructs a fair_queue_ticket with a given weight
and a given size
weight  the weight of the request 
size  the size of the request 
float seastar::fair_queue_ticket::normalize  (  fair_queue_ticket  axis  )  const 
The normalization function itself is an implementation detail, but one can expect either weight or size to have more or less relative importance depending on which of the dimensions in the denominator is relatively higher. For example, given this request a, and two other requests b and c, such that that c has the same weight
but a higher size
than b, one can expect the size
component of this request to play a larger role.
It is legal for the numerator to have one of the quantities set to zero, in which case only the other quantity is taken into consideration.
It is however not legal for the axis to have any quantity set to zero.
axis  another fair_queue_ticket to be used as a a base vector against which to normalize this fair_queue_ticket. 

explicit 
For a fair_queue ticket to be nonzero, at least one of its represented quantities need to be nonzero
fair_queue_ticket& seastar::fair_queue_ticket::operator+=  (  fair_queue_ticket  desc  ) 
Increase the quantity represented in this ticket by the amount represented by desc
desc  another fair_queue_ticket whose weight and size will be added to this one 
fair_queue_ticket& seastar::fair_queue_ticket::operator=  (  fair_queue_ticket  desc  ) 
Decreases the quantity represented in this ticket by the amount represented by desc
desc  another fair_queue_ticket whose weight and size will be decremented from this one 
bool seastar::fair_queue_ticket::strictly_less  (  fair_queue_ticket  rhs  )  const 
rhs
.For a fair_queue_ticket to be considered strictly less than another, both its quantities need to be less than the other. Note that there is no total ordering between two fair_queue_tickets
rhs  another fair_queue_ticket to be compared to this one. 