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

Public Member Functions

 __init__ (self, **kw)
 connected_for_ms (self)
 as_dict (self)
 __repr__ (self)
 __str__ (self)

Public Attributes

 connected_since
 connected
 connected_for_ms
 connects
 disconnects
 connect_failures
 dead_link_drops
 server_version
 messages_sent
 bytes_sent
 messages_received
 bytes_received
 send_failures
 bad_messages
 requests_sent
 request_timeouts
 keepalives_answered
 keepalives_sent
 rtt_last_ms
 rtt_smoothed_ms
 last_error

Static Public Attributes

tuple FIELDS

Detailed Description

A snapshot of one client's connection, from ``PsycloneClient.stats()``. Take a new one to see changes.

Counters run from when the client was created; the ``connected*`` fields describe the current
connection (stream transports) or the current link (UDP, judged by keepalive replies).

transport: "udp", "tcp", "tls", "ws" or "wss". connected: same as ``PsycloneClient.connected``.
connected_since: epoch seconds when the current connection (or UDP link) came up, 0 while down.
connects / disconnects: times a connection came up / went down. connect_failures: attempts that failed
before the connection came up. dead_link_drops: connections dropped by the client because keepalive
replies stopped. last_error: the last transport error ("Class: message") or None. packed_active: messages
go out packed. server_version: the service's PsyVersion from its last keepalive reply (None: an older
Psyclone, or none yet). server_features: its PsyFeatures (a list; empty before Psyclone 2.3.2).
messages_sent / messages_received, bytes_sent / bytes_received (wire bytes without WebSocket/UDP
framing), send_failures (``post()`` found the pipe down), bad_messages (could not be decoded),
requests_sent, request_timeouts, keepalives_sent, keepalives_answered, rtt_last_ms / rtt_smoothed_ms
(RFC 6298 style, 1/8 gain) / rtt_min_ms / rtt_max_ms (-1 when none answered), last_receive_age_ms
(-1 if nothing has been received).

Definition at line 6 of file stats.py.

Constructor & Destructor Documentation

◆ __init__()

psyclone_client.stats.ConnectionStats.__init__ ( self,
** kw )

Member Function Documentation

◆ __repr__()

psyclone_client.stats.ConnectionStats.__repr__ ( self)

Definition at line 45 of file stats.py.

◆ __str__()

psyclone_client.stats.ConnectionStats.__str__ ( self)

◆ as_dict()

psyclone_client.stats.ConnectionStats.as_dict ( self)

◆ connected_for_ms()

psyclone_client.stats.ConnectionStats.connected_for_ms ( self)
Milliseconds the current connection has been up, or 0 while down.

Definition at line 38 of file stats.py.

Member Data Documentation

◆ bad_messages

psyclone_client.stats.ConnectionStats.bad_messages

Definition at line 59 of file stats.py.

◆ bytes_received

psyclone_client.stats.ConnectionStats.bytes_received

Definition at line 58 of file stats.py.

Referenced by psyclone_client.stats.StatsCounters.snapshot().

◆ bytes_sent

psyclone_client.stats.ConnectionStats.bytes_sent

Definition at line 57 of file stats.py.

Referenced by psyclone_client.stats.StatsCounters.snapshot().

◆ connect_failures

psyclone_client.stats.ConnectionStats.connect_failures

Definition at line 52 of file stats.py.

Referenced by psyclone_client.stats.StatsCounters.snapshot().

◆ connected

psyclone_client.stats.ConnectionStats.connected

Definition at line 50 of file stats.py.

Referenced by __str__().

◆ connected_for_ms

psyclone_client.stats.ConnectionStats.connected_for_ms

Definition at line 51 of file stats.py.

◆ connected_since

psyclone_client.stats.ConnectionStats.connected_since

Definition at line 40 of file stats.py.

Referenced by psyclone_client.stats.StatsCounters.snapshot().

◆ connects

psyclone_client.stats.ConnectionStats.connects

Definition at line 52 of file stats.py.

Referenced by psyclone_client.stats.StatsCounters.snapshot().

◆ dead_link_drops

psyclone_client.stats.ConnectionStats.dead_link_drops

Definition at line 53 of file stats.py.

Referenced by psyclone_client.stats.StatsCounters.snapshot().

◆ disconnects

psyclone_client.stats.ConnectionStats.disconnects

Definition at line 52 of file stats.py.

Referenced by psyclone_client.stats.StatsCounters.snapshot().

◆ FIELDS

tuple psyclone_client.stats.ConnectionStats.FIELDS
static
Initial value:
= ("transport", "connected", "connected_since", "connects", "disconnects", "connect_failures",
"dead_link_drops", "last_error", "packed_active", "server_version", "server_features",
"messages_sent", "messages_received", "bytes_sent", "bytes_received", "send_failures",
"bad_messages", "requests_sent", "request_timeouts", "keepalives_sent", "keepalives_answered",
"rtt_last_ms", "rtt_smoothed_ms", "rtt_min_ms", "rtt_max_ms", "last_receive_age_ms")

Definition at line 26 of file stats.py.

Referenced by __init__(), and as_dict().

◆ keepalives_answered

psyclone_client.stats.ConnectionStats.keepalives_answered

Definition at line 61 of file stats.py.

Referenced by psyclone_client.stats.StatsCounters.snapshot().

◆ keepalives_sent

psyclone_client.stats.ConnectionStats.keepalives_sent

Definition at line 61 of file stats.py.

Referenced by psyclone_client.stats.StatsCounters.snapshot().

◆ last_error

psyclone_client.stats.ConnectionStats.last_error

◆ messages_received

psyclone_client.stats.ConnectionStats.messages_received

Definition at line 57 of file stats.py.

◆ messages_sent

psyclone_client.stats.ConnectionStats.messages_sent

Definition at line 57 of file stats.py.

◆ request_timeouts

psyclone_client.stats.ConnectionStats.request_timeouts

Definition at line 60 of file stats.py.

Referenced by psyclone_client.stats.StatsCounters.snapshot().

◆ requests_sent

psyclone_client.stats.ConnectionStats.requests_sent

Definition at line 60 of file stats.py.

Referenced by psyclone_client.stats.StatsCounters.snapshot().

◆ rtt_last_ms

psyclone_client.stats.ConnectionStats.rtt_last_ms

◆ rtt_smoothed_ms

psyclone_client.stats.ConnectionStats.rtt_smoothed_ms

Definition at line 63 of file stats.py.

Referenced by psyclone_client.stats.StatsCounters.snapshot().

◆ send_failures

psyclone_client.stats.ConnectionStats.send_failures

Definition at line 59 of file stats.py.

Referenced by psyclone_client.stats.StatsCounters.snapshot().

◆ server_version

psyclone_client.stats.ConnectionStats.server_version

Definition at line 56 of file stats.py.

Referenced by psyclone_client.stats.StatsCounters.snapshot().


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