| @@ 335-346 (lines=12) @@ | ||
| 332 | * @return string |
|
| 333 | * @throws Exception |
|
| 334 | */ |
|
| 335 | public function callgraphData() |
|
| 336 | { |
|
| 337 | $request = $this->app->request(); |
|
| 338 | $response = $this->app->response(); |
|
| 339 | $profile = $this->profiles->get($request->get('id')); |
|
| 340 | $metric = $request->get('metric') ?: 'wt'; |
|
| 341 | $threshold = (float)$request->get('threshold') ?: 0.01; |
|
| 342 | $callgraph = $profile->getCallgraph($metric, $threshold); |
|
| 343 | ||
| 344 | $response['Content-Type'] = 'application/json'; |
|
| 345 | return $response->body(json_encode($callgraph)); |
|
| 346 | } |
|
| 347 | ||
| 348 | /** |
|
| 349 | * @return string |
|
| @@ 351-362 (lines=12) @@ | ||
| 348 | /** |
|
| 349 | * @return string |
|
| 350 | */ |
|
| 351 | public function callgraphDataDot() |
|
| 352 | { |
|
| 353 | $request = $this->app->request(); |
|
| 354 | $response = $this->app->response(); |
|
| 355 | $profile = $this->profiles->get($request->get('id')); |
|
| 356 | $metric = $request->get('metric') ?: 'wt'; |
|
| 357 | $threshold = (float)$request->get('threshold') ?: 0.01; |
|
| 358 | $callgraph = $profile->getCallgraphNodes($metric, $threshold); |
|
| 359 | ||
| 360 | $response['Content-Type'] = 'application/json'; |
|
| 361 | return $response->body(json_encode($callgraph)); |
|
| 362 | } |
|
| 363 | } |
|
| 364 | ||