diff options
author | Zach Koopmans <zkoopmans@google.com> | 2019-12-02 22:51:55 -0800 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2019-12-02 22:53:26 -0800 |
commit | ce32c0684311923fb80dd04221d5fd5120170cf9 (patch) | |
tree | 8434032ba3f248b8d840bc3cdcca1b37f9f222ee /benchmarks/workloads/node/index.js | |
parent | 7ac46c50486eef252ecaa4de1a2fe2581f73f79c (diff) |
Import benchmark-tools to main repository.
This has adapted for use with bazel from the original commit
a26e93769ebefd82593a43e22fb13a09717cfa6d.
In particular, the style has been made consistent with internal python style
guidelines, and the packages (including the main entrypoint) have been
refactored in order to allow bazel testing targets.
PiperOrigin-RevId: 283484433
Diffstat (limited to 'benchmarks/workloads/node/index.js')
-rw-r--r-- | benchmarks/workloads/node/index.js | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/benchmarks/workloads/node/index.js b/benchmarks/workloads/node/index.js new file mode 100644 index 000000000..584158462 --- /dev/null +++ b/benchmarks/workloads/node/index.js @@ -0,0 +1,28 @@ +'use strict'; + +var start = new Date().getTime(); + +// Load dependencies to simulate an average nodejs app. +var req_0 = require('async'); +var req_1 = require('bluebird'); +var req_2 = require('firebase'); +var req_3 = require('firebase-admin'); +var req_4 = require('@google-cloud/container'); +var req_5 = require('@google-cloud/logging'); +var req_6 = require('@google-cloud/monitoring'); +var req_7 = require('@google-cloud/spanner'); +var req_8 = require('lodash'); +var req_9 = require('mailgun-js'); +var req_10 = require('request'); +var express = require('express'); +var app = express(); + +var loaded = new Date().getTime() - start; +app.get('/', function(req, res) { + res.send('Hello World!<br>Loaded in ' + loaded + 'ms'); +}); + +console.log('Loaded in ' + loaded + ' ms'); +app.listen(8080, function() { + console.log('Listening on port 8080...'); +}); |