-
Incident report
-
Resolution: Fixed
-
Trivial
-
2.2.4
according to ZBX-7373, getting latest values is faster.
But via API, it is still slow.
It seems, the CItem class do not passe the "period", to HistoryManager->getLast()
public function getLast(array $items, $limit = 1, $period = null)
if ($requestedOutput) {
- $history = Manager::History()->getLast($result, 2);
+ $history = Manager::History()->getLast($result, 2, 3600);
foreach ($result as &$item) {
$lastHistory = isset($history[$item['itemid']][0]) ? $history[$item['itemid']][0] : null;
$prevHistory = isset($history[$item['itemid']][1]) ? $history[$item['itemid']][1] : null;