Commit b4c3aaa 1 parent 675429f commit b4c3aaa Copy full SHA for b4c3aaa
File tree 2 files changed +36
-1
lines changed
2 files changed +36
-1
lines changed Original file line number Diff line number Diff line change 4
4
5
5
There are next changes:
6
6
7
+ ## 1.2.17
8
+
9
+ There are next changes:
10
+
11
+ - made /profiler/method-used-apps.json compatible to phpstorm plugin
12
+
7
13
## 1.2.16
8
14
9
15
There are next changes:
Original file line number Diff line number Diff line change 133
133
134
134
/** @var \Badoo\LiveProfilerUI\Pages\AjaxPages $Page */
135
135
$ Page = $ App ->getPage ('ajax_pages ' );
136
+ $ method_data = $ Page ->getMethodUsedApps ($ method );
136
137
137
- echo json_encode ($ Page ->getMethodUsedApps ($ method ));
138
+ $ result = [];
139
+ if ($ method_data ) {
140
+ foreach ($ method_data as $ item ) {
141
+ if (empty ($ item ['fields ' ]) || empty ($ item ['fields ' ]['calls_count ' ])) {
142
+ continue ;
143
+ }
144
+
145
+ $ item ['cpu ' ] = $ item ['fields ' ]['cpu ' ] / 1000 ;
146
+ $ item ['ct ' ] = $ item ['fields ' ]['ct ' ];
147
+ $ item ['calls_count ' ] = (int )$ item ['fields ' ]['calls_count ' ];
148
+ unset($ item ['fields ' ]);
149
+ // Keep 1 app with maximum cpu
150
+ if (isset ($ result [$ item ['app ' ]]) && $ result [$ item ['app ' ]]['cpu ' ] > $ item ['cpu ' ]) {
151
+ continue ;
152
+ }
153
+ $ result [$ item ['app ' ]] = $ item ;
154
+ }
155
+
156
+ uasort (
157
+ $ result ,
158
+ static function ($ a , $ b ) {
159
+ return $ b ['cpu ' ] <=> $ a ['cpu ' ];
160
+ }
161
+ );
162
+
163
+ $ result = array_values ($ result );
164
+ }
165
+
166
+ echo json_encode ($ result );
138
167
break ;
139
168
140
169
case '/profiler/all-methods.json ' :
You can’t perform that action at this time.
0 commit comments