use json-iterator/go instead encoding/json

This commit is contained in:
Ulric Qin 2022-10-28 10:22:04 +08:00
parent da5dd683d6
commit aff0dbfea1
4 changed files with 4 additions and 3 deletions

View File

@ -16,8 +16,11 @@ import (
"github.com/didi/nightingale/v5/src/server/naming"
promstat "github.com/didi/nightingale/v5/src/server/stat"
jsoniter "github.com/json-iterator/go"
)
var json = jsoniter.ConfigCompatibleWithStandardLibrary
func New(version string, reloadFunc func()) *gin.Engine {
gin.SetMode(config.C.RunMode)

View File

@ -3,7 +3,6 @@ package router
import (
"compress/gzip"
"compress/zlib"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"

View File

@ -2,7 +2,6 @@ package router
import (
"compress/gzip"
"encoding/json"
"fmt"
"io/ioutil"
"strconv"
@ -140,6 +139,7 @@ func (m *FalconMetric) ToProm() (*prompb.TimeSeries, string, error) {
}
func falconPush(c *gin.Context) {
var bs []byte
var err error
var r *gzip.Reader

View File

@ -2,7 +2,6 @@ package router
import (
"compress/gzip"
"encoding/json"
"fmt"
"io/ioutil"
"strconv"