mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-12-31 15:06:26 +00:00
wip
This commit is contained in:
parent
b59ed0bc79
commit
aa23832921
4 changed files with 27 additions and 4 deletions
|
@ -20,6 +20,7 @@ according to [these docs](https://docs.victoriametrics.com/victorialogs/quicksta
|
||||||
## tip
|
## tip
|
||||||
|
|
||||||
* FEATURE: support [comparing](https://docs.victoriametrics.com/victorialogs/logsql/#range-filter) log field values with [special numeric values](https://docs.victoriametrics.com/victorialogs/logsql/#numeric-values). For example, `duration:>1.5s` and `response_size:<15KiB` are valid filters now.
|
* FEATURE: support [comparing](https://docs.victoriametrics.com/victorialogs/logsql/#range-filter) log field values with [special numeric values](https://docs.victoriametrics.com/victorialogs/logsql/#numeric-values). For example, `duration:>1.5s` and `response_size:<15KiB` are valid filters now.
|
||||||
|
* FEATURE: properly sort [durations](https://docs.victoriametrics.com/victorialogs/logsql/#duration-values) and [short numeric values](https://docs.victoriametrics.com/victorialogs/logsql/#short-numeric-values) in [`sort` pipe](https://docs.victoriametrics.com/victorialogs/logsql/#sort-pipe). For example, `10s` goes in front of `1h`, while `10KB` goes in front of `1GB`.
|
||||||
* FEATURE: add an ability to preserve the original non-empty field values when performing [`extract`](https://docs.victoriametrics.com/victorialogs/logsql/#extract-pipe), [`unpack_json`](https://docs.victoriametrics.com/victorialogs/logsql/#unpack_json-pipe), [`unpack_logfmt`](https://docs.victoriametrics.com/victorialogs/logsql/#unpack_logfmt-pipe) and [`format`](https://docs.victoriametrics.com/victorialogs/logsql/#format-pipe) pipes.
|
* FEATURE: add an ability to preserve the original non-empty field values when performing [`extract`](https://docs.victoriametrics.com/victorialogs/logsql/#extract-pipe), [`unpack_json`](https://docs.victoriametrics.com/victorialogs/logsql/#unpack_json-pipe), [`unpack_logfmt`](https://docs.victoriametrics.com/victorialogs/logsql/#unpack_logfmt-pipe) and [`format`](https://docs.victoriametrics.com/victorialogs/logsql/#format-pipe) pipes.
|
||||||
|
|
||||||
## [v0.10.0](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/tag/v0.10.0-victorialogs)
|
## [v0.10.0](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/tag/v0.10.0-victorialogs)
|
||||||
|
|
|
@ -1700,7 +1700,7 @@ func (c *blockResultColumn) sumValues(br *blockResult) (float64, int) {
|
||||||
values := c.getValuesEncoded(br)
|
values := c.getValuesEncoded(br)
|
||||||
for i := range values {
|
for i := range values {
|
||||||
if i == 0 || values[i-1] != values[i] {
|
if i == 0 || values[i-1] != values[i] {
|
||||||
f, ok = tryParseFloat64(values[i])
|
f, ok = tryParseNumber(values[i])
|
||||||
}
|
}
|
||||||
if ok {
|
if ok {
|
||||||
sum += f
|
sum += f
|
||||||
|
@ -1713,7 +1713,7 @@ func (c *blockResultColumn) sumValues(br *blockResult) (float64, int) {
|
||||||
a := encoding.GetFloat64s(len(dictValues))
|
a := encoding.GetFloat64s(len(dictValues))
|
||||||
dictValuesFloat := a.A
|
dictValuesFloat := a.A
|
||||||
for i, v := range dictValues {
|
for i, v := range dictValues {
|
||||||
f, ok := tryParseFloat64(v)
|
f, ok := tryParseNumber(v)
|
||||||
if !ok {
|
if !ok {
|
||||||
f = nan
|
f = nan
|
||||||
}
|
}
|
||||||
|
|
|
@ -621,8 +621,8 @@ func lessString(a, b string) bool {
|
||||||
return nA < nB
|
return nA < nB
|
||||||
}
|
}
|
||||||
|
|
||||||
fA, okA := tryParseFloat64(a)
|
fA, okA := tryParseNumber(a)
|
||||||
fB, okB := tryParseFloat64(b)
|
fB, okB := tryParseNumber(b)
|
||||||
if okA && okB {
|
if okA && okB {
|
||||||
return fA < fB
|
return fA < fB
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package logstorage
|
package logstorage
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -415,3 +416,24 @@ func TestStatsUniqValues(t *testing.T) {
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestSortStrings(t *testing.T) {
|
||||||
|
f := func(s, resultExpected string) {
|
||||||
|
t.Helper()
|
||||||
|
|
||||||
|
a := strings.Split(s, ",")
|
||||||
|
sortStrings(a)
|
||||||
|
result := strings.Join(a, ",")
|
||||||
|
if result != resultExpected {
|
||||||
|
t.Fatalf("unexpected sort result\ngot\n%q\nwant\n%q", a, resultExpected)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
f("", "")
|
||||||
|
f("1", "1")
|
||||||
|
f("foo,bar,baz", "bar,baz,foo")
|
||||||
|
f("100ms,1.5s,1.23s","100ms,1.23s,1.5s")
|
||||||
|
f("10KiB,10KB,5.34K","5.34K,10KB,10KiB")
|
||||||
|
f("v1.10.9,v1.10.10,v1.9.0","v1.9.0,v1.10.9,v1.10.10")
|
||||||
|
f("10s,123,100M","123,100M,10s")
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue