-
Notifications
You must be signed in to change notification settings - Fork 97
Example : Web Client Monitoring #218
Example : Web Client Monitoring #218
Conversation
examples/stats/web_client_monitoring/web_client/metricsclient.js
Outdated
Show resolved
Hide resolved
Consider to use this repo https://github.com/census-instrumentation/opencensus-web |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is awesome @alexamies, thank you!
I've added some comments about just using mLatencyMs with various tags instead of separate measures, otherwise looks good!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, added one minor nit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Re Bogdan's comment above about
Consider to use this repo https://github.com/census-instrumentation/opencensus-web
As discussed offline, this PR is better living in opencensus-node that opencensus-web because it is demonstrating use of the Node API.
@odeke-em @justindsmith If no other comments, I will merge this PR later today. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for working on this @alexamies, LGTM!
const valueDNSLookup = "dns_lookup"; | ||
const valueLoad = "load"; | ||
const valueWeb = "web"; | ||
let tags = { phase: valueDNSLookup, client: valueWeb }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For later updates after this merge, we don't need to declare this upfront and can instead
do it inline while recording e.g.
stats.record({
measure: mLatencyMs,
{ phase: valueDNSLookup, client: valueWeb },
value: dnsTime
});
ditto for the other stats.record calls but that can wait after this first pass.
Thank you for working on this @alexamies |
Example of using OpenCensus to instrument browser code