rippled
Public Member Functions | Private Member Functions | Private Attributes | List of all members
ripple::PeerFinder::Counts Class Reference

Manages the count of available connections for the various slots. More...

Collaboration diagram for ripple::PeerFinder::Counts:
Collaboration graph
[legend]

Public Member Functions

 Counts ()
 
void add (Slot const &s)
 Adds the slot state and properties to the slot counts. More...
 
void remove (Slot const &s)
 Removes the slot state and properties from the slot counts. More...
 
bool can_activate (Slot const &s) const
 Returns true if the slot can become active. More...
 
std::size_t attempts_needed () const
 Returns the number of attempts needed to bring us to the max. More...
 
std::size_t attempts () const
 Returns the number of outbound connection attempts. More...
 
int out_max () const
 Returns the total number of outbound slots. More...
 
int out_active () const
 Returns the number of outbound peers assigned an open slot. More...
 
std::size_t fixed () const
 Returns the number of fixed connections. More...
 
std::size_t fixed_active () const
 Returns the number of active fixed connections. More...
 
void onConfig (Config const &config)
 Called when the config is set or changed. More...
 
int acceptCount () const
 Returns the number of accepted connections that haven't handshaked. More...
 
int connectCount () const
 Returns the number of connection attempts currently active. More...
 
int closingCount () const
 Returns the number of connections that are gracefully closing. More...
 
int inboundSlots () const
 Returns the total number of inbound slots. More...
 
int inboundActive () const
 Returns the number of inbound peers assigned an open slot. More...
 
int totalActive () const
 Returns the total number of active peers excluding fixed peers. More...
 
int inboundSlotsFree () const
 Returns the number of unused inbound slots. More...
 
int outboundSlotsFree () const
 Returns the number of unused outbound slots. More...
 
bool isConnectedToNetwork () const
 Returns true if the slot logic considers us "connected" to the network. More...
 
void onWrite (beast::PropertyStream::Map &map)
 Output statistics. More...
 
std::string state_string () const
 Records the state for diagnostics. More...
 

Private Member Functions

void adjust (Slot const &s, int const n)
 

Private Attributes

int m_attempts
 Outbound connection attempts. More...
 
std::size_t m_active
 Active connections, including fixed and reserved. More...
 
std::size_t m_in_max
 Total number of inbound slots. More...
 
std::size_t m_in_active
 Number of inbound slots assigned to active peers. More...
 
std::size_t m_out_max
 Maximum desired outbound slots. More...
 
std::size_t m_out_active
 Active outbound slots. More...
 
std::size_t m_fixed
 Fixed connections. More...
 
std::size_t m_fixed_active
 Active fixed connections. More...
 
std::size_t m_reserved
 Reserved connections. More...
 
int m_acceptCount
 
int m_closingCount
 

Detailed Description

Manages the count of available connections for the various slots.

Definition at line 34 of file Counts.h.

Constructor & Destructor Documentation

◆ Counts()

ripple::PeerFinder::Counts::Counts ( )

Definition at line 37 of file Counts.h.

Member Function Documentation

◆ add()

void ripple::PeerFinder::Counts::add ( Slot const &  s)

Adds the slot state and properties to the slot counts.

Definition at line 57 of file Counts.h.

◆ remove()

void ripple::PeerFinder::Counts::remove ( Slot const &  s)

Removes the slot state and properties from the slot counts.

Definition at line 64 of file Counts.h.

◆ can_activate()

bool ripple::PeerFinder::Counts::can_activate ( Slot const &  s) const

Returns true if the slot can become active.

Definition at line 71 of file Counts.h.

◆ attempts_needed()

std::size_t ripple::PeerFinder::Counts::attempts_needed ( ) const

Returns the number of attempts needed to bring us to the max.

Definition at line 87 of file Counts.h.

◆ attempts()

std::size_t ripple::PeerFinder::Counts::attempts ( ) const

Returns the number of outbound connection attempts.

Definition at line 96 of file Counts.h.

◆ out_max()

int ripple::PeerFinder::Counts::out_max ( ) const

Returns the total number of outbound slots.

Definition at line 103 of file Counts.h.

◆ out_active()

int ripple::PeerFinder::Counts::out_active ( ) const

Returns the number of outbound peers assigned an open slot.

Fixed peers do not count towards outbound slots used.

Definition at line 112 of file Counts.h.

◆ fixed()

std::size_t ripple::PeerFinder::Counts::fixed ( ) const

Returns the number of fixed connections.

Definition at line 119 of file Counts.h.

◆ fixed_active()

std::size_t ripple::PeerFinder::Counts::fixed_active ( ) const

Returns the number of active fixed connections.

Definition at line 126 of file Counts.h.

◆ onConfig()

void ripple::PeerFinder::Counts::onConfig ( Config const &  config)

Called when the config is set or changed.

Definition at line 135 of file Counts.h.

◆ acceptCount()

int ripple::PeerFinder::Counts::acceptCount ( ) const

Returns the number of accepted connections that haven't handshaked.

Definition at line 144 of file Counts.h.

◆ connectCount()

int ripple::PeerFinder::Counts::connectCount ( ) const

Returns the number of connection attempts currently active.

Definition at line 151 of file Counts.h.

◆ closingCount()

int ripple::PeerFinder::Counts::closingCount ( ) const

Returns the number of connections that are gracefully closing.

Definition at line 158 of file Counts.h.

◆ inboundSlots()

int ripple::PeerFinder::Counts::inboundSlots ( ) const

Returns the total number of inbound slots.

Definition at line 165 of file Counts.h.

◆ inboundActive()

int ripple::PeerFinder::Counts::inboundActive ( ) const

Returns the number of inbound peers assigned an open slot.

Definition at line 172 of file Counts.h.

◆ totalActive()

int ripple::PeerFinder::Counts::totalActive ( ) const

Returns the total number of active peers excluding fixed peers.

Definition at line 179 of file Counts.h.

◆ inboundSlotsFree()

int ripple::PeerFinder::Counts::inboundSlotsFree ( ) const

Returns the number of unused inbound slots.

Fixed peers do not deduct from inbound slots or count towards totals.

Definition at line 188 of file Counts.h.

◆ outboundSlotsFree()

int ripple::PeerFinder::Counts::outboundSlotsFree ( ) const

Returns the number of unused outbound slots.

Fixed peers do not deduct from outbound slots or count towards totals.

Definition at line 199 of file Counts.h.

◆ isConnectedToNetwork()

bool ripple::PeerFinder::Counts::isConnectedToNetwork ( ) const

Returns true if the slot logic considers us "connected" to the network.

Definition at line 211 of file Counts.h.

◆ onWrite()

void ripple::PeerFinder::Counts::onWrite ( beast::PropertyStream::Map map)

Output statistics.

Definition at line 227 of file Counts.h.

◆ state_string()

std::string ripple::PeerFinder::Counts::state_string ( ) const

Records the state for diagnostics.

Definition at line 241 of file Counts.h.

◆ adjust()

void ripple::PeerFinder::Counts::adjust ( Slot const &  s,
int const  n 
)
private

Definition at line 254 of file Counts.h.

Member Data Documentation

◆ m_attempts

int ripple::PeerFinder::Counts::m_attempts
private

Outbound connection attempts.

Definition at line 300 of file Counts.h.

◆ m_active

std::size_t ripple::PeerFinder::Counts::m_active
private

Active connections, including fixed and reserved.

Definition at line 303 of file Counts.h.

◆ m_in_max

std::size_t ripple::PeerFinder::Counts::m_in_max
private

Total number of inbound slots.

Definition at line 306 of file Counts.h.

◆ m_in_active

std::size_t ripple::PeerFinder::Counts::m_in_active
private

Number of inbound slots assigned to active peers.

Definition at line 309 of file Counts.h.

◆ m_out_max

std::size_t ripple::PeerFinder::Counts::m_out_max
private

Maximum desired outbound slots.

Definition at line 312 of file Counts.h.

◆ m_out_active

std::size_t ripple::PeerFinder::Counts::m_out_active
private

Active outbound slots.

Definition at line 315 of file Counts.h.

◆ m_fixed

std::size_t ripple::PeerFinder::Counts::m_fixed
private

Fixed connections.

Definition at line 318 of file Counts.h.

◆ m_fixed_active

std::size_t ripple::PeerFinder::Counts::m_fixed_active
private

Active fixed connections.

Definition at line 321 of file Counts.h.

◆ m_reserved

std::size_t ripple::PeerFinder::Counts::m_reserved
private

Reserved connections.

Definition at line 324 of file Counts.h.

◆ m_acceptCount

int ripple::PeerFinder::Counts::m_acceptCount
private

Definition at line 328 of file Counts.h.

◆ m_closingCount

int ripple::PeerFinder::Counts::m_closingCount
private

Definition at line 331 of file Counts.h.