forked from heroku/heroku-buildpack-nodejs
-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Inventory for heroku/nodejs engine (heroku#1144) #93
Closed
Closed
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
79bae2e
Update Inventory for heroku/nodejs engine (#1144)
heroku-linguist[bot] 3f7f711
Bump actions/checkout from 2 to 4 (#1143)
dependabot[bot] 6be1e1a
Update Node.js Yarn Inventory (#1145)
heroku-linguist[bot] dbdcc08
Prepare release v223 (#1146)
colincasey bb9fed9
fix: do not ignore errors when checking npm/yarn output (#1147)
josegonzalez a7449a5
Update Inventory for heroku/nodejs engine (#1150)
heroku-linguist[bot] ca78802
Prepare release v224 (#1151)
colincasey f4b514c
Fix author/committer for inventory update PRs (#1152)
edmorley 3ada8aa
Fixes multiline output not being stored correctly (#1153)
colincasey f475420
Group minor/patch version Ruby Dependabot updates into one PR (#1155)
edmorley 77329cc
Update Inventory for heroku/nodejs engine (#1154)
heroku-linguist[bot] 8ab46d4
Prepare release v225 (#1157)
colincasey daa211a
Bump @babel/traverse in /yarn2-plugins/prune-dev-dependencies (#1158)
dependabot[bot] fa9ba69
Bump the ruby-dependencies group with 1 update (#1156)
dependabot[bot] 410e256
Update Inventory for heroku/nodejs engine (#1159)
heroku-linguist[bot] 680e11c
Updates metrics plugins and tests for Node 21 (#1161)
colincasey 7df5654
Prepare release v226 (#1160)
colincasey 1ca1b2f
Merge tag 'v226' into deps/upstream_v226
Barokai File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
107fa5474f01fce59c2b7e9d17411f161feddd1a0537ac85798ae8804d66ebe17285d66062adfe75472b64006951b81dcc322e4918e2ee5c6f3fae96c24dd1e6 heroku-nodejs-plugin-node-21-v13.tar.gz | ||
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
require_relative '../spec_helper' | ||
|
||
describe "Node Metrics for v21.x" do | ||
context "test metrics for Node v21x app" do | ||
let(:app) { | ||
Hatchet::Runner.new( | ||
"spec/fixtures/repos/node-21-metrics", | ||
config: { | ||
"HEROKU_METRICS_URL" => "http://localhost:3000", | ||
"METRICS_INTERVAL_OVERRIDE" => "10000" | ||
} | ||
) | ||
} | ||
|
||
it "should deploy" do | ||
app.deploy do |app| | ||
data = successful_json_body(app) | ||
expect(data["gauges"]["node.eventloop.delay.ms.max"]).to be >= 2000 | ||
expect(data["counters"]["node.gc.collections"]).to be >= 0 | ||
expect(data["counters"]["node.gc.young.collections"]).to be >= 0 | ||
expect(data["counters"]["node.gc.old.collections"]).to be >= 0 | ||
end | ||
end | ||
end | ||
end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
require_relative '../spec_helper' | ||
|
||
describe "Hello World for Node v21.x" do | ||
context "a single-process Node v21.x app" do | ||
let(:app) { | ||
Hatchet::Runner.new("spec/fixtures/repos/node-21") | ||
} | ||
|
||
it "should deploy successfully" do | ||
app.deploy do |app| | ||
expect(successful_body(app).strip).to eq("Hello, world!") | ||
end | ||
end | ||
end | ||
end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
web: node index.js |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
#!/usr/bin/env node | ||
|
||
const http = require('http'); | ||
const EventEmitter = require('events'); | ||
|
||
const PORT = process.env.PORT || 5000; | ||
const Events = new EventEmitter(); | ||
|
||
// This will block the event loop for ~lengths of time | ||
function blockCpuFor(ms) { | ||
return new Promise((resolve, reject) => { | ||
setTimeout(() => { | ||
console.log(`blocking the event loop for ${ms}ms`); | ||
let now = new Date().getTime(); | ||
let result = 0 | ||
while(true) { | ||
result += Math.random() * Math.random(); | ||
if (new Date().getTime() > now + ms) | ||
break; | ||
} | ||
resolve(); | ||
}, 100); | ||
}); | ||
} | ||
|
||
function getNextMetricsEvent() { | ||
return new Promise((resolve, reject) => Events.once('metrics', resolve)); | ||
} | ||
|
||
const server = http.createServer((req, res) => { | ||
// wait for the next metrics event | ||
getNextMetricsEvent() | ||
.then(blockCpuFor(2000)) | ||
.then(blockCpuFor(100)) | ||
.then(blockCpuFor(100)) | ||
.then(blockCpuFor(100)) | ||
.then(blockCpuFor(100)) | ||
.then(blockCpuFor(100)) | ||
.then(blockCpuFor(100)) | ||
.then(blockCpuFor(100)) | ||
.then(blockCpuFor(100)) | ||
.then(blockCpuFor(100)) | ||
.then(blockCpuFor(100)) | ||
// gather the next metrics data which should include these pauses | ||
.then(getNextMetricsEvent()) | ||
.then(data => { | ||
res.setHeader('Content-Type', 'application/json'); | ||
res.end(data); | ||
}) | ||
.catch(() => { | ||
res.statusCode = 500; | ||
res.end("Something went wrong"); | ||
}); | ||
}); | ||
|
||
server.listen(PORT, () => console.log(`Listening on ${PORT}`)); | ||
|
||
// Create a second server that intercepts the HTTP requests | ||
// sent by the metrics plugin | ||
const metricsListener = http.createServer((req, res) => { | ||
if (req.method == 'POST') { | ||
let body = ''; | ||
req.on('data', (data) => body += data); | ||
req.on('end', () => { | ||
res.statusCode = 200; | ||
res.end(); | ||
Events.emit('metrics', body) | ||
}); | ||
} | ||
}); | ||
|
||
metricsListener.listen(3000, () => console.log('Listening for metrics on 3000')); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"name": "node-metrics-test-app", | ||
"version": "1.0.0", | ||
"engines": { | ||
"node": "21.x" | ||
}, | ||
"main": "index.js", | ||
"license": "MIT", | ||
"devDependencies": {}, | ||
"dependencies": {} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
web: node index.js |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"name": "hello-world" | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/usr/bin/env node | ||
|
||
const http = require('http'); | ||
|
||
const PORT = process.env.PORT || 5000; | ||
|
||
const server = http.createServer((_req, res) => { | ||
res.statusCode = 200; | ||
res.setHeader('Content-Type', 'text/plain'); | ||
res.end("Hello, world!"); | ||
}) | ||
|
||
server.listen(PORT, () => console.log(`Listening on ${PORT}`)); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"name": "hello-world", | ||
"version": "1.0.0", | ||
"engines": { | ||
"node": "21.x" | ||
}, | ||
"scripts": { | ||
"prettify": "prettier --single-quote --trailing-comma all --write 'bin/*' 'src/**/*.js'", | ||
"test": "jest --silent", | ||
"dev": "nodemon --watch . --watch src/* src/index.js", | ||
"build": "echo NODE_OPTIONS: $NODE_OPTIONS" | ||
}, | ||
"main": "index.js", | ||
"license": "MIT", | ||
"devDependencies": { | ||
"jest": "^19.0.2", | ||
"nodemon": "^1.19.4", | ||
"prettier": "^0.22.0" | ||
}, | ||
"dependencies": {} | ||
} |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Not sure about these files in the plugin directory, they need to be removed probably