[Profiler] [Redis] Fix sort of profiler rows.
This commit is contained in:
parent
802426272f
commit
9257b0371c
@ -60,7 +60,7 @@ class RedisProfilerStorage implements ProfilerStorageInterface
|
||||
return array();
|
||||
}
|
||||
|
||||
$profileList = explode("\n", $indexContent);
|
||||
$profileList = array_reverse(explode("\n", $indexContent));
|
||||
$result = array();
|
||||
|
||||
foreach ($profileList as $item) {
|
||||
@ -78,7 +78,7 @@ class RedisProfilerStorage implements ProfilerStorageInterface
|
||||
continue;
|
||||
}
|
||||
|
||||
$result[$itemToken] = array(
|
||||
$result[] = array(
|
||||
'token' => $itemToken,
|
||||
'ip' => $itemIp,
|
||||
'method' => $itemMethod,
|
||||
@ -89,14 +89,6 @@ class RedisProfilerStorage implements ProfilerStorageInterface
|
||||
--$limit;
|
||||
}
|
||||
|
||||
usort($result, function($a, $b) {
|
||||
if ($a['time'] === $b['time']) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return $a['time'] > $b['time'] ? -1 : 1;
|
||||
});
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user