Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-8428

slow API Items->get() with output extended

XMLWordPrintable

      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)

      { Quick & dirty patch: diff -ru zabbix-2.2.4/api/classes/CItem.php zabbix-dev-2.2.4/api/classes /CItem.php --- zabbix-2.2.4/api/classes/CItem.php 2014-07-02 12:41:20.901291000 +0200 +++ zabbix-dev-2.2.4/api/classes/CItem.php 2014-07-02 13:59:42.104836000 +0200 @@ -1202,7 +1202,7 @@ $requestedOutput['prevvalue'] = true; }


      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;

            Unassigned Unassigned
            dakol dakol
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: