https://github.com/envoy/ember-gjallarhorn
A library for timing things
https://github.com/envoy/ember-gjallarhorn
emberjs emberjs-addon
Last synced: 4 months ago
JSON representation
A library for timing things
- Host: GitHub
- URL: https://github.com/envoy/ember-gjallarhorn
- Owner: envoy
- License: mit
- Created: 2018-05-14T20:41:46.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2023-04-01T08:44:17.000Z (about 2 years ago)
- Last Synced: 2024-11-12T05:36:58.472Z (6 months ago)
- Topics: emberjs, emberjs-addon
- Language: JavaScript
- Homepage:
- Size: 479 KB
- Stars: 0
- Watchers: 20
- Forks: 0
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
ember-gjallarhorn
==============================================================================[](https://travis-ci.org/envoy/ember-gjallarhorn)
Inspired by [heimdalljs](https://github.com/heimdalljs/heimdalljs-lib), which is a very interesting approach to performance measurement that unfortunately appears to be blocked at the moment.
Trees of timers. Timer trees. A timer forest?
Create timers in your code:
```js
load: task(function*() {
let timer = new Timer('service:state:load');
timer.start();
yield timeout(75);let foo = timer.startChild('foo');
yield timeout(100);let bar = foo.startChild('bar');
bar.startChild('baz');
yield timeout(50);
bar.stopChild('baz');bar.startChild('baq')
yield timeout(150);timer.stop(); // Stop this timer and all children
console.log(JSON.stringify(timer.toJSON()));
})
```Get JSON output:
```JSON
{
"name": "service:state:load",
"duration": 384.50000000012,
"children": [
{
"name": "service:state:load:foo",
"duration": 305.39999999746,
"children": [
{
"name": "service:state:load:foo:bar",
"duration": 204.79999999952,
"children": [
{
"name": "service:state:load:foo:bar:baz",
"duration": 54.000000003725
},
{
"name": "service:state:load:foo:bar:baq",
"duration": 150.69999999832
}
]
}
]
}
]
}
```Installation
------------------------------------------------------------------------------```
ember install ember-gjallarhorn
```Usage
------------------------------------------------------------------------------[Longer description of how to use the addon in apps.]
Contributing
------------------------------------------------------------------------------### Installation
* `git clone `
* `cd ember-gjallarhorn`
* `yarn install`### Linting
* `yarn lint:js`
* `yarn lint:js --fix`### Running tests
* `ember test` – Runs the test suite on the current Ember version
* `ember test --server` – Runs the test suite in "watch mode"
* `ember try:each` – Runs the test suite against multiple Ember versions### Running the dummy application
* `ember serve`
* Visit the dummy application at [http://localhost:4200](http://localhost:4200).For more information on using ember-cli, visit [https://ember-cli.com/](https://ember-cli.com/).
License
------------------------------------------------------------------------------This project is licensed under the [MIT License](LICENSE.md).