Merge branch 'develop'

This commit is contained in:
Alexander Zobnin
2016-04-13 23:48:40 +03:00
3 changed files with 9 additions and 8 deletions

View File

@@ -227,14 +227,13 @@ angular.module('grafana.services').factory('QueryProcessor', function($q) {
* }, ... * }, ...
* ] * ]
*/ */
var self = this;
// Group history by itemid // Group history by itemid
var grouped_history = _.groupBy(history, 'itemid'); var grouped_history = _.groupBy(history, 'itemid');
var hosts = _.indexBy(_.flatten(_.map(items, 'hosts')), 'hostid'); var hosts = _.indexBy(_.flatten(_.map(items, 'hosts')), 'hostid');
return _.map(grouped_history, function(hist, itemid) { return _.map(grouped_history, function(hist, itemid) {
var item = self.cache.getItem(itemid); var item = _.find(items, {'itemid': itemid});
var alias = item.name; var alias = item.name;
if (_.keys(hosts).length > 1 || addHostName) { if (_.keys(hosts).length > 1 || addHostName) {
var host = hosts[item.hostid]; var host = hosts[item.hostid];

View File

@@ -87,10 +87,11 @@ angular.module('grafana.services').factory('ZabbixCachingProxy', function($q, $i
} }
getHosts(groupids) { getHosts(groupids) {
var self = this; //var self = this;
return this.getHostsOnce(groupids) return this.getHostsOnce(groupids)
.then(hosts => { .then(hosts => {
self._hosts = _.union(self._hosts, hosts); // iss #196 - disable caching due performance issues
//self._hosts = _.union(self._hosts, hosts);
return hosts; return hosts;
}); });
} }
@@ -103,10 +104,11 @@ angular.module('grafana.services').factory('ZabbixCachingProxy', function($q, $i
} }
getItems(hostids, appids, itemtype) { getItems(hostids, appids, itemtype) {
var self = this; //var self = this;
return this.getItemsOnce(hostids, appids, itemtype) return this.getItemsOnce(hostids, appids, itemtype)
.then(items => { .then(items => {
self._items = _.union(self._items, items); // iss #196 - disable caching due performance issues
//self._items = _.union(self._items, items);
return items; return items;
}); });
} }

View File

@@ -24,8 +24,8 @@
{"name": "Docs", "url": "http://docs.grafana-zabbix.org"}, {"name": "Docs", "url": "http://docs.grafana-zabbix.org"},
{"name": "License", "url": "https://github.com/alexanderzobnin/grafana-zabbix/blob/master/LICENSE.md"} {"name": "License", "url": "https://github.com/alexanderzobnin/grafana-zabbix/blob/master/LICENSE.md"}
], ],
"version": "3.0.0-beta5", "version": "3.0.0-beta6",
"updated": "2016-04-12" "updated": "2016-04-13"
}, },
"includes": [ "includes": [