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" "github.com/didi/nightingale/v5/src/server/naming"
promstat "github.com/didi/nightingale/v5/src/server/stat" 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 { func New(version string, reloadFunc func()) *gin.Engine {
gin.SetMode(config.C.RunMode) gin.SetMode(config.C.RunMode)

View File

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

View File

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

View File

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