Skip to content

Commit

Permalink
show uncaught exception count in epoch bar
Browse files Browse the repository at this point in the history
Count the number of entries in an exceptions log query, instead of the exception hit count.

#46
  • Loading branch information
alltom committed Aug 2, 2014
1 parent 3d3b109 commit 2626346
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
16 changes: 13 additions & 3 deletions src/AgentHandle.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,19 @@ define(function (require, exports, module) {
});

var ExceptionsAggregateHandle = makeAggregateHandleConstructor({
_open: function () { return this._agent.trackExceptions() },
_free: function () { this._agent.untrackExceptions(this._rawHandle) },
_refresh: function () { return this._agent.exceptionDelta(this._rawHandle) },
_open: function () {
var d = new $.Deferred;
this._agent.trackLogs({ ids: [], exceptions: true }, function (handle) {
if (handle === undefined) {
d.reject();
} else {
d.resolve(handle);
}
}.bind(this));
return d.promise();
},
_free: function () { /* XXX TODO */ },
_refresh: function () { return this._agent.logCount(this._rawHandle) },
});

var ConsoleLogsAggregateHandle = makeAggregateHandleConstructor({
Expand Down
6 changes: 2 additions & 4 deletions src/EpochPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,7 @@ define(function (require, exports, module) {
if (!(agent.id in exceptionCountByAgent)) {
exceptionCountByAgent[agent.id] = 0;
}
for (var nodeId in hits) {
exceptionCountByAgent[agent.id] += hits[nodeId];
}
exceptionCountByAgent[agent.id] = hits;
combineExceptions();

updateExceptionDisplay();
Expand Down Expand Up @@ -234,7 +232,7 @@ define(function (require, exports, module) {

exceptionHandle = AgentHandle.trackExceptions(100);
$(exceptionHandle).on("data", function (ev, data) {
exceptionsReceived(data.agent, data.data.counts);
exceptionsReceived(data.agent, data.data);
});
$(exceptionHandle).on("agentDisconnected", function (ev, agent) {
agentLeft(agent);
Expand Down

0 comments on commit 2626346

Please sign in to comment.