Skip to content

Commit

Permalink
minor linting and rephrasing
Browse files Browse the repository at this point in the history
  • Loading branch information
roycald245 committed Aug 26, 2024
1 parent dda094b commit 1e1d501
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 9 deletions.
1 change: 0 additions & 1 deletion processor/coralogixprocessor/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ package coralogixprocessor // import "github.com/open-telemetry/opentelemetry-co

import (
"context"

"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/consumer"
"go.opentelemetry.io/collector/processor"
Expand Down
1 change: 0 additions & 1 deletion processor/coralogixprocessor/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ require (
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect
github.com/hashicorp/go-version v1.7.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/compress v1.17.9 // indirect
github.com/knadh/koanf/maps v0.1.1 // indirect
Expand Down
37 changes: 35 additions & 2 deletions processor/coralogixprocessor/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions processor/coralogixprocessor/internal/cache/cache.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

package cache // import "github.com/open-telemetry/opentelemetry-collector-contrib/processor/coralogixprocessor/internal/cache
package cache // import "github.com/open-telemetry/opentelemetry-collector-contrib/processor/coralogixprocessor/internal/cache"

import lru "github.com/hashicorp/golang-lru/v2"
import (
lru "github.com/hashicorp/golang-lru/v2"
)

type lruBlueprintCache[V any] struct {
cache *lru.Cache[uint64, V]
Expand Down
6 changes: 3 additions & 3 deletions processor/coralogixprocessor/span.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/auxten/postgresql-parser/pkg/sql/sem/tree"
postgresqlwalk "github.com/auxten/postgresql-parser/pkg/walk"
"github.com/cespare/xxhash/v2"
"github.com/open-telemetry/opentelemetry-collector-contrib/processor/coralogixprocessor/internal/cache"
cache2 "github.com/open-telemetry/opentelemetry-collector-contrib/processor/coralogixprocessor/internal/cache"
mysqlparser "github.com/xwb1989/sqlparser"
"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/consumer"
Expand All @@ -33,7 +33,7 @@ type coralogixProcessor struct {
config *Config
component.StartFunc
component.ShutdownFunc
cache cache.Cache[string]
cache cache2.Cache[string]
logger *zap.Logger
}

Expand Down Expand Up @@ -204,7 +204,7 @@ func newCoralogixProcessor(ctx context.Context, set processor.Settings, cfg *Con
// 8 bytes per entry, 1GB / 8 Bytes = 134,217,728 entries by default
var cacheSize = fromConfigOrDefault(cfg.databaseBlueprintsConfig.sampling.maxCacheSizeMib*1024*1024, 1<<30) / 8 // Default to 1GB
var err error
sp.cache, err = cache.NewLRUBlueprintCache[string](int(cacheSize))
sp.cache, err = cache2.NewLRUBlueprintCache[string](int(cacheSize))
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 1e1d501

Please sign in to comment.