2
2
3
3
[ ![ Code Checking] ( https://github.com/ArrayIterator/php.profiler/actions/workflows/code-checking.yml/badge.svg )] ( https://github.com/ArrayIterator/php.profiler/actions/workflows/code-checking.yml )
4
4
5
+ ## INSTALLATION
6
+
7
+ ``` bash
8
+ composer require arrayiterator/profiler
9
+ ```
10
+ ## PROFILING
11
+
12
+ ``` php
13
+ use ArrayIterator\Profiler\Profiler;
14
+
15
+ $profiler = new Profiler();
16
+ // start the profiler
17
+ $performance = $profiler->start('benchmark', 'Group Name', ['data' => 'information']);
18
+ try {
19
+ // do something with the code
20
+ // write the code that you want to benchmark
21
+ } finally {
22
+ // best practice to stop the profiler using try -> finally
23
+ // using finally to make sure the profiler is stopped
24
+ $performance->stop(['additional' => 'information']);
25
+ // or using profiler object
26
+ // the group name is important when you have different group of benchmark
27
+ // the group: default, as default group
28
+ // the name of benchmark also important to identify the benchmark
29
+ $profiler->stop('benchmark', 'Group Name', ['additional' => 'information']);
30
+ }
31
+
32
+
33
+ ```
34
+ ## RENDERING TOOLBAR
35
+
36
+ ``` php
37
+ /**
38
+ * @var \ArrayIterator\Profiler\Profiler $profiler
39
+ */
40
+ $waterfall = $profiler->getWaterfall();
41
+
42
+ // render the toolbar
43
+ $darkMode = null; // set true if default dark mode or let it null when using autodetect
44
+ $content = $waterfall->renderJs($darkMode);
45
+
46
+ // can be echo or append to stream
47
+ // echo $content;
48
+ // append to stream interface (PSR-7)
49
+ // $response->getBody()->write($content);
50
+ ```
51
+ ## PREVIEW
52
+
53
+ [ ![ Toolbar Preview] ( images/preview-dark.png )] ( images/preview-dark.png )
5
54
6
55
## ATTENTION
7
56
@@ -16,13 +65,10 @@ Typescript & scss [**[assets](assets)**] is used to create the UI, the UI is cre
16
65
17
66
### REQUIREMENT:
18
67
19
- - NodeJS (npm)
20
- - TypeScript
21
- - Webpack
22
- - Sass
23
68
- PHP 7.4 or higher
24
69
- Composer
25
-
70
+ - DEV (Node.js (npm) - for installing the dependencies)
71
+ -
26
72
### TASKS
27
73
28
74
> BACKEND
@@ -38,23 +84,35 @@ Typescript & scss [**[assets](assets)**] is used to create the UI, the UI is cre
38
84
- [x] ToolBar (Chrome Like)
39
85
- [x] Dark Mode & Light Mode (Auto Detect)
40
86
- [x] Resizeable
87
+ - [ ] Responsiveness
41
88
- [x] Action Size
42
89
- [x] Maximize
43
90
- [x] Minimize (restore)
44
91
- [x] Close
92
+ - [x] Benchmark Tab
93
+ - [x] Filtering
94
+ - [ ] Waterfall Profiling
95
+ - [x] Importer
96
+ - [x] Exporter
97
+ - [x] Restorer
98
+ - [x] Message (information about the import, export, restore)
99
+ - [x] Input Search
100
+ - [x] Horizontal Resizable Section
101
+ - [ ] Info Tab
102
+ - [x] Code Tab
45
103
46
104
#### Benchmark Tab
47
105
48
- - [ ] Filtering
106
+ - [x ] Filtering
49
107
- [x] Importer
50
108
- [x] Exporter
51
109
- [x] Restorer
52
110
- [x] Message (information about the import, export, restore)
53
- - [ ] General Filter
54
- - [ ] Performance Filter (Slow, Fast, Average)
55
- - [ ] Search Filter (Follow the benchmark content)
56
- - [ ] Waterfall Profiling
57
- - [ ] Using waterfall using div percentage
111
+ - [x ] General Filter
112
+ - [x ] Performance Filter (Slow, Fast, Average)
113
+ - [x ] Search Filter (Follow the benchmark content)
114
+ - [x ] Waterfall Profiling
115
+ - [x ] Using waterfall using div percentage
58
116
- [ ] Add additional information for certain table
59
117
- [ ] Clickable to show the detail of the benchmark
60
118
@@ -68,8 +126,17 @@ Typescript & scss [**[assets](assets)**] is used to create the UI, the UI is cre
68
126
69
127
#### Code Tab
70
128
71
- - [ ] Code Section
72
- - [ ] Show collapsible code (pre of json)
129
+ - [x] Code Section
130
+ - [x] Show collapsible code (pre of json)
131
+
132
+
133
+ ## DEPENDENCIES
134
+
135
+ - Template Engine using [ SquirrellyJS] ( https://squirrelly.js.org/ )
136
+ - Chart using [ HighChart] ( https://www.highcharts.com/ )
137
+ - Icon & SVG using [ HeroIcons] ( https://heroicons.com/ )
138
+ - Compiled JS using [ Webpack] ( https://webpack.js.org/ ) & [ TypeScript] ( https://www.typescriptlang.org/ )
139
+ - Compiled CSS using [ Sass] ( https://sass-lang.com/ )
73
140
74
141
75
142
## LICENSE
0 commit comments