promql: Optimize the writing (#5941)
Signed-off-by: johncming <johncming@yahoo.com>
This commit is contained in:
parent
c66bfce8cf
commit
d1b3a6e013
|
@ -15,14 +15,15 @@ package promql
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"github.com/edsrzf/mmap-go"
|
|
||||||
"github.com/go-kit/kit/log"
|
|
||||||
"github.com/go-kit/kit/log/level"
|
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
"unicode/utf8"
|
"unicode/utf8"
|
||||||
|
|
||||||
|
"github.com/edsrzf/mmap-go"
|
||||||
|
"github.com/go-kit/kit/log"
|
||||||
|
"github.com/go-kit/kit/log/level"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ActiveQueryTracker struct {
|
type ActiveQueryTracker struct {
|
||||||
|
@ -130,7 +131,7 @@ func trimStringByBytes(str string, size int) string {
|
||||||
trimIndex := len(bytesStr)
|
trimIndex := len(bytesStr)
|
||||||
if size < len(bytesStr) {
|
if size < len(bytesStr) {
|
||||||
for !utf8.RuneStart(bytesStr[size]) {
|
for !utf8.RuneStart(bytesStr[size]) {
|
||||||
size -= 1
|
size--
|
||||||
}
|
}
|
||||||
trimIndex = size
|
trimIndex = size
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue