Move to jsoniter instead of default json package (#1249)

* Move to jsoniter instead of default json package

Signed-off-by: Cyril Tovena <cyril.tovena@gmail.com>

* Removes jsoniter on the logcli output

Signed-off-by: Cyril Tovena <cyril.tovena@gmail.com>
pull/1349/head
Cyril Tovena 6 years ago committed by GitHub
parent 328ad23634
commit b34c2b0bd3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      pkg/canary/reader/reader.go
  2. 8
      pkg/logcli/client/client.go
  3. 9
      pkg/logcli/query/query.go
  4. 4
      pkg/logentry/stages/json.go
  5. 2
      pkg/loghttp/query.go
  6. 2
      pkg/loghttp/tail.go
  7. 2
      pkg/logql/engine_test.go
  8. 3
      pkg/logql/marshal/legacy/marshal.go
  9. 2
      pkg/logql/marshal/legacy/marshal_test.go
  10. 3
      pkg/logql/marshal/marshal.go
  11. 8
      pkg/logql/marshal/marshal_test.go
  12. 2
      pkg/logql/unmarshal/legacy/unmarshal.go
  13. 3
      pkg/logql/unmarshal/unmarshal.go
  14. 2
      pkg/promtail/api/entry_parser.go

@ -2,7 +2,6 @@ package reader
import (
"encoding/base64"
"encoding/json"
"fmt"
"io"
"io/ioutil"
@ -14,12 +13,12 @@ import (
"time"
"github.com/gorilla/websocket"
loghttp "github.com/grafana/loki/pkg/loghttp/legacy"
"github.com/grafana/loki/pkg/logproto"
json "github.com/json-iterator/go"
"github.com/pkg/errors"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
loghttp "github.com/grafana/loki/pkg/loghttp/legacy"
"github.com/grafana/loki/pkg/logproto"
)
var (

@ -2,7 +2,6 @@ package client
import (
"encoding/base64"
"encoding/json"
"fmt"
"io/ioutil"
"log"
@ -11,13 +10,12 @@ import (
"strings"
"time"
"github.com/gorilla/websocket"
"github.com/grafana/loki/pkg/loghttp"
"github.com/grafana/loki/pkg/logproto"
"github.com/grafana/loki/pkg/util"
"github.com/gorilla/websocket"
json "github.com/json-iterator/go"
"github.com/prometheus/common/config"
"github.com/grafana/loki/pkg/logproto"
)
const (

@ -1,7 +1,6 @@
package query
import (
"encoding/json"
"fmt"
"log"
"sort"
@ -9,13 +8,13 @@ import (
"time"
"github.com/fatih/color"
"github.com/grafana/loki/pkg/loghttp"
"github.com/grafana/loki/pkg/logql"
"github.com/prometheus/prometheus/promql"
"github.com/grafana/loki/pkg/logcli/client"
"github.com/grafana/loki/pkg/logcli/output"
"github.com/grafana/loki/pkg/loghttp"
"github.com/grafana/loki/pkg/logproto"
"github.com/grafana/loki/pkg/logql"
json "github.com/json-iterator/go"
"github.com/prometheus/prometheus/promql"
)
type streamEntryPair struct {

@ -1,15 +1,13 @@
package stages
import (
"encoding/json"
//"encoding/json"
//"fmt"
"reflect"
"time"
"github.com/go-kit/kit/log"
"github.com/go-kit/kit/log/level"
"github.com/jmespath/go-jmespath"
json "github.com/json-iterator/go"
"github.com/mitchellh/mapstructure"
"github.com/pkg/errors"
"github.com/prometheus/common/model"

@ -1,7 +1,6 @@
package loghttp
import (
"encoding/json"
"errors"
"fmt"
"net/http"
@ -9,6 +8,7 @@ import (
"time"
"github.com/grafana/loki/pkg/logproto"
json "github.com/json-iterator/go"
"github.com/prometheus/common/model"
)

@ -1,13 +1,13 @@
package loghttp
import (
"encoding/json"
"fmt"
"net/http"
"strconv"
"time"
"github.com/grafana/loki/pkg/logproto"
json "github.com/json-iterator/go"
)
const (

@ -2,13 +2,13 @@ package logql
import (
"context"
"encoding/json"
"fmt"
"testing"
"time"
"github.com/grafana/loki/pkg/iter"
"github.com/grafana/loki/pkg/logproto"
json "github.com/json-iterator/go"
"github.com/prometheus/prometheus/pkg/labels"
"github.com/prometheus/prometheus/promql"
"github.com/stretchr/testify/assert"

@ -3,15 +3,14 @@
package marshal
import (
"encoding/json"
"fmt"
"io"
"github.com/gorilla/websocket"
loghttp "github.com/grafana/loki/pkg/loghttp/legacy"
"github.com/grafana/loki/pkg/logproto"
"github.com/grafana/loki/pkg/logql"
json "github.com/json-iterator/go"
"github.com/prometheus/prometheus/promql"
)

@ -2,7 +2,6 @@ package marshal
import (
"bytes"
"encoding/json"
"log"
"testing"
"time"
@ -10,6 +9,7 @@ import (
loghttp "github.com/grafana/loki/pkg/loghttp/legacy"
"github.com/grafana/loki/pkg/logproto"
"github.com/grafana/loki/pkg/logql"
json "github.com/json-iterator/go"
"github.com/stretchr/testify/require"
)

@ -3,14 +3,13 @@
package marshal
import (
"encoding/json"
"io"
"github.com/gorilla/websocket"
"github.com/grafana/loki/pkg/loghttp"
legacy "github.com/grafana/loki/pkg/loghttp/legacy"
"github.com/grafana/loki/pkg/logproto"
json "github.com/json-iterator/go"
"github.com/prometheus/prometheus/promql"
)

@ -2,18 +2,16 @@ package marshal
import (
"bytes"
"encoding/json"
"testing"
"time"
"github.com/grafana/loki/pkg/loghttp"
legacy "github.com/grafana/loki/pkg/loghttp/legacy"
"github.com/prometheus/prometheus/pkg/labels"
"github.com/prometheus/prometheus/promql"
"github.com/grafana/loki/pkg/logproto"
"github.com/grafana/loki/pkg/logql"
json "github.com/json-iterator/go"
"github.com/prometheus/prometheus/pkg/labels"
"github.com/prometheus/prometheus/promql"
"github.com/stretchr/testify/require"
)

@ -1,10 +1,10 @@
package unmarshal
import (
"encoding/json"
"io"
"github.com/grafana/loki/pkg/logproto"
json "github.com/json-iterator/go"
)
// DecodePushRequest directly decodes json to a logproto.PushRequest

@ -1,12 +1,11 @@
package unmarshal
import (
"encoding/json"
"io"
"github.com/grafana/loki/pkg/loghttp"
"github.com/grafana/loki/pkg/logproto"
json "github.com/json-iterator/go"
)
// DecodePushRequest directly decodes json to a logproto.PushRequest

@ -1,12 +1,12 @@
package api
import (
"encoding/json"
"fmt"
"regexp"
"strings"
"time"
json "github.com/json-iterator/go"
"github.com/prometheus/common/model"
)

Loading…
Cancel
Save