Skip to content

Commit 1da570f

Browse files
web-padawanArtur-
authored andcommitted
feat: make sure everybody wins (#47)
1 parent b5d13fe commit 1da570f

File tree

3 files changed

+2
-22
lines changed

3 files changed

+2
-22
lines changed

src/vaadin-usage-statistics.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ class UsageStatistics {
303303
}
304304

305305
lottery() {
306-
return Math.random() <= 0.05;
306+
return true;
307307
}
308308

309309
currentMonth() {

test/usage.html

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -189,26 +189,6 @@
189189
assert.isTrue(lotteryCalled);
190190
assert.isTrue(sendCalled);
191191
});
192-
test('5-percent-success-rate', function () {
193-
var sendCalled = 0;
194-
195-
const stats = new UsageStatistics();
196-
stats.initialDelay = 0;
197-
198-
class MockSender extends StatisticsSender {
199-
send(data) {
200-
sendCalled++;
201-
}
202-
}
203-
stats.sender = new MockSender();
204-
for (var i = 0; i < 5000; i++) {
205-
localStorage.setItem(UsageStatistics.monthProcessedKey, 0);
206-
stats.maybeSend();
207-
}
208-
209-
// Configured to be 5%
210-
assert.closeTo(sendCalled, 250, 80);
211-
}).timeout(20000);
212192
});
213193
suite('gather', function () {
214194
setup(() => {

vaadin-usage-statistics-collect.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@
398398
}, {
399399
key: 'lottery',
400400
value: function lottery() {
401-
return Math.random() <= 0.05;
401+
return true;
402402
}
403403
}, {
404404
key: 'currentMonth',

0 commit comments

Comments
 (0)