Skip to content

Commit

Permalink
Delete a bunch of transmit and receive speed distribution stats stuff.
Browse files Browse the repository at this point in the history
It is unused, and when I actually do hook something up, I think I will
rework it.

I decided to comment it out instad of delete it, because it will make it
easier to find all the places in the code I need to touch again.

P4:8762717
  • Loading branch information
zpostfacto committed Mar 13, 2024
1 parent d3319dd commit 2751115
Show file tree
Hide file tree
Showing 5 changed files with 330 additions and 331 deletions.
85 changes: 42 additions & 43 deletions src/common/steamnetworkingsockets_messages.proto
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,7 @@ message CMsgSteamDatagramLinkLifetimeStats
optional uint32 quality_ntile_25th = 32; // 25% of measurement intervals had quality <= N%
optional uint32 quality_ntile_50th = 33; // 50% of measurement intervals had quality <= N%

/// Distribution of ping times. Basically we make sure we take a ping measurement
/// at a minimum interval, and then we build a distribution of all the samples.
/// Note that we don't take great care to ensure that the samples are taken
/// perfectly evenly, but they should be reasonably even.
/// Distribution of ping times.
optional uint32 ping_histogram_25 = 41; // 0..25
optional uint32 ping_histogram_50 = 42; // 26..50
optional uint32 ping_histogram_75 = 43; // 51..75
Expand All @@ -152,45 +149,47 @@ message CMsgSteamDatagramLinkLifetimeStats
optional uint32 jitter_histogram_10 = 65; // 10..20
optional uint32 jitter_histogram_20 = 66; // 20+

/// Transmit speed
optional uint32 txspeed_max = 67;

optional uint32 txspeed_histogram_16 = 68; // speed at kb/s
optional uint32 txspeed_histogram_32 = 69;
optional uint32 txspeed_histogram_64 = 70;
optional uint32 txspeed_histogram_128 = 71;
optional uint32 txspeed_histogram_256 = 72;
optional uint32 txspeed_histogram_512 = 73;
optional uint32 txspeed_histogram_1024 = 74;
optional uint32 txspeed_histogram_max = 75;

// distribution. some might be -1, see above for why.
optional uint32 txspeed_ntile_5th = 76; // 5% of transmit samples were <= n kb/s
optional uint32 txspeed_ntile_50th = 77; // 50% of transmit samples were <= n kb/s
optional uint32 txspeed_ntile_75th = 78; // 70% of transmit samples were <= n kb/s
optional uint32 txspeed_ntile_95th = 79; // 95% of transmit samples were <= n kb/s
optional uint32 txspeed_ntile_98th = 80; // 98% of transmit samples were <= n kb/s

//
// Receive speed
//
optional uint32 rxspeed_max = 81; // max speed we hit that formed the histogram

optional uint32 rxspeed_histogram_16 = 82; // speed at kb/s
optional uint32 rxspeed_histogram_32 = 83;
optional uint32 rxspeed_histogram_64 = 84;
optional uint32 rxspeed_histogram_128 = 85;
optional uint32 rxspeed_histogram_256 = 86;
optional uint32 rxspeed_histogram_512 = 87;
optional uint32 rxspeed_histogram_1024 = 88;
optional uint32 rxspeed_histogram_max = 89;

// distribution. some might be -1, see above for why.
optional uint32 rxspeed_ntile_5th = 90; // 5% of transmit samples were <= n kb/s
optional uint32 rxspeed_ntile_50th = 91; // 50% of transmit samples were <= n kb/s
optional uint32 rxspeed_ntile_75th = 92; // 70% of transmit samples were <= n kb/s
optional uint32 rxspeed_ntile_95th = 93; // 95% of transmit samples were <= n kb/s
optional uint32 rxspeed_ntile_98th = 94; // 98% of transmit samples were <= n kb/s
// //
// // Transmit speed
// //
// optional uint32 txspeed_max = 67;
//
// optional uint32 txspeed_histogram_16 = 68; // speed at kb/s
// optional uint32 txspeed_histogram_32 = 69;
// optional uint32 txspeed_histogram_64 = 70;
// optional uint32 txspeed_histogram_128 = 71;
// optional uint32 txspeed_histogram_256 = 72;
// optional uint32 txspeed_histogram_512 = 73;
// optional uint32 txspeed_histogram_1024 = 74;
// optional uint32 txspeed_histogram_max = 75;
//
// // distribution. some might be missing if we don't have enough sampels to make an estimate
// optional uint32 txspeed_ntile_5th = 76; // 5% of transmit samples were <= n kb/s
// optional uint32 txspeed_ntile_50th = 77; // 50% of transmit samples were <= n kb/s
// optional uint32 txspeed_ntile_75th = 78; // 70% of transmit samples were <= n kb/s
// optional uint32 txspeed_ntile_95th = 79; // 95% of transmit samples were <= n kb/s
// optional uint32 txspeed_ntile_98th = 80; // 98% of transmit samples were <= n kb/s
//
// //
// // Receive speed
// //
// optional uint32 rxspeed_max = 81; // max speed we hit that formed the histogram
//
// optional uint32 rxspeed_histogram_16 = 82; // speed at kb/s
// optional uint32 rxspeed_histogram_32 = 83;
// optional uint32 rxspeed_histogram_64 = 84;
// optional uint32 rxspeed_histogram_128 = 85;
// optional uint32 rxspeed_histogram_256 = 86;
// optional uint32 rxspeed_histogram_512 = 87;
// optional uint32 rxspeed_histogram_1024 = 88;
// optional uint32 rxspeed_histogram_max = 89;
//
// // distribution. some might be missing if we don't have enough sampels to make an estimate
// optional uint32 rxspeed_ntile_5th = 90; // 5% of transmit samples were <= n kb/s
// optional uint32 rxspeed_ntile_50th = 91; // 50% of transmit samples were <= n kb/s
// optional uint32 rxspeed_ntile_75th = 92; // 70% of transmit samples were <= n kb/s
// optional uint32 rxspeed_ntile_95th = 93; // 95% of transmit samples were <= n kb/s
// optional uint32 rxspeed_ntile_98th = 94; // 98% of transmit samples were <= n kb/s
};

/// Message containing connection quality related messages
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3726,7 +3726,8 @@ void CConnectionTransport::TransportGuessTimeoutReason( ESteamNetConnectionEnd &

void CSteamNetworkConnectionBase::UpdateSpeeds( int nTXSpeed, int nRXSpeed )
{
m_statsEndToEnd.UpdateSpeeds( nTXSpeed, nRXSpeed );
// FIXME
//m_statsEndToEnd.UpdateSpeeds( nTXSpeed, nRXSpeed );
}

void CSteamNetworkConnectionBase::UpdateMTUFromConfig( bool bForceRecalc )
Expand Down
127 changes: 63 additions & 64 deletions src/steamnetworkingsockets/steamnetworking_stats.h
Original file line number Diff line number Diff line change
Expand Up @@ -265,70 +265,69 @@ struct SteamDatagramLinkLifetimeStats
// Jitter histogram
JitterHistogram m_jitterHistogram;

//
// Connection transmit speed histogram
//
int m_nTXSpeedMax; // Max speed we hit

int m_nTXSpeedHistogram16; // Speed at kb/s
int m_nTXSpeedHistogram32;
int m_nTXSpeedHistogram64;
int m_nTXSpeedHistogram128;
int m_nTXSpeedHistogram256;
int m_nTXSpeedHistogram512;
int m_nTXSpeedHistogram1024;
int m_nTXSpeedHistogramMax;
inline int TXSpeedHistogramTotalCount() const
{
return m_nTXSpeedHistogram16
+ m_nTXSpeedHistogram32
+ m_nTXSpeedHistogram64
+ m_nTXSpeedHistogram128
+ m_nTXSpeedHistogram256
+ m_nTXSpeedHistogram512
+ m_nTXSpeedHistogram1024
+ m_nTXSpeedHistogramMax;
}

// Distribution. Some might be -1, see above for why.
int m_nTXSpeedNtile5th; // 5% of transmit samples were <= N kb/s
int m_nTXSpeedNtile50th; // 50% of transmit samples were <= N kb/s
int m_nTXSpeedNtile75th; // 75% of transmit samples were <= N kb/s
int m_nTXSpeedNtile95th; // 95% of transmit samples were <= N kb/s
int m_nTXSpeedNtile98th; // 98% of transmit samples were <= N kb/s

//
// Connection receive speed histogram
//
int m_nRXSpeedMax; // Max speed we hit that formed the histogram

int m_nRXSpeedHistogram16; // Speed at kb/s
int m_nRXSpeedHistogram32;
int m_nRXSpeedHistogram64;
int m_nRXSpeedHistogram128;
int m_nRXSpeedHistogram256;
int m_nRXSpeedHistogram512;
int m_nRXSpeedHistogram1024;
int m_nRXSpeedHistogramMax;
inline int RXSpeedHistogramTotalCount() const
{
return m_nRXSpeedHistogram16
+ m_nRXSpeedHistogram32
+ m_nRXSpeedHistogram64
+ m_nRXSpeedHistogram128
+ m_nRXSpeedHistogram256
+ m_nRXSpeedHistogram512
+ m_nRXSpeedHistogram1024
+ m_nRXSpeedHistogramMax;
}

// Distribution. Some might be -1, see above for why.
int m_nRXSpeedNtile5th; // 5% of transmit samples were <= N kb/s
int m_nRXSpeedNtile50th; // 50% of transmit samples were <= N kb/s
int m_nRXSpeedNtile75th; // 75% of transmit samples were <= N kb/s
int m_nRXSpeedNtile95th; // 95% of transmit samples were <= N kb/s
int m_nRXSpeedNtile98th; // 98% of transmit samples were <= N kb/s

// //
// // Connection transmit speed histogram
// //
// int m_nTXSpeedMax; // Max speed we hit
//
// int m_nTXSpeedHistogram16; // Speed at kb/s
// int m_nTXSpeedHistogram32;
// int m_nTXSpeedHistogram64;
// int m_nTXSpeedHistogram128;
// int m_nTXSpeedHistogram256;
// int m_nTXSpeedHistogram512;
// int m_nTXSpeedHistogram1024;
// int m_nTXSpeedHistogramMax;
// inline int TXSpeedHistogramTotalCount() const
// {
// return m_nTXSpeedHistogram16
// + m_nTXSpeedHistogram32
// + m_nTXSpeedHistogram64
// + m_nTXSpeedHistogram128
// + m_nTXSpeedHistogram256
// + m_nTXSpeedHistogram512
// + m_nTXSpeedHistogram1024
// + m_nTXSpeedHistogramMax;
// }
//
// // Distribution. Some might be -1, see above for why.
// int m_nTXSpeedNtile5th; // 5% of transmit samples were <= N kb/s
// int m_nTXSpeedNtile50th; // 50% of transmit samples were <= N kb/s
// int m_nTXSpeedNtile75th; // 75% of transmit samples were <= N kb/s
// int m_nTXSpeedNtile95th; // 95% of transmit samples were <= N kb/s
// int m_nTXSpeedNtile98th; // 98% of transmit samples were <= N kb/s
//
// //
// // Connection receive speed histogram
// //
// int m_nRXSpeedMax; // Max speed we hit that formed the histogram
//
// int m_nRXSpeedHistogram16; // Speed at kb/s
// int m_nRXSpeedHistogram32;
// int m_nRXSpeedHistogram64;
// int m_nRXSpeedHistogram128;
// int m_nRXSpeedHistogram256;
// int m_nRXSpeedHistogram512;
// int m_nRXSpeedHistogram1024;
// int m_nRXSpeedHistogramMax;
// inline int RXSpeedHistogramTotalCount() const
// {
// return m_nRXSpeedHistogram16
// + m_nRXSpeedHistogram32
// + m_nRXSpeedHistogram64
// + m_nRXSpeedHistogram128
// + m_nRXSpeedHistogram256
// + m_nRXSpeedHistogram512
// + m_nRXSpeedHistogram1024
// + m_nRXSpeedHistogramMax;
// }
//
// // Distribution. Some might be -1, see above for why.
// int m_nRXSpeedNtile5th; // 5% of transmit samples were <= N kb/s
// int m_nRXSpeedNtile50th; // 50% of transmit samples were <= N kb/s
// int m_nRXSpeedNtile75th; // 75% of transmit samples were <= N kb/s
// int m_nRXSpeedNtile95th; // 95% of transmit samples were <= N kb/s
// int m_nRXSpeedNtile98th; // 98% of transmit samples were <= N kb/s
};

/// Link stats. Pretty much everything you might possibly want to know about the connection
Expand Down
50 changes: 25 additions & 25 deletions src/steamnetworkingsockets/steamnetworking_statsutils.h
Original file line number Diff line number Diff line change
Expand Up @@ -1065,31 +1065,31 @@ struct LinkStatsTrackerEndToEnd : public LinkStatsTrackerBase
/// Time when the current interval started
SteamNetworkingMicroseconds m_usecSpeedIntervalStart;

/// TX Speed, should match CMsgSteamDatagramLinkLifetimeStats
int m_nTXSpeed;
int m_nTXSpeedMax;
CPercentileGenerator<int> m_TXSpeedSample;
int m_nTXSpeedHistogram16; // Speed at kb/s
int m_nTXSpeedHistogram32;
int m_nTXSpeedHistogram64;
int m_nTXSpeedHistogram128;
int m_nTXSpeedHistogram256;
int m_nTXSpeedHistogram512;
int m_nTXSpeedHistogram1024;
int m_nTXSpeedHistogramMax;

/// RX Speed, should match CMsgSteamDatagramLinkLifetimeStats
int m_nRXSpeed;
int m_nRXSpeedMax;
CPercentileGenerator<int> m_RXSpeedSample;
int m_nRXSpeedHistogram16; // Speed at kb/s
int m_nRXSpeedHistogram32;
int m_nRXSpeedHistogram64;
int m_nRXSpeedHistogram128;
int m_nRXSpeedHistogram256;
int m_nRXSpeedHistogram512;
int m_nRXSpeedHistogram1024;
int m_nRXSpeedHistogramMax;
///// TX Speed, should match CMsgSteamDatagramLinkLifetimeStats
//int m_nTXSpeed;
//int m_nTXSpeedMax;
//CPercentileGenerator<int> m_TXSpeedSample;
//int m_nTXSpeedHistogram16; // Speed at kb/s
//int m_nTXSpeedHistogram32;
//int m_nTXSpeedHistogram64;
//int m_nTXSpeedHistogram128;
//int m_nTXSpeedHistogram256;
//int m_nTXSpeedHistogram512;
//int m_nTXSpeedHistogram1024;
//int m_nTXSpeedHistogramMax;
//
///// RX Speed, should match CMsgSteamDatagramLinkLifetimeStats
//int m_nRXSpeed;
//int m_nRXSpeedMax;
//CPercentileGenerator<int> m_RXSpeedSample;
//int m_nRXSpeedHistogram16; // Speed at kb/s
//int m_nRXSpeedHistogram32;
//int m_nRXSpeedHistogram64;
//int m_nRXSpeedHistogram128;
//int m_nRXSpeedHistogram256;
//int m_nRXSpeedHistogram512;
//int m_nRXSpeedHistogram1024;
//int m_nRXSpeedHistogramMax;

/// Called when we get a speed sample
void UpdateSpeeds( int nTXSpeed, int nRXSpeed );
Expand Down
Loading

0 comments on commit 2751115

Please sign in to comment.