add thresholdMessage

This commit is contained in:
Roman Volosovskyi 2018-01-26 11:26:44 +02:00
parent 72cc861178
commit f23dc13469
No known key found for this signature in database
GPG Key ID: 37135489EAE4B2D7
1 changed files with 2 additions and 2 deletions

View File

@ -1,7 +1,7 @@
const normal = '▒';
const crazy = '▇';
export default (valuefn = ary => ary.length, threshold = 100, tick = true, yellowbox = false, label = '') => events =>
export default (valuefn = ary => ary.length, threshold = 100, tick = true, yellowbox = false, label = '', thresholdMessage = '') => events =>
events.do((infoAry) => {
const len = valuefn(infoAry);
@ -12,7 +12,7 @@ export default (valuefn = ary => ary.length, threshold = 100, tick = true, yello
};
if (yellowbox && len >= threshold) {
console.warn(`bars: event rate over threshold (${threshold}): ${len}`); // eslint-disable-line no-console
console.warn(`RN bridge: ${thresholdMessage}, event rate over threshold (${threshold}): ${len}`); // eslint-disable-line no-console
}
if (tick) {