-
Notifications
You must be signed in to change notification settings - Fork 45
chore: rename nodereport to node-report #37
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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,87 +14,87 @@ 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 node-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 (Linux/MacOS only). | ||
|
||
A NodeReport can also be triggered via an API call from a JavaScript | ||
A node-report can also be triggered via an API call from a JavaScript | ||
application. | ||
|
||
```js | ||
var nodereport = require('nodereport'); | ||
nodereport.triggerReport(); | ||
var node-report = require('node-report'); | ||
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. this is syntactically invalid javascript, you need to be more discerning in your search and replace. revert it to the original. |
||
node-report.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'); | ||
nodereport.triggerReport(); | ||
var node-report = require('node-report/api'); | ||
node-report.triggerReport(); | ||
``` | ||
|
||
Content of the NodeReport consists of a header section containing the event | ||
Content of the node-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 node-report can be | ||
triggered using the Node.js REPL: | ||
|
||
``` | ||
$ node | ||
> nodereport = require('nodereport') | ||
> nodereport.triggerReport() | ||
Writing Node.js report to file: NodeReport.20161020.091102.8480.001.txt | ||
> node-report = require('node-report') | ||
> node-report.triggerReport() | ||
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 node-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. | ||
|
||
```js | ||
nodereport.triggerReport("myReportName"); | ||
node-report.triggerReport("myReportName"); | ||
``` | ||
|
||
## Configuration | ||
|
||
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.setCoreDump("yes|no"); | ||
nodereport.setVerbose("yes|no"); | ||
node-report.setEvents("exception+fatalerror+signal+apicall"); | ||
node-report.setSignal("SIGUSR2|SIGQUIT"); | ||
node-report.setFileName("stdout|stderr|<filename>"); | ||
node-report.setDirectory("<full path>"); | ||
node-report.setCoreDump("yes|no"); | ||
node-report.setVerbose("yes|no"); | ||
``` | ||
|
||
Configuration on module Initialization is also available via environment variables: | ||
|
||
```bash | ||
export NODEREPORT_EVENTS=exception+fatalerror+signal+apicall | ||
export NODEREPORT_SIGNAL=SIGUSR2|SIGQUIT | ||
export NODEREPORT_FILENAME=stdout|stderr|<filename> | ||
export NODEREPORT_DIRECTORY=<full path> | ||
export NODEREPORT_COREDUMP=yes|no | ||
export NODEREPORT_VERBOSE=yes|no | ||
export NODE_REPORT_EVENTS=exception+fatalerror+signal+apicall | ||
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. These don't have to be changed. Its the module name that is punctuated, we don't have to punctuate the env var names |
||
export NODE_REPORT_SIGNAL=SIGUSR2|SIGQUIT | ||
export NODE_REPORT_FILENAME=stdout|stderr|<filename> | ||
export NODE_REPORT_DIRECTORY=<full path> | ||
export NODE_REPORT_COREDUMP=yes|no | ||
export NODE_REPORT_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 node-reports generated from these events you can run the | ||
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. "of reports generated" |
||
demonstration applications provided in the node-report github repository. These are | ||
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. "in the github repository" |
||
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` - node-report triggered by JavaScript API call. | ||
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. for all |
||
2. `exception.js` - node-report triggered by unhandled exception. | ||
3. `fatalerror.js` - node-report triggered by fatal error on JavaScript heap out of memory. | ||
4. `loop.js` - looping application, node-report triggered using kill `-USR2 <pid>`. | ||
|
||
## License | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,7 @@ | |
}], | ||
], | ||
"defines": [ | ||
'NODEREPORT_VERSION="<!(node -p \"require(\'./package.json\').version\")"' | ||
'NODE_REPORT_VERSION="<!(node -p \"require(\'./package.json\').version\")"' | ||
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. can revert, IMO |
||
], | ||
}, | ||
{ | ||
|
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 node-report via API call | ||
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. generation of report via API call |
||
var node-report = require('node-report'); | ||
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. revert, this is syntactically invalid |
||
var http = require("http"); | ||
|
||
var count = 0; | ||
|
@@ -8,13 +8,13 @@ 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 node-report"); | ||
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. "Running API demo... refresh page to trigger report" |
||
response.end(); | ||
break; | ||
case 1: | ||
response.writeHead(200,{"Content-Type": "text/plain"}); | ||
// Call the nodereport module to trigger a NodeReport | ||
var filename = nodereport.triggerReport(); | ||
// Call the node-report module to trigger a node-report | ||
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. "// Excplicit call to trigger a report" |
||
var filename = node-report.triggerReport(); | ||
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. invalid, revert |
||
response.write("\n" + filename + " written - refresh page to close"); | ||
response.end(); | ||
break; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
// Example - generation of NodeReport on uncaught exception | ||
require('nodereport').setEvents("exception"); | ||
// Example - generation of node-report on uncaught exception | ||
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. "generation of report on" |
||
require('node-report').setEvents("exception"); | ||
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 exception demo... refresh page to cause exception (application will terminate)"); | ||
response.write("\nRunning node-report exception demo... refresh page to cause exception (application will terminate)"); | ||
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. "Running exception demo" |
||
response.end(); | ||
break; | ||
default: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
// Example - generation of Nodereport on fatal error (Javascript heap OOM) | ||
require('nodereport').setEvents("fatalerror"); | ||
// Example - generation of node-report on fatal error (Javascript heap OOM) | ||
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. "generation of report on" 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. I won't keep mentioning this. A report is a "report" not a "NodeReport" or a "node-report". |
||
require('node-report').setEvents("fatalerror"); | ||
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 fatal error demo... refresh page to trigger excessive memory usage (application will terminate)"); | ||
response.write("\nRunning node-report fatal error demo... refresh page to trigger excessive memory usage (application will terminate)"); | ||
response.end(); | ||
break; | ||
case 1: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
// Main module entry point for nodereport | ||
// Main module entry point for node-report | ||
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. "// main module entry point" |
||
|
||
const api = require('./api'); | ||
|
||
// NODEREPORT_EVENTS env var overrides the defaults | ||
const options = process.env.NODEREPORT_EVENTS || 'exception+fatalerror+signal+apicall'; | ||
// NODE_REPORT_EVENTS env var overrides the defaults | ||
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. revert, unnecessary to change this |
||
const options = process.env.NODE_REPORT_EVENTS || 'exception+fatalerror+signal+apicall'; | ||
api.setEvents(options); | ||
|
||
exports.triggerReport = api.triggerReport; | ||
|
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.
If we're updating this file, https://github.com/nodejs/nodereport/blob/master/AUTHORS no longer exists (it was removed by #13).