Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ function createMessageListener() {
function createProbeListener(probeName) {
monitor.on(probeName, function(res) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the argument name is wrong here, this is the data object from the express even that had docs removed in https://github.com/RuntimeTools/appmetrics/pull/260/files, right? res makes it seem like it is a https://nodejs.org/docs/latest/api/http.html#http_class_http_serverresponse

But the express probe got removed, and replace with strong-express-metrics... and now we are hitting this, which means that there is still an express event, what is the structure of this event?

var duration = 0;
if (probeName === 'express') {
if (probeName === 'express' && res.response) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probeName isn't used to make any other decisions in this function, except for creating a probeMetrics entry for the name if it's not already there. Do we need to examine the probeName anymore? If the probeName isn't express, but the duration is stored on res.response.duration, this will miss it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the intention of the code is that there is only a res.response.duration for express probes, I've no reason to think any other probes have one, and I've no idea why the express probe doesn't always have one. This PR is a work-around, we can figure out what is really broken next week - but it doesn't effect apiconnect, which doesn't depend on this metric anyway.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so the res.response is only relevant to code that was deleted

duration = res.response.duration;
} else {
duration = res.duration;
Expand Down