mysql-connector: use db queries only for numeric history requests
This commit is contained in:
4
dist/datasource-zabbix/datasource.js
vendored
4
dist/datasource-zabbix/datasource.js
vendored
@@ -356,7 +356,7 @@ System.register(['lodash', 'app/core/utils/datemath', './utils', './migrations',
|
||||
|
||||
if (useTrends) {
|
||||
if (_this2.enableDirectDBConnection) {
|
||||
getHistoryPromise = _this2.zabbix.getTrend(items, timeFrom, timeTo, options).then(function (history) {
|
||||
getHistoryPromise = _this2.zabbix.getTrendsDB(items, timeFrom, timeTo, options).then(function (history) {
|
||||
return _this2.zabbix.dbConnector.handleGrafanaTSResponse(history, items);
|
||||
});
|
||||
} else {
|
||||
@@ -376,7 +376,7 @@ System.register(['lodash', 'app/core/utils/datemath', './utils', './migrations',
|
||||
} else {
|
||||
// Use history
|
||||
if (_this2.enableDirectDBConnection) {
|
||||
getHistoryPromise = _this2.zabbix.getHistory(items, timeFrom, timeTo, options).then(function (history) {
|
||||
getHistoryPromise = _this2.zabbix.getHistoryDB(items, timeFrom, timeTo, options).then(function (history) {
|
||||
return _this2.zabbix.dbConnector.handleGrafanaTSResponse(history, items);
|
||||
});
|
||||
} else {
|
||||
|
||||
2
dist/datasource-zabbix/datasource.js.map
vendored
2
dist/datasource-zabbix/datasource.js.map
vendored
File diff suppressed because one or more lines are too long
4
dist/datasource-zabbix/zabbix.js
vendored
4
dist/datasource-zabbix/zabbix.js
vendored
@@ -67,8 +67,8 @@ System.register(['angular', 'lodash', './utils', './zabbixAPI.service.js', './za
|
||||
|
||||
if (enableDirectDBConnection) {
|
||||
this.dbConnector = new ZabbixDBConnector(sqlDatasourceId);
|
||||
this.getHistory = this.dbConnector.getHistory.bind(this.dbConnector);
|
||||
this.getTrend = this.dbConnector.getTrends.bind(this.dbConnector);
|
||||
this.getHistoryDB = this.dbConnector.getHistory.bind(this.dbConnector);
|
||||
this.getTrendsDB = this.dbConnector.getTrends.bind(this.dbConnector);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
2
dist/datasource-zabbix/zabbix.js.map
vendored
2
dist/datasource-zabbix/zabbix.js.map
vendored
File diff suppressed because one or more lines are too long
4
dist/test/datasource-zabbix/datasource.js
vendored
4
dist/test/datasource-zabbix/datasource.js
vendored
@@ -216,7 +216,7 @@ var ZabbixAPIDatasource = function () {
|
||||
|
||||
if (useTrends) {
|
||||
if (_this2.enableDirectDBConnection) {
|
||||
getHistoryPromise = _this2.zabbix.getTrend(items, timeFrom, timeTo, options).then(function (history) {
|
||||
getHistoryPromise = _this2.zabbix.getTrendsDB(items, timeFrom, timeTo, options).then(function (history) {
|
||||
return _this2.zabbix.dbConnector.handleGrafanaTSResponse(history, items);
|
||||
});
|
||||
} else {
|
||||
@@ -236,7 +236,7 @@ var ZabbixAPIDatasource = function () {
|
||||
} else {
|
||||
// Use history
|
||||
if (_this2.enableDirectDBConnection) {
|
||||
getHistoryPromise = _this2.zabbix.getHistory(items, timeFrom, timeTo, options).then(function (history) {
|
||||
getHistoryPromise = _this2.zabbix.getHistoryDB(items, timeFrom, timeTo, options).then(function (history) {
|
||||
return _this2.zabbix.dbConnector.handleGrafanaTSResponse(history, items);
|
||||
});
|
||||
} else {
|
||||
|
||||
4
dist/test/datasource-zabbix/zabbix.js
vendored
4
dist/test/datasource-zabbix/zabbix.js
vendored
@@ -72,8 +72,8 @@ function ZabbixFactory(zabbixAPIService, ZabbixCachingProxy, ZabbixDBConnector)
|
||||
|
||||
if (enableDirectDBConnection) {
|
||||
this.dbConnector = new ZabbixDBConnector(sqlDatasourceId);
|
||||
this.getHistory = this.dbConnector.getHistory.bind(this.dbConnector);
|
||||
this.getTrend = this.dbConnector.getTrends.bind(this.dbConnector);
|
||||
this.getHistoryDB = this.dbConnector.getHistory.bind(this.dbConnector);
|
||||
this.getTrendsDB = this.dbConnector.getTrends.bind(this.dbConnector);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user