Skip to content

Commit b1f913a

Browse files
committed
mass commit, patch & add features
1 parent aa1b2b8 commit b1f913a

23 files changed

+1185
-322
lines changed

.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ phpcs.xml export-ignore
22
phpstan.neon export-ignore
33
.gitattributes export-ignore
44
.gitignore export-ignore
5-
package.json export-ignore
5+
package.json export-ignore
66
tsconfig.json export-ignore
77
webpack.config.js export-ignore
88
assets/ export-ignore

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,4 +88,5 @@ vendor/
8888
node_modules/
8989
tmp/
9090
.tmp/
91+
*.map
9192
/index.php

README.md

Lines changed: 80 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,55 @@
22

33
[![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)
44

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)
554

655
## ATTENTION
756

@@ -16,13 +65,10 @@ Typescript & scss [**[assets](assets)**] is used to create the UI, the UI is cre
1665

1766
### REQUIREMENT:
1867

19-
- NodeJS (npm)
20-
- TypeScript
21-
- Webpack
22-
- Sass
2368
- PHP 7.4 or higher
2469
- Composer
25-
70+
- DEV (Node.js (npm) - for installing the dependencies)
71+
-
2672
### TASKS
2773

2874
> BACKEND
@@ -38,23 +84,35 @@ Typescript & scss [**[assets](assets)**] is used to create the UI, the UI is cre
3884
- [x] ToolBar (Chrome Like)
3985
- [x] Dark Mode & Light Mode (Auto Detect)
4086
- [x] Resizeable
87+
- [ ] Responsiveness
4188
- [x] Action Size
4289
- [x] Maximize
4390
- [x] Minimize (restore)
4491
- [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
45103

46104
#### Benchmark Tab
47105

48-
- [ ] Filtering
106+
- [x] Filtering
49107
- [x] Importer
50108
- [x] Exporter
51109
- [x] Restorer
52110
- [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
58116
- [ ] Add additional information for certain table
59117
- [ ] Clickable to show the detail of the benchmark
60118

@@ -68,8 +126,17 @@ Typescript & scss [**[assets](assets)**] is used to create the UI, the UI is cre
68126

69127
#### Code Tab
70128

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/)
73140

74141

75142
## LICENSE

0 commit comments

Comments
 (0)