Skip to content

Commit

Permalink
Move location of request proxy stats so we get them with or without r…
Browse files Browse the repository at this point in the history
…etries
  • Loading branch information
jwolski committed Jun 1, 2015
1 parent 9b39be8 commit 6fff7de
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 3 additions & 0 deletions lib/request-proxy/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,16 @@ proto.proxyReq = function proxyReq(opts) {
self.removeSend(send);

if (err) {
self.ringpop.stat('increment', 'requestProxy.send.error');
self.ringpop.logger.warn('requestProxy got error from tchannel', {
err: err,
url: req.url
});
return sendError(res, err);
}

self.ringpop.stat('increment', 'requestProxy.send.success');

var responseHead = safeParse(res1) || {};

if (responseHead.headers) {
Expand Down
2 changes: 0 additions & 2 deletions lib/request-proxy/send.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,12 +235,10 @@ RequestProxySend.prototype.send = function send(channelOpts, callback) {

function onSend(err, res1, res2) {
if (!err) {
self.ringpop.stat('increment', 'requestProxy.send.success');
self.handleSuccess(res1, res2, callback);
return;
}

self.ringpop.stat('increment', 'requestProxy.send.error');
self.errors.push(err);

if (self.numRetries >= self.maxRetries) {
Expand Down

0 comments on commit 6fff7de

Please sign in to comment.