CMSDK 2.0.1
Cross-platform C++ base library and SDK for the Psyclone AIOS platform
Loading...
Searching...
No Matches
psyclone_client.stats.StatsCounters Class Reference

Public Member Functions

 __init__ (self)
 add (self, name, n=1)
 rtt (self, ms)
 error (self, e)
 snapshot (self, transport, connected, packed_active, sent, received, bad)

Public Attributes

 lock = threading.Lock()
int connects = 0
int bytes_sent = 0
int requests_sent = 0
float connected_since = 0.0
str last_error = None
float last_receive = 0.0
 server_version = None
list server_features = []
float rtt_last_ms = -1.0
int rtt_smoothed_ms = ms if self.rtt_smoothed_ms < 0 else self.rtt_smoothed_ms + (ms - self.rtt_smoothed_ms) / 8
 rtt_min_ms
 rtt_max_ms

Detailed Description

The live counters behind ConnectionStats (one set per client). Integers are updated under one lock.

Definition at line 69 of file stats.py.

Constructor & Destructor Documentation

◆ __init__()

psyclone_client.stats.StatsCounters.__init__ ( self)

Definition at line 72 of file stats.py.

Member Function Documentation

◆ add()

psyclone_client.stats.StatsCounters.add ( self,
name,
n = 1 )

Definition at line 84 of file stats.py.

References cmlabs::UnitTestRunner.lock, and lock.

◆ error()

psyclone_client.stats.StatsCounters.error ( self,
e )

Definition at line 97 of file stats.py.

References psyclone_client.stats.ConnectionStats.last_error, and last_error.

◆ rtt()

psyclone_client.stats.StatsCounters.rtt ( self,
ms )

◆ snapshot()

Member Data Documentation

◆ bytes_sent

int psyclone_client.stats.StatsCounters.bytes_sent = 0

Definition at line 75 of file stats.py.

Referenced by snapshot().

◆ connected_since

float psyclone_client.stats.StatsCounters.connected_since = 0.0

Definition at line 77 of file stats.py.

Referenced by snapshot().

◆ connects

int psyclone_client.stats.StatsCounters.connects = 0

Definition at line 74 of file stats.py.

Referenced by snapshot().

◆ last_error

str psyclone_client.stats.StatsCounters.last_error = None

Definition at line 78 of file stats.py.

Referenced by error(), and snapshot().

◆ last_receive

float psyclone_client.stats.StatsCounters.last_receive = 0.0

Definition at line 79 of file stats.py.

Referenced by snapshot().

◆ lock

psyclone_client.stats.StatsCounters.lock = threading.Lock()

Definition at line 73 of file stats.py.

Referenced by psyclone_client.transports.UdpTransport._reopen(), add(), rtt(), and snapshot().

◆ requests_sent

int psyclone_client.stats.StatsCounters.requests_sent = 0

Definition at line 76 of file stats.py.

Referenced by snapshot().

◆ rtt_last_ms

float psyclone_client.stats.StatsCounters.rtt_last_ms = -1.0

Definition at line 82 of file stats.py.

Referenced by rtt(), and snapshot().

◆ rtt_max_ms

psyclone_client.stats.StatsCounters.rtt_max_ms

Definition at line 94 of file stats.py.

Referenced by snapshot().

◆ rtt_min_ms

psyclone_client.stats.StatsCounters.rtt_min_ms

Definition at line 92 of file stats.py.

Referenced by snapshot().

◆ rtt_smoothed_ms

int psyclone_client.stats.StatsCounters.rtt_smoothed_ms = ms if self.rtt_smoothed_ms < 0 else self.rtt_smoothed_ms + (ms - self.rtt_smoothed_ms) / 8

Definition at line 91 of file stats.py.

Referenced by snapshot().

◆ server_features

list psyclone_client.stats.StatsCounters.server_features = []

Definition at line 81 of file stats.py.

Referenced by snapshot().

◆ server_version

psyclone_client.stats.StatsCounters.server_version = None

Definition at line 80 of file stats.py.

Referenced by snapshot().


The documentation for this class was generated from the following file:
  • python-client/src/psyclone_client/stats.py