UNPKG

@alifd/fusion-collector

Version:

Collect info for fusion based project

22 lines (17 loc) 385 B
"use strict"; module.exports = function (wpo) { var map = {}; wpo.sampling = function (mod) { var uid = wpo.uid, num = 0; if (mod == 1) { return 1; // 100% } else if (typeof map[mod] == 'number') { return map[mod]; } // // 抽样算法改为Math.random // map[mod] = Math.floor(Math.random() * mod); return map[mod]; }; };