@@ -7,7 +7,10 @@ import 'package:sendbird_chat_sdk/src/internal/main/stats/stat_type.dart';
77class WsConnectStat extends DefaultStat {
88 final String hostUrl; // ws host url
99 final bool success; // success or not
10- final int latency; // roundtrip latency
10+ final int latency; // until connected or failed
11+ final int accumTrial;
12+ final String connectionId;
13+ final int ? logiLatency; // until received LOGI
1114 final int ? errorCode; // error code if exist
1215 final String ? errorDescription; // detailed error message
1316
@@ -16,6 +19,9 @@ class WsConnectStat extends DefaultStat {
1619 required this .hostUrl,
1720 required this .success,
1821 required this .latency,
22+ required this .accumTrial,
23+ required this .connectionId,
24+ this .logiLatency,
1925 this .errorCode,
2026 this .errorDescription,
2127 }) : super (StatType .wsConnect, ts);
@@ -26,6 +32,9 @@ class WsConnectStat extends DefaultStat {
2632 'host_url' : hostUrl,
2733 'success' : success,
2834 'latency' : latency,
35+ 'accum_trial' : accumTrial,
36+ 'connection_id' : connectionId,
37+ 'logi_latency' : logiLatency,
2938 'error_code' : errorCode,
3039 'error_description' : errorDescription,
3140 };
@@ -41,6 +50,9 @@ class WsConnectStat extends DefaultStat {
4150 // 'host_url': String,
4251 // 'success': bool,
4352 // 'latency': int,
53+ // 'accum_trial': int,
54+ // 'connection_id': String,
55+ // 'logi_latency': int?,
4456 // 'error_code': int?,
4557 // 'error_description': String?,
4658 // },
@@ -53,10 +65,17 @@ class WsConnectStat extends DefaultStat {
5365 final String ? hostUrl = data['host_url' ] as String ? ;
5466 final bool ? success = data['success' ] as bool ? ;
5567 final int ? latency = data['latency' ] as int ? ;
68+ final int ? accumTrial = data['accum_trial' ] as int ? ;
69+ final String ? connectionId = data['connection_id' ] as String ? ;
70+ final int ? logiLatency = data['logi_latency' ] as int ? ;
5671 final int ? errorCode = data['error_code' ] as int ? ;
5772 final String ? errorDescription = data['error_description' ] as String ? ;
5873
59- if (hostUrl == null || success == null || latency == null ) {
74+ if (hostUrl == null ||
75+ success == null ||
76+ latency == null ||
77+ accumTrial == null ||
78+ connectionId == null ) {
6079 return null ;
6180 }
6281
@@ -65,6 +84,9 @@ class WsConnectStat extends DefaultStat {
6584 hostUrl: hostUrl,
6685 success: success,
6786 latency: latency,
87+ accumTrial: accumTrial,
88+ connectionId: connectionId,
89+ logiLatency: logiLatency,
6890 errorCode: errorCode,
6991 errorDescription: errorDescription,
7092 );
0 commit comments