@@ -14,11 +14,11 @@ type ServerConfiguration struct {
14
14
Multiplicity int
15
15
SendInterval time.Duration
16
16
MaxSessionDuration time.Duration
17
- SessionSplitBySessionDuration bool
17
+ sessionSplitBySessionDuration bool
18
18
MaxEventsPerSession int
19
- SessionSplitByEvents bool
19
+ sessionSplitByEvents bool
20
20
SessionTimeout time.Duration
21
- SessionSplitByIdleTimeout bool
21
+ sessionSplitByIdleTimeout bool
22
22
VisitStoreVersion int
23
23
TrafficControlPercentage int
24
24
}
@@ -33,11 +33,11 @@ func NewServerConfiguration(attributes protocol.ResponseAttributes) *ServerConfi
33
33
Multiplicity : attributes .Multiplicity ,
34
34
SendInterval : attributes .SendInterval ,
35
35
MaxSessionDuration : attributes .MaxSessionDuration ,
36
- SessionSplitBySessionDuration : attributes .MaxSessionDuration != 0 ,
36
+ sessionSplitBySessionDuration : attributes .MaxSessionDuration != 0 ,
37
37
MaxEventsPerSession : attributes .MaxEventsPerSession ,
38
- SessionSplitByEvents : attributes .MaxEventsPerSession != 0 ,
38
+ sessionSplitByEvents : attributes .MaxEventsPerSession != 0 ,
39
39
SessionTimeout : attributes .SessionTimeout ,
40
- SessionSplitByIdleTimeout : attributes .SessionTimeout != 0 ,
40
+ sessionSplitByIdleTimeout : attributes .SessionTimeout != 0 ,
41
41
VisitStoreVersion : attributes .VisitStoreVersion ,
42
42
TrafficControlPercentage : attributes .TrafficControlPercentage ,
43
43
}
@@ -55,3 +55,17 @@ func (c *ServerConfiguration) IsSendingErrorsAllowed() bool {
55
55
return c .IsSendingDataAllowed () && c .ErrorReporting
56
56
57
57
}
58
+
59
+ func (c * ServerConfiguration ) IsSessionSplitByEventsEnabled () bool {
60
+ return c .sessionSplitByEvents && c .MaxEventsPerSession > 0
61
+ }
62
+
63
+ func (c * ServerConfiguration ) IsSessionSplitBySessionDurationEnabled () bool {
64
+ return c .sessionSplitBySessionDuration && c .MaxSessionDuration > 0
65
+
66
+ }
67
+
68
+ func (c * ServerConfiguration ) IsSessionSplitByIdleTimeoutEnabled () bool {
69
+ return c .sessionSplitByIdleTimeout && c .SessionTimeout > 0
70
+
71
+ }
0 commit comments