Use Data frames response format (#1099)
* Use data frames for numeric data * Use data frames for text data * Use data frames for IT services * fix multiple series * Convert to the wide format if possible * Fix table format for text data * Add refId to the data frames * Align time series from Zabbix API * Fill gaps with nulls * Fix moving average functions * Option for disabling data alignment * remove unused logging * Add labels to data frames * Detect units * Set min and max for if percent unit used * Use value mapping from Zabbix * Rename unitConverter -> convertZabbixUnit * More units * Add missing points in front of each series * Fix handling table data * fix db connector data frames handling * fix it services data frames handling * Detect all known grafana units * Chore: remove unused logging * Fix problems format * Debug logging: show original units * Add global option for disabling data alignment * Add tooltip for the disableDataAlignment feature * Add note about query options * Functions for aligning timeseries on the backend
This commit is contained in:
18
pkg/timeseries/models.go
Normal file
18
pkg/timeseries/models.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package timeseries
|
||||
|
||||
import "time"
|
||||
|
||||
type TimePoint struct {
|
||||
Time time.Time
|
||||
Value *float64
|
||||
}
|
||||
|
||||
type TimeSeries []TimePoint
|
||||
|
||||
func NewTimeSeries() TimeSeries {
|
||||
return make(TimeSeries, 0)
|
||||
}
|
||||
|
||||
func (ts *TimeSeries) Len() int {
|
||||
return len(*ts)
|
||||
}
|
||||
Reference in New Issue
Block a user