File tree 4 files changed +38
-18
lines changed
4 files changed +38
-18
lines changed Original file line number Diff line number Diff line change @@ -16,3 +16,14 @@ logMetrics(
16
16
)
17
17
);
18
18
```
19
+
20
+ ![ ] ( https://user-images.githubusercontent.com/516342/49897016-9af59700-fe5d-11e8-9af3-9013809a6a94.png )
21
+
22
+ Or take a glance at your own machine
23
+ ```
24
+ npm i -g perfrep
25
+
26
+ perfrep
27
+ ```
28
+
29
+ ![ ] ( https://user-images.githubusercontent.com/516342/49897116-e740d700-fe5d-11e8-8d59-903bbaf73cfe.png )
Original file line number Diff line number Diff line change
1
+ #!/usr/bin/env node
2
+
3
+ process . on ( 'unhandledRejection' , console . error ) ;
4
+
5
+ const perfrep = require ( '../' ) ;
6
+
7
+ ( async ( ) => {
8
+ const perf = await perfrep ( ) ;
9
+ console . log (
10
+ Object . entries ( perf ) . map (
11
+ ( [ key , value ] ) => `• ${ key } : ${ value } %`
12
+ ) . concat ( '' ) . join ( '\n' )
13
+ ) ;
14
+ } ) ( ) ;
Original file line number Diff line number Diff line change
1
+ const percent = require ( '@does/percent' ) ;
2
+ const wait = require ( '@lets/wait' ) ;
3
+
1
4
const {
2
5
cpus,
3
6
freemem,
@@ -35,18 +38,3 @@ const info = () => cpus().reduce(
35
38
total : 0 ,
36
39
}
37
40
) ;
38
-
39
- /**
40
- * A waiting promise
41
- * @param {Number } ms
42
- * @return {Promise }
43
- */
44
- const wait = ms => new Promise ( resolve => setTimeout ( resolve , ms ) ) ;
45
-
46
- /**
47
- * Calculate percent of a pert from the whole
48
- * @param {Number } part
49
- * @param {Number } whole
50
- * @return {Number }
51
- */
52
- const percent = ( part , whole ) => Math . round ( part / whole * 100 ) ;
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " perfrep" ,
3
- "version" : " 0.1 .0" ,
4
- "description" : " Host Performance Report in Percent" ,
3
+ "version" : " 0.2 .0" ,
4
+ "description" : " 🐎 Host Performance Report in Percent" ,
5
5
"keywords" : [
6
6
" cpu" ,
7
7
" heap" ,
11
11
" report" ,
12
12
" monitoring" ,
13
13
" usage" ,
14
- " stats"
14
+ " stats" ,
15
+ " 🐎"
15
16
],
16
17
"author" : " omrilotan" ,
17
18
"license" : " MIT" ,
21
22
},
22
23
"homepage" : " https://omrilotan.com/mono/perfrep/" ,
23
24
"main" : " index.js" ,
25
+ "bin" : " bin/index.js" ,
24
26
"scripts" : {
27
+ "start" : " node bin" ,
25
28
"test" : " cd ../../; npm t perfrep; cd -"
29
+ },
30
+ "dependencies" : {
31
+ "@does/percent" : " 0.0.2" ,
32
+ "@lets/wait" : " 0.0.0"
26
33
}
27
34
}
You can’t perform that action at this time.
0 commit comments