use json-iterator/go instead encoding/json
This commit is contained in:
parent
da5dd683d6
commit
aff0dbfea1
|
@ -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)
|
||||||
|
|
||||||
|
|
|
@ -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"
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -2,7 +2,6 @@ package router
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"compress/gzip"
|
"compress/gzip"
|
||||||
"encoding/json"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
Loading…
Reference in New Issue