Skip to content
This repository has been archived by the owner on Jun 18, 2021. It is now read-only.

Commit

Permalink
chore: rename nodereport to node-report
Browse files Browse the repository at this point in the history
  • Loading branch information
George Adams committed Jan 12, 2017
1 parent c6db073 commit 7a9cf0d
Show file tree
Hide file tree
Showing 27 changed files with 265 additions and 265 deletions.
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
/node_modules/

# Package files
NodeReport*.txt
node-report*.txt
npm-debug.log
nodereport-*.tgz
nodereport_test.log
node-report-*.tgz
node-report_test.log
4 changes: 2 additions & 2 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
2016-12-12, Version 1.0.7
=========================

* Fix version reporting in NodeReport section (Richard Lau)
* Fix version reporting in node-report section (Richard Lau)

* Fix fprintf calls on Windows (Richard Lau)

Expand All @@ -23,7 +23,7 @@

* Fix for failure in fatal error (OOM) test (Richard Chamberlain)

* Add support for nodereport on AIX (Richard Chamberlain)
* Add support for node-report on AIX (Richard Chamberlain)

* Deleting AUTHORS file. (Richard Chamberlain)

Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Contributing to nodereport
# Contributing to node-report

## Code of Conduct

Expand All @@ -8,7 +8,7 @@ The [Node.js Code of Conduct][] applies to this repo.

## Code Contributions

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

Expand Down
4 changes: 2 additions & 2 deletions GOVERNANCE.md
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.
4 changes: 2 additions & 2 deletions LICENCE.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
The MIT License (MIT)
=====================

Copyright (c) 2016 nodereport contributors
Copyright (c) 2016 node-report contributors
--------------------------------------------------

*nodereport contributors listed at <https://github.com/nodejs/nodereport/blob/master/AUTHORS>*
*node-report contributors listed at <https://github.com/nodejs/node-report/blob/master/AUTHORS>*

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Expand Down
8 changes: 4 additions & 4 deletions MAINTAINER.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
68 changes: 34 additions & 34 deletions README.md
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.

Expand All @@ -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');
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
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
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` - node-report triggered by JavaScript API call.
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

Expand Down
2 changes: 1 addition & 1 deletion binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
}],
],
"defines": [
'NODEREPORT_VERSION="<!(node -p \"require(\'./package.json\').version\")"'
'NODE_REPORT_VERSION="<!(node -p \"require(\'./package.json\').version\")"'
],
},
{
Expand Down
10 changes: 5 additions & 5 deletions demo/api_call.js
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
var node-report = require('node-report');
var http = require("http");

var count = 0;
Expand All @@ -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");
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
var filename = node-report.triggerReport();
response.write("\n" + filename + " written - refresh page to close");
response.end();
break;
Expand Down
6 changes: 3 additions & 3 deletions demo/exception.js
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
require('node-report').setEvents("exception");
var http = require("http");

var count = 0;
Expand All @@ -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)");
response.end();
break;
default:
Expand Down
6 changes: 3 additions & 3 deletions demo/fatalerror.js
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)
require('node-report').setEvents("fatalerror");
var http = require('http');

var count = 0;
Expand All @@ -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:
Expand Down
12 changes: 6 additions & 6 deletions demo/loop.js
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 - geneation of node-report via signal for a looping application
require('node-report').setEvents("signal");
var http = require("http");

var count = 0;
Expand All @@ -8,12 +8,12 @@ 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("\n\nRefresh page to enter loop, then use 'kill -USR2 " + process.pid + "' to trigger NodeReport");
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 node-report");
response.end();
break;
case 1:
console.log("loop.js: going to loop now, use 'kill -USR2 " + process.pid + "' to trigger NodeReport");
console.log("loop.js: going to loop now, use 'kill -USR2 " + process.pid + "' to trigger node-report");
var list = [];
for (var i=0; i<10000000000; i++) {
for (var j=0; i<1000; i++) {
Expand All @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions index.js
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

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
const options = process.env.NODE_REPORT_EVENTS || 'exception+fatalerror+signal+apicall';
api.setEvents(options);

exports.triggerReport = api.triggerReport;
Expand Down
10 changes: 5 additions & 5 deletions package.json
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 node-report",
"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"
Expand All @@ -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"
Expand Down
Loading

0 comments on commit 7a9cf0d

Please sign in to comment.