Skip to content

Commit

Permalink
fix bug that crashed for json without server logs (like memcache and …
Browse files Browse the repository at this point in the history
…redis)
  • Loading branch information
Bryan Kate committed Aug 29, 2013
1 parent a9b7ba9 commit 3b1e844
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions vis/vis.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,15 @@ function redraw(rawjson) {
for (var l = 0; l < rawjson['client_logs'].length; ++l)
processLog(rawjson['client_logs'][l], 'client_' + l, colors['client'], symbols['client']);

var b = 0;
var c = 0;
for (var l = 0; l < rawjson['server_logs'].length; ++l)
if (rawjson['server_logs'][l]['backend'])
processLog(rawjson['server_logs'][l].data, 'backend_' + b++, colors['backend'], symbols['backend']);
else
processLog(rawjson['server_logs'][l].data, 'cache_' + c++, colors['cache'], symbols['cache']);
if (rawjson.hasOwnProperty('server_logs') && rawjson['server_logs']) {
var b = 0;
var c = 0;
for (var l = 0; l < rawjson['server_logs'].length; ++l)
if (rawjson['server_logs'][l]['backend'])
processLog(rawjson['server_logs'][l].data, 'backend_' + b++, colors['backend'], symbols['backend']);
else
processLog(rawjson['server_logs'][l].data, 'cache_' + c++, colors['cache'], symbols['cache']);
}

for (g in lines) {
var plotid = createGraph(g);
Expand Down

0 comments on commit 3b1e844

Please sign in to comment.