You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The ember version of [appmetrics.js](https://github.com/ebidel/appmetrics.js). Used to measure various things in your Ember app with ever simple APIs.
5
+
Ember library used to measure various metrics in your Ember app with ultra simple APIs. Especially useful for [RUM](https://en.wikipedia.org/wiki/Real_user_monitoring) in Ember SPAs.
6
6
7
-
## Installation
7
+
## Installation 💻
8
8
For Ember CLI >= `0.2.3`:
9
9
```shell
10
10
ember install ember-appmetrics
@@ -17,14 +17,22 @@ ember install:addon ember-appmetrics
17
17
## Compatibility
18
18
This addon is tested against the latest stable Ember version.
19
19
20
-
## Usage
20
+
## Usage 🏹
21
21
22
22
Inject the metrics service like `'metrics: Ember.inject.service()'` into the class where you want to measure the performance or use initializers if you are going with one-time injection.
23
23
24
-
Addon provides three API to measure the performace of a given period.
25
-
-`start` : need to call this api with an event name as argument to mark the starting point
26
-
-`end` : need to call this api with an event name as argument to mark the ending point
27
-
-`measure` : will return the calculated time for the given event
24
+
Addon provides three API for measuring the performance of a given period.
25
+
-`start` : need to call this API with an event name as an argument to mark the starting point.
26
+
-`end` : need to call this API with an event name as an argument to mark the ending point and it returns the duration for the corresponding mark.
27
+
-`measure` : will return the latest calculated time for the given event. This API will be deprecated in the future release in the favor of `end` API as the `end` method itself return the duration.
28
+
29
+
30
+
-`getAllMetrics` :
31
+
32
+
1. will return an object containing all the previously measured metrics and its duration, if no arguments were passed.
33
+
2. will return an array containing all the duration for the given metric name if the metric name is given as arguments.
34
+
35
+
-`clearAllMetrics` : Will clear out all the performance marks and measures.
28
36
29
37
```js
30
38
this.get('metrics').start('accounts_page');
@@ -35,24 +43,24 @@ Addon provides three API to measure the performace of a given period.
35
43
});
36
44
```
37
45
38
-
## Browser support
46
+
## Browser support 🌏
39
47
40
-
Since fall back machanism of all level has been handled in addon itself, the only thing addon needs is that the browser must have Date API, which is supported in all major and minor browsers.
48
+
Since fall back mechanism of all level has been handled in the addon itself, the only thing addon need is that the browser must have Date API, which is supported in all major and minor browsers.
41
49
42
50
PS: In Safari, the User Timing API (performance.mark()) is not available, so the DevTools timeline will not be annotated with marks.
43
51
44
-
## Installation
52
+
## Installation 💻
45
53
46
54
*`git clone` this repository
47
55
*`npm install`
48
56
*`bower install`
49
57
50
-
## Running
58
+
## Running 👟👟
51
59
52
60
*`ember server`
53
-
* Visit your app at http://localhost:4200.
61
+
* Visit your app at http://localhost:4301.
54
62
55
-
## Running Tests
63
+
## Running Tests 💉
56
64
57
65
*`ember test`
58
66
*`ember test --server`
@@ -62,3 +70,7 @@ PS: In Safari, the User Timing API (performance.mark()) is not available, so the
62
70
*`ember build`
63
71
64
72
For more information on using ember-cli, visit [http://www.ember-cli.com/](http://www.ember-cli.com/).
73
+
74
+
## Contribution 👨👧👦
75
+
76
+
Missing something? Let's work together to get that done 😉
0 commit comments