From f23dc13469c6c2a694649f658cdc1d1eaf8def64 Mon Sep 17 00:00:00 2001 From: Roman Volosovskyi Date: Fri, 26 Jan 2018 11:26:44 +0200 Subject: [PATCH] add thresholdMessage --- stream/bars.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stream/bars.js b/stream/bars.js index 4e19fe6..dd0b359 100644 --- a/stream/bars.js +++ b/stream/bars.js @@ -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) {