mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-12-11 14:53:49 +00:00
app/vmselect/promql/transform.go: reuse evalNumber() function for constructing timezone_offset() results
This commit is contained in:
parent
a49ccedd25
commit
3d10ef084b
1 changed files with 6 additions and 10 deletions
|
@ -2183,17 +2183,13 @@ func transformTimezoneOffset(tfa *transformFuncArg) ([]*timeseries, error) {
|
||||||
return nil, fmt.Errorf("cannot load timezone %q: %w", tzString, err)
|
return nil, fmt.Errorf("cannot load timezone %q: %w", tzString, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
var ts timeseries
|
tss := evalNumber(tfa.ec, nan)
|
||||||
ts.denyReuse = true
|
ts := tss[0]
|
||||||
timestamps := tfa.ec.getSharedTimestamps()
|
for i, timestamp := range ts.Timestamps {
|
||||||
values := make([]float64, len(timestamps))
|
_, offset := time.Unix(timestamp/1000, 0).In(loc).Zone()
|
||||||
for i, v := range timestamps {
|
ts.Values[i] = float64(offset)
|
||||||
_, offset := time.Unix(v/1000, 0).In(loc).Zone()
|
|
||||||
values[i] = float64(offset)
|
|
||||||
}
|
}
|
||||||
ts.Values = values
|
return tss, nil
|
||||||
ts.Timestamps = timestamps
|
|
||||||
return []*timeseries{&ts}, nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func transformTime(tfa *transformFuncArg) ([]*timeseries, error) {
|
func transformTime(tfa *transformFuncArg) ([]*timeseries, error) {
|
||||||
|
|
Loading…
Reference in a new issue