This file contains 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 app = require('appmetrics'); | |
var mon = app.monitor(); | |
var http = require('http'); | |
var util = require('util'); | |
mon.on('eventloop', function(d) { | |
console.log(Math.round(d.latency.avg)); | |
}); | |
var string = 'http://' + process.argv[2] + ':' + process.argv[3] + '/'; |
This file contains 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'); | |
var util = require('util'); | |
var fs = require("fs"); | |
var string = 'http://' + process.argv[2] + ':' + process.argv[3] + '/'; | |
var out = fs.createWriteStream('./out.txt'); | |
var start = process.hrtime(); |
This file contains 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
25.40%node libc-2.17.so [.] memchr | |
16.84%node [kernel.kallsyms] [k] copy_user_enhanced_fast_string | |
10.57%node node [.] v8::internal::StringSearch<unsigned char, unsigned char>::LinearSearch(v8::internal::StringSearch<unsigned char, unsigned char>*, v8::internal::Vector<unsigned char const>, int) | |
10.40%node libc-2.17.so [.] __memcpy_ssse3_back | |
4.88%node node [.] v8::internal::Factory::NewStringFromUtf8(v8::internal::Vector<char const>, v8::internal::PretenureFlag) | |
1.95%node [kernel.kallsyms] [k] free_hot_cold_page | |
1.77%node [kernel.kallsyms] [k] put_page | |
1.05%node [kernel.kallsyms] [k] iowrite16 | |
1.04%node perf-27128.map [.] Builtin:RegExpPrototypeExec | |
1.01%node [kernel.kallsyms] [k] __do_softirq |
This file contains 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'); | |
var fs = require('fs'); | |
var data = fs.readFileSync('./data.in'); | |
var server = http.createServer(function(req, res) { | |
console.log('connected'); | |
res.end(data); | |
}); | |
server.listen(25000); |
This file contains 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
--log_gc (Log heap samples on garbage collection for the hp2ps tool.) | |
type: bool default: false | |
--expose_gc (expose gc extension) | |
type: bool default: false | |
--max_new_space_size (max size of the new generation (in kBytes)) | |
type: int default: 0 | |
--max_old_space_size (max size of the old generation (in Mbytes)) | |
type: int default: 0 | |
--max_executable_size (max size of executable memory (in Mbytes)) | |
type: int default: 0 |
This file contains 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 obj; | |
var str = JSON.stringify(console); | |
while (true) { | |
obj = JSON.parse(str); | |
str = JSON.stringify(obj); | |
} |
This file contains 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 cluster = require('cluster'); | |
var count = 0; | |
function *sendRequest(){ | |
for (var i=0; i<10000; i++) { | |
count++; | |
yield i; | |
if(count == 10){ | |
process.exit(0); | |
} | |
} |
This file contains 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title>Simple Multer Upload Example</title> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
</head> | |
<body> | |
<form action="/" enctype="multipart/form-data" method="post"> | |
<input type="file" name="file-to-upload"> |
This file contains 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title>Upload File</title> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> | |
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> | |
</head> |
This file contains 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
<!doctype html> | |
<html> | |
<head> | |
<title>AJAX/Express Example</title> | |
</head> | |
<body> | |
<form id="signup" method="POST" action="/addUser"> | |
<div> | |
<label for="name">Name</label> | |
<input name="name"type="text" id="name" /> |
OlderNewer