From feb5033a0ec2405301a9f33835786879e76318e2 Mon Sep 17 00:00:00 2001 From: Alexander Zobnin Date: Wed, 13 Apr 2016 23:40:39 +0300 Subject: [PATCH 1/2] Fixed #196 - Exponential lag on auto-updating dashboards. Disabled hosts and items cahching. --- src/datasource-zabbix/queryProcessor.service.js | 3 +-- src/datasource-zabbix/zabbixCache.service.js | 10 ++++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/datasource-zabbix/queryProcessor.service.js b/src/datasource-zabbix/queryProcessor.service.js index 35d2401..557b2f1 100644 --- a/src/datasource-zabbix/queryProcessor.service.js +++ b/src/datasource-zabbix/queryProcessor.service.js @@ -227,14 +227,13 @@ angular.module('grafana.services').factory('QueryProcessor', function($q) { * }, ... * ] */ - var self = this; // Group history by itemid var grouped_history = _.groupBy(history, 'itemid'); var hosts = _.indexBy(_.flatten(_.map(items, 'hosts')), 'hostid'); return _.map(grouped_history, function(hist, itemid) { - var item = self.cache.getItem(itemid); + var item = _.find(items, {'itemid': itemid}); var alias = item.name; if (_.keys(hosts).length > 1 || addHostName) { var host = hosts[item.hostid]; diff --git a/src/datasource-zabbix/zabbixCache.service.js b/src/datasource-zabbix/zabbixCache.service.js index 3092b08..e4c9868 100644 --- a/src/datasource-zabbix/zabbixCache.service.js +++ b/src/datasource-zabbix/zabbixCache.service.js @@ -87,10 +87,11 @@ angular.module('grafana.services').factory('ZabbixCachingProxy', function($q, $i } getHosts(groupids) { - var self = this; + //var self = this; return this.getHostsOnce(groupids) .then(hosts => { - self._hosts = _.union(self._hosts, hosts); + // iss #196 - disable caching due performance issues + //self._hosts = _.union(self._hosts, hosts); return hosts; }); } @@ -103,10 +104,11 @@ angular.module('grafana.services').factory('ZabbixCachingProxy', function($q, $i } getItems(hostids, appids, itemtype) { - var self = this; + //var self = this; return this.getItemsOnce(hostids, appids, itemtype) .then(items => { - self._items = _.union(self._items, items); + // iss #196 - disable caching due performance issues + //self._items = _.union(self._items, items); return items; }); } From 73c36d9844b1a294f3e06e79ce1cf75362abe297 Mon Sep 17 00:00:00 2001 From: Alexander Zobnin Date: Wed, 13 Apr 2016 23:48:17 +0300 Subject: [PATCH 2/2] Bump version - 3.0.0-beta6 --- src/plugin.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugin.json b/src/plugin.json index 717bfdd..cf4a2ca 100644 --- a/src/plugin.json +++ b/src/plugin.json @@ -24,8 +24,8 @@ {"name": "Docs", "url": "http://docs.grafana-zabbix.org"}, {"name": "License", "url": "https://github.com/alexanderzobnin/grafana-zabbix/blob/master/LICENSE.md"} ], - "version": "3.0.0-beta5", - "updated": "2016-04-12" + "version": "3.0.0-beta6", + "updated": "2016-04-13" }, "includes": [