Skip to content

Commit

Permalink
Including dtrace.sh for local dev, swapping forEach() with each()
Browse files Browse the repository at this point in the history
  • Loading branch information
avoidwork committed Feb 27, 2019
1 parent b3782c7 commit 5009846
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 5 deletions.
1 change: 0 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
.eslintrc
.gitignore
.travis.yml
dtrace.sh
Gruntfile.js
sample.js
sample2.js
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ This is a sample configuration for Tensō, without authentication or SSL. This w
"auth": {}, /* Optional, see Authentication section */
"cacheSize": 1000, /* Optional, size of Etag & route LRU caches */
"cacheTTL": 0, /* Optional, TTL of items in Etag & route LRU caches */
"dtrace": false, /* Optional, enables DTrace probes (see dtrace.sh) */
"headers": {}, /* Optional, custom headers */
"hostname": "localhost", /* Optional, default is 'localhost' */
"http2": false, /* Middleware signatures do not change, see woodland */
Expand Down Expand Up @@ -234,6 +235,9 @@ Tensō uses [passport-saml](https://github.com/bergie/passport-saml), for config
}
```

## DTrace
DTrace probes are in a set of core functions, which can be enabled by setting `dtrace: true` for factory options, and watched with `dtrace.sh`; not recommended for production.

## ETags
Generates `ETag` headers for `GET` requests

Expand Down
6 changes: 4 additions & 2 deletions lib/dtrace.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
"use strict";

const d = require("dtrace-provider");
const path = require("path"),
d = require("dtrace-provider"),
{each} = require(path.join(__dirname, "utility.js"));

module.exports = (id, ...probes) => {
const dtp = d.createDTraceProvider(id);

probes.forEach(p => dtp.addProbe(...p));
each(probes, p => dtp.addProbe(...p));

return dtp;
};
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "tenso",
"description": "Tensō is an HTTP/HTTP2 REST API framework",
"version": "10.4.0",
"version": "10.4.1",
"homepage": "http://avoidwork.github.io/tenso",
"author": "Jason Mulligan <[email protected]>",
"repository": {
Expand Down

0 comments on commit 5009846

Please sign in to comment.