File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
packages/signals/signals/src/core/signals Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ export class SignalGlobalSettings {
3333 ingestClient : SignalsIngestSettingsConfig
3434 network : NetworkSettingsConfig
3535
36- private sampleRate = 0
36+ private sampleSuccess = false
3737 private signalsDebug = new SignalsDebugSettings ( )
3838
3939 constructor ( settings : SignalsSettingsConfig ) {
@@ -58,7 +58,7 @@ export class SignalGlobalSettings {
5858 if ( this . signalsDebug . getSignalsDebug ( ) ) {
5959 return true
6060 }
61- if ( Math . random ( ) > this . sampleRate ) {
61+ if ( ! this . sampleSuccess ) {
6262 return false
6363 }
6464 return false
@@ -99,7 +99,9 @@ export class SignalGlobalSettings {
9999 Boolean ( val )
100100 )
101101 )
102- this . sampleRate = sampleRate
102+ if ( Math . random ( ) <= sampleRate ) {
103+ this . sampleSuccess = true
104+ }
103105 }
104106}
105107
You can’t perform that action at this time.
0 commit comments