@@ -7,7 +7,10 @@ import 'package:sendbird_chat_sdk/src/internal/main/stats/stat_type.dart';
7
7
class WsConnectStat extends DefaultStat {
8
8
final String hostUrl; // ws host url
9
9
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
11
14
final int ? errorCode; // error code if exist
12
15
final String ? errorDescription; // detailed error message
13
16
@@ -16,6 +19,9 @@ class WsConnectStat extends DefaultStat {
16
19
required this .hostUrl,
17
20
required this .success,
18
21
required this .latency,
22
+ required this .accumTrial,
23
+ required this .connectionId,
24
+ this .logiLatency,
19
25
this .errorCode,
20
26
this .errorDescription,
21
27
}) : super (StatType .wsConnect, ts);
@@ -26,6 +32,9 @@ class WsConnectStat extends DefaultStat {
26
32
'host_url' : hostUrl,
27
33
'success' : success,
28
34
'latency' : latency,
35
+ 'accum_trial' : accumTrial,
36
+ 'connection_id' : connectionId,
37
+ 'logi_latency' : logiLatency,
29
38
'error_code' : errorCode,
30
39
'error_description' : errorDescription,
31
40
};
@@ -41,6 +50,9 @@ class WsConnectStat extends DefaultStat {
41
50
// 'host_url': String,
42
51
// 'success': bool,
43
52
// 'latency': int,
53
+ // 'accum_trial': int,
54
+ // 'connection_id': String,
55
+ // 'logi_latency': int?,
44
56
// 'error_code': int?,
45
57
// 'error_description': String?,
46
58
// },
@@ -53,10 +65,17 @@ class WsConnectStat extends DefaultStat {
53
65
final String ? hostUrl = data['host_url' ] as String ? ;
54
66
final bool ? success = data['success' ] as bool ? ;
55
67
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 ? ;
56
71
final int ? errorCode = data['error_code' ] as int ? ;
57
72
final String ? errorDescription = data['error_description' ] as String ? ;
58
73
59
- if (hostUrl == null || success == null || latency == null ) {
74
+ if (hostUrl == null ||
75
+ success == null ||
76
+ latency == null ||
77
+ accumTrial == null ||
78
+ connectionId == null ) {
60
79
return null ;
61
80
}
62
81
@@ -65,6 +84,9 @@ class WsConnectStat extends DefaultStat {
65
84
hostUrl: hostUrl,
66
85
success: success,
67
86
latency: latency,
87
+ accumTrial: accumTrial,
88
+ connectionId: connectionId,
89
+ logiLatency: logiLatency,
68
90
errorCode: errorCode,
69
91
errorDescription: errorDescription,
70
92
);
0 commit comments