Backend: implement alerting query (#847)

* Unit tests for backend

* minor change

* Implemented querNumericItems in backend

* Added query type

* Set alerting to true

* Return TimeSeries from History

* Updated alerting feature

* Fix params marshal error

* Fix params more

* Update zabbixAPIConnector.js

* Numbers, I guess

* Params Output Type

* Output marshaling

* Unmarshal and decoder error catch

* HistoryPoint and Unmarshal fixes

* Unmarshal to History

* Revert "Update zabbixAPIConnector.js"

This reverts commit e0ffdff859b6f920893a47a709493f8076e38ef4.

* Fix unmarshaling for real

* Time range integer

* Use more zabbix.Items

* Update response_models.go

* Update zabbix_api.go

* Update models.go

* Update zabbix_api.go

* Tests

* Adding more unit tests and cleaning up additional logging

* Make history request param a pointer

* Actually store datasource in cache

* Debug logs and timings

* Handle panics gracefully

* Updated Regex filter parsing

* Removed must compile

* Clean up regex filter
This commit is contained in:
vignesh-reddy
2020-01-13 01:38:24 -06:00
committed by Alexander Zobnin
parent c300debe35
commit 3f5719794a
9 changed files with 1106 additions and 33 deletions

View File

@@ -78,6 +78,11 @@ func TestZabbixBackend_getCachedDatasource(t *testing.T) {
// Only checking the authToken, being the easiest value to, and guarantee equality for
assert.Equal(t, tt.want.authToken, got.authToken)
// Ensure the datasource is in the cache
cacheds, ok := tt.cache.Get(HashDatasourceInfo(tt.request.GetDatasource()))
assert.Equal(t, true, ok)
assert.Equal(t, got, cacheds)
})
}
}