Not sure if these count
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server.route({ | |
method: 'GET', | |
path: '/user/{userId}', | |
config: { | |
handler: retrieveUser, | |
response: { | |
sample: 50, | |
schema: { | |
name: Joi.string().required(), | |
email: Joi.string().required().email() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Hapi = require('hapi'); | |
var Good = require('good'); | |
var Reptile = require('reptile'); | |
var pack = new Hapi.Pack(); | |
pack.server(8000, { labels: ['web']}); | |
pack.server(8001, { labels: ['admin']}); | |
pack.register(Good, function (err) {}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/sbin/dtrace -s | |
pid$1::*HandleScopeC1*:entry | |
{ | |
self->cone++; | |
} | |
pid$1::*HandleScopeD1*:entry | |
/self->cone/ | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> ::dmods -l | |
ld.so.1 | |
dcmd Bind - Display a Binding Descriptor | |
dcmd Callers - Display Rt_map CALLERS binding descriptors | |
dcmd Depends - Display Rt_map DEPENDS binding descriptors | |
dcmd ElfDyn - Display Elf_Dyn entry | |
dcmd ElfEhdr - Display Elf_Ehdr entry | |
dcmd ElfPhdr - Display Elf_Phdr entry | |
dcmd Groups - Display Rt_map GROUPS group handles |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ChildProcess = require('child_process'); | |
var maxMem = Math.round(process.memoryUsage().rss / (1024 * 1024)) * 2; | |
setInterval(function () { | |
ChildProcess.exec('echo', function () { | |
var mem = Math.round(process.memoryUsage().rss / (1024 * 1024)); | |
console.log(mem + 'M used'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Http = require('http'); | |
setInterval(function () { | |
Http.get('http://localhost:9000/', function(res) { | |
console.log("Got response: " + res.statusCode); | |
}).on('error', function(e) { | |
console.log("Got error: " + e.message); | |
}); | |
}, 5); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Middle tier (similulates inbound and outbound traffic) | |
// Load modules | |
var Http = require('http'); | |
setInterval(function () { | |
Http.request({ port: 9000 }).end(); | |
}, 0); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Http = require('http'); | |
Http.createServer(function (req, res) { | |
res.writeHead(200, {'Content-Type': 'text/plain'}); | |
res.end('Hello World\n'); | |
Http.request({ host: 'localhost', port: 9000}).end(); | |
}).listen(8000); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ChildProcess = require('child_process'); | |
var maxMem = Math.round(process.memoryUsage().rss / (1024 * 1024)) * 2; | |
console.time('leak'); | |
setInterval(function () { | |
ChildProcess.exec('echo', function () { | |
var mem = Math.round(process.memoryUsage().rss / (1024 * 1024)); |