Skip to content

Commit

Permalink
Identifying as tenso in logging strategies, created dtrace.sh to …
Browse files Browse the repository at this point in the history
…convenient probe output
  • Loading branch information
avoidwork committed Nov 22, 2014
1 parent bdc0d41 commit 156aa0f
Show file tree
Hide file tree
Showing 10 changed files with 38 additions and 18 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

## 0.9.25
- Identifying as `tenso` in logging strategies
- Created `dtrace.sh` to convenient probe output

## 0.9.24
- Fixing pluralization of hypermedia keys

Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ This is a sample configuration for Tensō, without authentication or SSL. This w
"hostname": "localhost", /* Optional, default is 'localhost' */
"json": 2, /* Optional, default indent for 'pretty' JSON */
"logs": { /* Optional */
"level": "info",
"level": "debug",
"stdout": true,
"dtrace": false,
"syslog": false
"dtrace": true,
"syslog": true
},
"port": 8000, /* Optional, default is 8000 */
"routes": require( "./routes.js" ), /* Required! */
Expand Down Expand Up @@ -312,7 +312,7 @@ A 'max byte' limit can be enforced on all routes that handle `PATCH`, `POST`, &
Standard log levels are supported, and are emitted (by configuration) to `stdout` & `stderr`, & `syslog`.

## DTrace
DTrace probes can be enabled by configuration (disabled by default). A shell script is available at `./node_modules/turtle.io/dtrace.sh` to observe the probes.
DTrace probes can be enabled by configuration (disabled by default). A shell script is available at `./dtrace.sh` to observe the probes.
The last argument for each probe is the nanoseconds it took to execute.

```
Expand Down
1 change: 1 addition & 0 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
},
"compress": true,
"hostname": "127.0.0.1",
"id": "tenso",
"json": 2,
"logs": {
"dtrace": false,
Expand Down
2 changes: 1 addition & 1 deletion doc/global.html
Original file line number Diff line number Diff line change
Expand Up @@ -1826,7 +1826,7 @@ <h5>Returns:</h5>

<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.2</a>
on 2014-11-18T20:01:48-05:00 using the <a
on 2014-11-22T07:47:06-05:00 using the <a
href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span>
</footer>
Expand Down
10 changes: 5 additions & 5 deletions doc/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,10 @@ <h2>Configuration</h2>
&quot;hostname&quot;: &quot;localhost&quot;, /* Optional, default is 'localhost' */
&quot;json&quot;: 2, /* Optional, default indent for 'pretty' JSON */
&quot;logs&quot;: { /* Optional */
&quot;level&quot;: &quot;info&quot;,
&quot;level&quot;: &quot;debug&quot;,
&quot;stdout&quot;: true,
&quot;dtrace&quot;: false,
&quot;syslog&quot;: false
&quot;dtrace&quot;: true,
&quot;syslog&quot;: true
},
&quot;port&quot;: 8000, /* Optional, default is 8000 */
&quot;routes&quot;: require( &quot;./routes.js&quot; ), /* Required! */
Expand Down Expand Up @@ -348,7 +348,7 @@ <h2>Limiting upload size</h2>
<h2>Logging</h2>
<p>Standard log levels are supported, and are emitted (by configuration) to <code>stdout</code> &amp; <code>stderr</code>, &amp; <code>syslog</code>.</p>
<h2>DTrace</h2>
<p>DTrace probes can be enabled by configuration (disabled by default). A shell script is available at <code>./node_modules/turtle.io/dtrace.sh</code> to observe the probes.
<p>DTrace probes can be enabled by configuration (disabled by default). A shell script is available at <code>./dtrace.sh</code> to observe the probes.
The last argument for each probe is the nanoseconds it took to execute.</p>
<pre><code>&quot;allowed&quot;, &quot;char *&quot;, &quot;char *&quot;, &quot;char *&quot;, &quot;int&quot;
&quot;allows&quot;, &quot;char *&quot;, &quot;char *&quot;, &quot;int&quot;
Expand Down Expand Up @@ -386,7 +386,7 @@ <h2>License</h2>

<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.2</a>
on 2014-11-18T20:01:49-05:00 using the <a
on 2014-11-22T07:47:06-05:00 using the <a
href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span>
</footer>
Expand Down
4 changes: 2 additions & 2 deletions doc/module-tenso.html
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ <h2>
<dt class="tag-version">Version:</dt>
<dd class="tag-version">
<ul class="dummy">
<li>0.9.24</li>
<li>0.9.25</li>
</ul>
</dd>

Expand Down Expand Up @@ -218,7 +218,7 @@ <h2>

<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.2</a>
on 2014-11-18T20:01:49-05:00 using the <a
on 2014-11-22T07:47:06-05:00 using the <a
href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span>
</footer>
Expand Down
2 changes: 1 addition & 1 deletion doc/modules.list.html
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ <h2>

<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.2</a>
on 2014-11-18T20:01:48-05:00 using the <a
on 2014-11-22T07:47:06-05:00 using the <a
href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span>
</footer>
Expand Down
15 changes: 15 additions & 0 deletions dtrace.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash

sudo dtrace -Z -n 'tenso*:::allowed{ trace(copyinstr(arg0)); trace(copyinstr(arg1)); trace(copyinstr(arg2)); trace(arg3); }' \
-n 'tenso*:::allows{ trace(copyinstr(arg0)); trace(copyinstr(arg1)); trace(arg2); }' \
-n 'tenso*:::compress{ trace(copyinstr(arg0)); trace(copyinstr(arg1)); trace(arg2); }' \
-n 'tenso*:::compression{ trace(copyinstr(arg0)); trace(arg1); }' \
-n 'tenso*:::error{ trace(copyinstr(arg0)); trace(copyinstr(arg1)); trace(arg2); trace(copyinstr(arg3)); trace(arg4); }' \
-n 'tenso*:::headers{ trace(arg0); trace(arg1); }' \
-n 'tenso*:::log{ trace(copyinstr(arg0)); trace(arg1); trace(arg2); trace(arg3); }' \
-n 'tenso*:::proxy{ trace(copyinstr(arg0)); trace(copyinstr(arg1)); trace(copyinstr(arg2)); trace(copyinstr(arg3)); trace(arg4); }' \
-n 'tenso*:::middleware{ trace(copyinstr(arg0)); trace(copyinstr(arg1)); trace(arg2); }' \
-n 'tenso*:::request{ trace(copyinstr(arg0)); trace(arg1); }' \
-n 'tenso*:::respond{ trace(copyinstr(arg0)); trace(copyinstr(arg1)); trace(copyinstr(arg2)); trace(arg3); trace(arg4); }' \
-n 'tenso*:::status{ trace(arg0); trace(arg1); trace(arg2); trace(arg3); trace(arg4); }' \
-n 'tenso*:::write{ trace(copyinstr(arg0)); trace(copyinstr(arg1)); trace(copyinstr(arg2)); trace(copyinstr(arg3)); trace(arg4); }'
6 changes: 3 additions & 3 deletions lib/tenso.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
* @license BSD-3 <https://raw.github.com/avoidwork/tenso/master/LICENSE>
* @link http://avoidwork.github.io/tenso
* @module tenso
* @version 0.9.24
* @version 0.9.25
*/
( function () {
"use strict";

var turtleio = require( "turtle.io" ),
SERVER = "tenso/0.9.24",
SERVER = "tenso/0.9.25",
CONFIG = require( __dirname + "/../config.json" ),
keigai = require( "keigai" ),
util = keigai.util,
Expand Down Expand Up @@ -65,7 +65,7 @@ function Tenso () {
this.rates = {};
this.server = turtleio();
this.server.tenso = this;
this.version = "0.9.24";
this.version = "0.9.25";
}

/**
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "tenso",
"description": "Tensō is a REST API facade for node.js, designed to simplify the implementation of APIs.",
"version": "0.9.24",
"version": "0.9.25",
"homepage": "http://avoidwork.github.io/tenso",
"author": {
"name": "Jason Mulligan",
Expand Down Expand Up @@ -29,7 +29,7 @@
},
"dependencies": {
"keigai": "~0.9.0",
"turtle.io": "~3.1.5",
"turtle.io": "~3.1.6",
"cookie-parser": "~1.3.3",
"express-session": "~1.8.2",
"passport": "~0.2.0",
Expand Down

0 comments on commit 156aa0f

Please sign in to comment.