-
-
Notifications
You must be signed in to change notification settings - Fork 36
Rename nodereport module to node-report #52
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
Provides code, documentation, test and demo changes required for the migration of the nodereport project to node-report. The main changes are in the build, tests and demos that use the module name, and in the name of the report file. Remaining changes are mostly in comments. Internal variable and macro names are not changed.
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,6 +39,7 @@ | |
|
|
||
| # Package files | ||
| NodeReport*.txt | ||
| node-report*.txt | ||
| npm-debug.log | ||
| nodereport-*.tgz | ||
| nodereport_test.log | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| # nodereport Project Governance | ||
| # node-report Project Governance | ||
|
|
||
| The nodereport project falls under the governance of the post-mortem | ||
| The node-report project falls under the governance of the post-mortem | ||
| working group which is documented in: | ||
| https://github.com/nodejs/post-mortem/blob/master/GOVERNANCE.md. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,15 +1,15 @@ | ||
| # Instructions for maintainers of the nodereport project | ||
| # Instructions for maintainers of the node-report project | ||
|
|
||
| ## Publishing to the npm registry | ||
|
|
||
| The nodereport project is published as an npm native module | ||
| The node-report project is published as an npm native module | ||
|
|
||
| For each publish to npm: | ||
|
|
||
| - update the version property in the package.json file, incrementing the major, minor and patch level as appropriate | ||
| - update the CHANGES.md file with a list of commits since last release | ||
| - commit CHANGES.md and package.json to nodereport master branch | ||
| - commit CHANGES.md and package.json to node-report master branch | ||
| - tag commit with an annotated tag | ||
| - git checkout and npm publish the nodereport package | ||
| - git checkout and npm publish the node-report package | ||
|
|
||
| Suggested tooling is the slt-release script documented here: https://github.com/strongloop/strong-tools |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| # nodereport | ||
| # node-report | ||
|
|
||
| Delivers a human-readable diagnostic summary, written to file. | ||
|
|
||
|
|
@@ -14,45 +14,45 @@ Supports Node.js v4, v6 and v7 on Linux, MacOS, Windows and AIX. | |
| ## Usage | ||
|
|
||
| ```bash | ||
| npm install nodereport | ||
| node -r nodereport app.js | ||
| npm install node-report | ||
| node -r node-report app.js | ||
| ``` | ||
| A NodeReport will be triggered automatically on unhandled exceptions and fatal | ||
| A report will be triggered automatically on unhandled exceptions and fatal | ||
| error events (for example out of memory errors), and can also be triggered | ||
| by sending a USR2 signal to a Node.js process (AIX/Linux/MacOS only). | ||
|
|
||
| A NodeReport can also be triggered via an API call from a JavaScript | ||
| A report can also be triggered via an API call from a JavaScript | ||
| application. | ||
|
|
||
| ```js | ||
| var nodereport = require('nodereport'); | ||
| var nodereport = require('node-report'); | ||
| nodereport.triggerReport(); | ||
| ``` | ||
| The API can be used without adding the automatic exception and fatal error | ||
| hooks and the signal handler, as follows: | ||
|
|
||
| ```js | ||
| var nodereport = require('nodereport/api'); | ||
| var nodereport = require('node-report/api'); | ||
| nodereport.triggerReport(); | ||
| ``` | ||
|
|
||
| Content of the NodeReport consists of a header section containing the event | ||
| Content of the report consists of a header section containing the event | ||
| type, date, time, PID and Node version, sections containing JavaScript and | ||
| native stack traces, a section containing V8 heap information, a section | ||
| containing libuv handle information and an OS platform information section | ||
| showing CPU and memory usage and system limits. An example NodeReport can be | ||
| showing CPU and memory usage and system limits. An example report can be | ||
| triggered using the Node.js REPL: | ||
|
|
||
| ``` | ||
| $ node | ||
| > nodereport = require('nodereport') | ||
| > nodereport = require('node-report') | ||
| > nodereport.triggerReport() | ||
| Writing Node.js report to file: NodeReport.20161020.091102.8480.001.txt | ||
| Writing Node.js report to file: node-report.20161020.091102.8480.001.txt | ||
| Node.js report completed | ||
| > | ||
| ``` | ||
|
|
||
| When a NodeReport is triggered, start and end messages are issued to stderr | ||
| When a report is triggered, start and end messages are issued to stderr | ||
| and the filename of the report is returned to the caller. The default filename | ||
| includes the date, time, PID and a sequence number. Alternatively, a filename | ||
| can be specified as a parameter on the `triggerReport()` call. | ||
|
|
@@ -66,14 +66,14 @@ nodereport.triggerReport("myReportName"); | |
| Additional configuration is available using the following APIs: | ||
|
|
||
| ```js | ||
| nodereport.setEvents("exception+fatalerror+signal+apicall"); | ||
| nodereport.setSignal("SIGUSR2|SIGQUIT"); | ||
| nodereport.setFileName("stdout|stderr|<filename>"); | ||
| nodereport.setDirectory("<full path>"); | ||
| nodereport.setVerbose("yes|no"); | ||
| setEvents("exception+fatalerror+signal+apicall"); | ||
| setSignal("SIGUSR2|SIGQUIT"); | ||
| setFileName("stdout|stderr|<filename>"); | ||
| setDirectory("<full path>"); | ||
| setVerbose("yes|no"); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We could keep the
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. good idea, done |
||
| ``` | ||
|
|
||
| Configuration on module Initialization is also available via environment variables: | ||
| Configuration on module initialization is also available via environment variables: | ||
|
|
||
| ```bash | ||
| export NODEREPORT_EVENTS=exception+fatalerror+signal+apicall | ||
|
|
@@ -85,14 +85,14 @@ export NODEREPORT_VERBOSE=yes|no | |
|
|
||
| ## Examples | ||
|
|
||
| To see examples of NodeReports generated from these events you can run the | ||
| demonstration applications provided in the nodereport github repository. These are | ||
| To see examples of reports generated from these events you can run the | ||
| demonstration applications provided in the node-report github repository. These are | ||
| Node.js applications which will prompt you to trigger the required event. | ||
|
|
||
| 1. `api.js` - NodeReport triggered by JavaScript API call. | ||
| 2. `exception.js` - NodeReport triggered by unhandled exception. | ||
| 3. `fatalerror.js` - NodeReport triggered by fatal error on JavaScript heap out of memory. | ||
| 4. `loop.js` - looping application, NodeReport triggered using kill `-USR2 <pid>`. | ||
| 1. `api.js` - report triggered by JavaScript API call. | ||
| 2. `exception.js` - report triggered by unhandled exception. | ||
| 3. `fatalerror.js` - report triggered by fatal error on JavaScript heap out of memory. | ||
| 4. `loop.js` - looping application, report triggered using kill `-USR2 <pid>`. | ||
|
|
||
| ## License | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| // Example - generation of NodeReport via API call | ||
| var nodereport = require('nodereport'); | ||
| // Example - generation of report via API call | ||
| var nodereport = require('node-report'); | ||
| var http = require("http"); | ||
|
|
||
| var count = 0; | ||
|
|
@@ -8,12 +8,12 @@ function my_listener(request, response) { | |
| switch(count++) { | ||
| case 0: | ||
| response.writeHead(200,{"Content-Type": "text/plain"}); | ||
| response.write("\nRunning NodeReport API demo... refresh page to trigger NodeReport"); | ||
| response.write("\nRunning node-report API demo... refresh page to trigger NodeReport"); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. s/NodeReport/report for consistency
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed |
||
| response.end(); | ||
| break; | ||
| case 1: | ||
| response.writeHead(200,{"Content-Type": "text/plain"}); | ||
| // Call the nodereport module to trigger a NodeReport | ||
| // Call the node-report module to trigger a report | ||
| var filename = nodereport.triggerReport(); | ||
| response.write("\n" + filename + " written - refresh page to close"); | ||
| response.end(); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| // Example - geneation of Nodereport via signal for a looping application | ||
| require('nodereport').setEvents("signal"); | ||
| // Example - generation of report via signal for a looping application | ||
| require('node-report').setEvents("signal"); | ||
| var http = require("http"); | ||
|
|
||
| var count = 0; | ||
|
|
@@ -8,7 +8,7 @@ function my_listener(request, response) { | |
| switch(count++) { | ||
| case 0: | ||
| response.writeHead(200,{"Content-Type": "text/plain"}); | ||
| response.write("\nRunning NodeReport looping application demo. Node process ID = " + process.pid); | ||
| response.write("\nRunning node-report looping application demo. Node process ID = " + process.pid); | ||
| response.write("\n\nRefresh page to enter loop, then use 'kill -USR2 " + process.pid + "' to trigger NodeReport"); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. s/NodeReport/report for consistency
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed |
||
| response.end(); | ||
| break; | ||
|
|
@@ -28,7 +28,7 @@ function my_listener(request, response) { | |
| } | ||
| } | ||
| response.writeHead(200,{"Content-Type": "text/plain"}); | ||
| response.write("\nNodeReport demo.... finished looping"); | ||
| response.write("\nnode-report demo.... finished looping"); | ||
| response.end(); | ||
| break; | ||
| default: | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,11 @@ | ||
| { | ||
| "name": "nodereport", | ||
| "name": "node-report", | ||
| "version": "1.0.7", | ||
| "description": "Diagnostic NodeReport", | ||
| "homepage": "https://github.com/nodejs/nodereport#readme", | ||
| "description": "Diagnostic Report for Node", | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. s/Node/Node.js
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed |
||
| "homepage": "https://github.com/nodejs/node-report#readme", | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "https://github.com/nodejs/nodereport.git" | ||
| "url": "https://github.com/nodejs/node-report.git" | ||
| }, | ||
| "engines": { | ||
| "node": ">=4.0.0" | ||
|
|
@@ -21,7 +21,7 @@ | |
| "test": "tap test/test*.js" | ||
| }, | ||
| "bugs": { | ||
| "url": "https://github.com/nodejs/nodereport/issues" | ||
| "url": "https://github.com/nodejs/node-report/issues" | ||
| }, | ||
| "devDependencies": { | ||
| "tap": "^8.0.0" | ||
|
|
||
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.
https://github.com/nodejs/nodereport/blob/master/AUTHORS was deleted under #13.
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.
fixed