Skip to content

Commit 93bf465

Browse files
committed
optional sampleRate
1 parent 4c9438a commit 93bf465

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/signals/signals/src/core/signals/settings.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,15 +96,15 @@ export class SignalGlobalSettings {
9696
/**
9797
* Sample rate to determine sending signals
9898
*/
99-
sampleRate: number
99+
sampleRate?: number
100100
}): void {
101101
edgeFnDownloadURL && (this.sandbox.edgeFnDownloadURL = edgeFnDownloadURL)
102102
this.network.networkSignalsFilterList.disallowed.addURLLike(
103103
...disallowListURLs.filter(<T>(val: T): val is NonNullable<T> =>
104104
Boolean(val)
105105
)
106106
)
107-
if (Math.random() <= sampleRate) {
107+
if (sampleRate && Math.random() <= sampleRate) {
108108
this.sampleSuccess = true
109109
}
110110
}

0 commit comments

Comments
 (0)