From d192d611f919aa4f2f944c84e4dd33694a4bb821 Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Tue, 27 Jan 2015 08:38:18 -0800 Subject: [PATCH] [Performance] Colorize watch counter Colorize the watch counter when it exceeds 2000, to aid in detecting/diagnosing issues like WTD-717. --- example/profiling/src/WatchIndicator.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/example/profiling/src/WatchIndicator.js b/example/profiling/src/WatchIndicator.js index 61fa917984..03a484927c 100644 --- a/example/profiling/src/WatchIndicator.js +++ b/example/profiling/src/WatchIndicator.js @@ -40,7 +40,7 @@ define( * @returns {string} the character of the database icon */ getGlyph: function () { - return "A"; + return "E"; }, /** * Get the name of the CSS class to apply to the glyph. @@ -49,14 +49,16 @@ define( * @returns {string} the CSS class to apply to this glyph */ getGlyphClass: function () { - return undefined; + return (watches > 2000) ? "caution" : + (watches < 1000) ? "ok" : + undefined; }, /** * Get the text that should appear in the indicator. * @returns {string} brief summary of connection status */ getText: function () { - return "Watches " + watches; + return watches + " watches"; }, /** * Get a longer-form description of the current connection