Beyond Profilers: Tracing Node.js Transactions
-
Upload
terral-r-jordan -
Category
Software
-
view
240 -
download
0
description
Transcript of Beyond Profilers: Tracing Node.js Transactions
![Page 1: Beyond Profilers: Tracing Node.js Transactions](https://reader033.fdocuments.us/reader033/viewer/2022052904/55832725d8b42a3c658b5354/html5/thumbnails/1.jpg)
Beyond Profilers:Tracing Node.js Transactions
TR JordanOctober 2014
![Page 2: Beyond Profilers: Tracing Node.js Transactions](https://reader033.fdocuments.us/reader033/viewer/2022052904/55832725d8b42a3c658b5354/html5/thumbnails/2.jpg)
users’ data
users
![Page 3: Beyond Profilers: Tracing Node.js Transactions](https://reader033.fdocuments.us/reader033/viewer/2022052904/55832725d8b42a3c658b5354/html5/thumbnails/3.jpg)
webserver
application
cachedatabase
external API
internet
browser
users
![Page 4: Beyond Profilers: Tracing Node.js Transactions](https://reader033.fdocuments.us/reader033/viewer/2022052904/55832725d8b42a3c658b5354/html5/thumbnails/4.jpg)
webserver
application
cachedatabase
external API
internet
browser
users
![Page 5: Beyond Profilers: Tracing Node.js Transactions](https://reader033.fdocuments.us/reader033/viewer/2022052904/55832725d8b42a3c658b5354/html5/thumbnails/5.jpg)
Throughput vs. Network Capacity
![Page 6: Beyond Profilers: Tracing Node.js Transactions](https://reader033.fdocuments.us/reader033/viewer/2022052904/55832725d8b42a3c658b5354/html5/thumbnails/6.jpg)
webserver
application
cachedatabase
external API
internet
browser
users
![Page 7: Beyond Profilers: Tracing Node.js Transactions](https://reader033.fdocuments.us/reader033/viewer/2022052904/55832725d8b42a3c658b5354/html5/thumbnails/7.jpg)
![Page 8: Beyond Profilers: Tracing Node.js Transactions](https://reader033.fdocuments.us/reader033/viewer/2022052904/55832725d8b42a3c658b5354/html5/thumbnails/8.jpg)
![Page 9: Beyond Profilers: Tracing Node.js Transactions](https://reader033.fdocuments.us/reader033/viewer/2022052904/55832725d8b42a3c658b5354/html5/thumbnails/9.jpg)
![Page 10: Beyond Profilers: Tracing Node.js Transactions](https://reader033.fdocuments.us/reader033/viewer/2022052904/55832725d8b42a3c658b5354/html5/thumbnails/10.jpg)
![Page 11: Beyond Profilers: Tracing Node.js Transactions](https://reader033.fdocuments.us/reader033/viewer/2022052904/55832725d8b42a3c658b5354/html5/thumbnails/11.jpg)
webserver
application
cachedatabase
external API
browser
users
internet
![Page 12: Beyond Profilers: Tracing Node.js Transactions](https://reader033.fdocuments.us/reader033/viewer/2022052904/55832725d8b42a3c658b5354/html5/thumbnails/12.jpg)
Request ID+
Operation IDs+
Other Stuff™
![Page 13: Beyond Profilers: Tracing Node.js Transactions](https://reader033.fdocuments.us/reader033/viewer/2022052904/55832725d8b42a3c658b5354/html5/thumbnails/13.jpg)
![Page 14: Beyond Profilers: Tracing Node.js Transactions](https://reader033.fdocuments.us/reader033/viewer/2022052904/55832725d8b42a3c658b5354/html5/thumbnails/14.jpg)
![Page 15: Beyond Profilers: Tracing Node.js Transactions](https://reader033.fdocuments.us/reader033/viewer/2022052904/55832725d8b42a3c658b5354/html5/thumbnails/15.jpg)
![Page 16: Beyond Profilers: Tracing Node.js Transactions](https://reader033.fdocuments.us/reader033/viewer/2022052904/55832725d8b42a3c658b5354/html5/thumbnails/16.jpg)
![Page 17: Beyond Profilers: Tracing Node.js Transactions](https://reader033.fdocuments.us/reader033/viewer/2022052904/55832725d8b42a3c658b5354/html5/thumbnails/17.jpg)
![Page 18: Beyond Profilers: Tracing Node.js Transactions](https://reader033.fdocuments.us/reader033/viewer/2022052904/55832725d8b42a3c658b5354/html5/thumbnails/18.jpg)
Code
![Page 19: Beyond Profilers: Tracing Node.js Transactions](https://reader033.fdocuments.us/reader033/viewer/2022052904/55832725d8b42a3c658b5354/html5/thumbnails/19.jpg)
var http = require('http');var shimmer = require('shimmer');
shimmer.wrap(http, 'request', function (original) { return function () { console.log("Starting request!"); var returned = original.apply(this, arguments) console.log("Done setting up request"); return returned; };});
![Page 20: Beyond Profilers: Tracing Node.js Transactions](https://reader033.fdocuments.us/reader033/viewer/2022052904/55832725d8b42a3c658b5354/html5/thumbnails/20.jpg)
shimmer.wrap(collection.prototype, 'update', function (fn) { return function (query, doc, options, callback) { if (typeof options === 'function') { callback = options options = {} } var run = fn.bind(this, query, doc, options) return attempt(run, this.collectionName, this.db, { QueryOp: 'update', Query: JSON.stringify(query), Update_Document: JSON.stringify(doc) }, callback) }})
![Page 21: Beyond Profilers: Tracing Node.js Transactions](https://reader033.fdocuments.us/reader033/viewer/2022052904/55832725d8b42a3c658b5354/html5/thumbnails/21.jpg)
Challenges
![Page 22: Beyond Profilers: Tracing Node.js Transactions](https://reader033.fdocuments.us/reader033/viewer/2022052904/55832725d8b42a3c658b5354/html5/thumbnails/22.jpg)
Initial Function
Callback
Callback
Callback
Callback
User
![Page 23: Beyond Profilers: Tracing Node.js Transactions](https://reader033.fdocuments.us/reader033/viewer/2022052904/55832725d8b42a3c658b5354/html5/thumbnails/23.jpg)
Initial Function
Callback
Callback
Callback
Callback
User
![Page 24: Beyond Profilers: Tracing Node.js Transactions](https://reader033.fdocuments.us/reader033/viewer/2022052904/55832725d8b42a3c658b5354/html5/thumbnails/24.jpg)
Node
QueueWork Callback
![Page 25: Beyond Profilers: Tracing Node.js Transactions](https://reader033.fdocuments.us/reader033/viewer/2022052904/55832725d8b42a3c658b5354/html5/thumbnails/25.jpg)
NodeC++ OS
QueueWork Callback
![Page 26: Beyond Profilers: Tracing Node.js Transactions](https://reader033.fdocuments.us/reader033/viewer/2022052904/55832725d8b42a3c658b5354/html5/thumbnails/26.jpg)
![Page 27: Beyond Profilers: Tracing Node.js Transactions](https://reader033.fdocuments.us/reader033/viewer/2022052904/55832725d8b42a3c658b5354/html5/thumbnails/27.jpg)
Initial Function
Callback
Callback
Callback
Callback
User
![Page 28: Beyond Profilers: Tracing Node.js Transactions](https://reader033.fdocuments.us/reader033/viewer/2022052904/55832725d8b42a3c658b5354/html5/thumbnails/28.jpg)
Tracelyzer via UDP
![Page 29: Beyond Profilers: Tracing Node.js Transactions](https://reader033.fdocuments.us/reader033/viewer/2022052904/55832725d8b42a3c658b5354/html5/thumbnails/29.jpg)
Tracelyzer via UDP
500
![Page 30: Beyond Profilers: Tracing Node.js Transactions](https://reader033.fdocuments.us/reader033/viewer/2022052904/55832725d8b42a3c658b5354/html5/thumbnails/30.jpg)
Thanks!Connect.
Read.
• On the Blog:happneta.com/blog/x-trace-introduction/
• On GitHub:github.com/appneta/node-traceview
We’re Hiring!