Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/av/tohu
Code tracing and instrumentation
https://github.com/av/tohu
chrome cool http instrumentation javascript javascript-library npm-module npm-package tool tracer utility
Last synced: 9 days ago
JSON representation
Code tracing and instrumentation
- Host: GitHub
- URL: https://github.com/av/tohu
- Owner: av
- License: mit
- Created: 2018-04-08T14:46:48.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-06-10T18:20:47.000Z (over 6 years ago)
- Last Synced: 2024-03-25T13:22:33.435Z (8 months ago)
- Topics: chrome, cool, http, instrumentation, javascript, javascript-library, npm-module, npm-package, tool, tracer, utility
- Language: JavaScript
- Homepage:
- Size: 47.9 KB
- Stars: 6
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
![TOHU](assets/logo.png?raw=true "TOHU")
--------
|Code| |Trace|
|:----:|:----:|:----:|
|![before](assets/code.png?raw=true "Code")|=>|![after](assets/trace.png?raw=true "Trace")|Some information is just not suitable to be presented as logs and requires different visualisation. Good example are http calls performed by a server during processing of incoming request or events in a distributed system coming in undetermenistic order and duration.
Tohu can help transforming such information into format compatible with Chrome's about://tracing, which is awesome frontend for any traces and available almost everywhere alongside with Chrome.#### Quickstart
- Install tohu
```bash
npm i tohu --save
```- Include it in your sources
```javascript
const tohu = require('tohu');// one eternity later
tohu.toFile('trace.json');
```- View results with chrome tracing frontend
- Open chrome://tracing in Google Chrome
- Click "Load" at top left corner
- Select trace file stored by tohu#### Config
Tohu supports following configuration options with `tohu.setup()` call:
```javascript
{
// Enable/disable internal logging of
// additional debug infor
quiet: true,
// When true, tohu will store request/response pair bodies
// for further analysis. Significantly increases trace file size.
storeBody: false,
// Allows to specify transport for loggins, transport should suppoort
// three levels as methods: debug, info, error
log: console,
// Defines output format of trace file. Defaults to Chrome's about://tracing
format: 'chrome-tracing',
// Filename to use for storing trace. Will be stored
// inside the same directory from which node.js programm was launched
file: 'tohu.json'
}
```