diff --git a/main.go b/main.go index 4dfa14b..b6b0c8d 100644 --- a/main.go +++ b/main.go @@ -39,8 +39,8 @@ import ( "github.com/prometheus/statsd_exporter/pkg/line" "github.com/prometheus/statsd_exporter/pkg/listener" "github.com/prometheus/statsd_exporter/pkg/mapper" - "github.com/prometheus/statsd_exporter/pkg/mapper_cache/lru" - "github.com/prometheus/statsd_exporter/pkg/mapper_cache/randomreplacement" + "github.com/prometheus/statsd_exporter/pkg/mappercache/lru" + "github.com/prometheus/statsd_exporter/pkg/mappercache/randomreplacement" ) const ( diff --git a/pkg/mapper/mapper_benchmark_test.go b/pkg/mapper/mapper_benchmark_test.go index 5219e1d..978a110 100644 --- a/pkg/mapper/mapper_benchmark_test.go +++ b/pkg/mapper/mapper_benchmark_test.go @@ -18,8 +18,8 @@ import ( "math/rand" "testing" - "github.com/prometheus/statsd_exporter/pkg/mapper_cache/lru" - "github.com/prometheus/statsd_exporter/pkg/mapper_cache/randomreplacement" + "github.com/prometheus/statsd_exporter/pkg/mappercache/lru" + "github.com/prometheus/statsd_exporter/pkg/mappercache/randomreplacement" ) var ( diff --git a/pkg/mapper/mapper_test.go b/pkg/mapper/mapper_test.go index a9ac7e6..8024b22 100644 --- a/pkg/mapper/mapper_test.go +++ b/pkg/mapper/mapper_test.go @@ -19,7 +19,7 @@ import ( "github.com/prometheus/client_golang/prometheus" - "github.com/prometheus/statsd_exporter/pkg/mapper_cache/lru" + "github.com/prometheus/statsd_exporter/pkg/mappercache/lru" ) type mappings []struct { diff --git a/pkg/mapper_cache/lru/lru.go b/pkg/mappercache/lru/lru.go similarity index 92% rename from pkg/mapper_cache/lru/lru.go rename to pkg/mappercache/lru/lru.go index e6739ee..6eeeaef 100644 --- a/pkg/mapper_cache/lru/lru.go +++ b/pkg/mappercache/lru/lru.go @@ -18,12 +18,12 @@ import ( lru2 "github.com/hashicorp/golang-lru" - "github.com/prometheus/statsd_exporter/pkg/mapper_cache" + "github.com/prometheus/statsd_exporter/pkg/mappercache" ) type metricMapperLRUCache struct { cache *lru2.Cache - metrics *mapper_cache.CacheMetrics + metrics *mappercache.CacheMetrics } func NewMetricMapperLRUCache(reg prometheus.Registerer, size int) (*metricMapperLRUCache, error) { @@ -31,7 +31,7 @@ func NewMetricMapperLRUCache(reg prometheus.Registerer, size int) (*metricMapper return nil, nil } - metrics := mapper_cache.NewCacheMetrics(reg) + metrics := mappercache.NewCacheMetrics(reg) cache, err := lru2.New(size) if err != nil { return &metricMapperLRUCache{}, err diff --git a/pkg/mapper_cache/metrics.go b/pkg/mappercache/metrics.go similarity index 98% rename from pkg/mapper_cache/metrics.go rename to pkg/mappercache/metrics.go index f3d76f7..9cc351e 100644 --- a/pkg/mapper_cache/metrics.go +++ b/pkg/mappercache/metrics.go @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package mapper_cache +package mappercache import "github.com/prometheus/client_golang/prometheus" diff --git a/pkg/mapper_cache/randomreplacement/randomreplacement.go b/pkg/mappercache/randomreplacement/randomreplacement.go similarity index 92% rename from pkg/mapper_cache/randomreplacement/randomreplacement.go rename to pkg/mappercache/randomreplacement/randomreplacement.go index 1dfaa28..fe784de 100644 --- a/pkg/mapper_cache/randomreplacement/randomreplacement.go +++ b/pkg/mappercache/randomreplacement/randomreplacement.go @@ -18,14 +18,14 @@ import ( "github.com/prometheus/client_golang/prometheus" - "github.com/prometheus/statsd_exporter/pkg/mapper_cache" + "github.com/prometheus/statsd_exporter/pkg/mappercache" ) type metricMapperRRCache struct { lock sync.RWMutex size int items map[string]interface{} - metrics *mapper_cache.CacheMetrics + metrics *mappercache.CacheMetrics } func NewMetricMapperRRCache(reg prometheus.Registerer, size int) (*metricMapperRRCache, error) { @@ -33,7 +33,7 @@ func NewMetricMapperRRCache(reg prometheus.Registerer, size int) (*metricMapperR return nil, nil } - metrics := mapper_cache.NewCacheMetrics(reg) + metrics := mappercache.NewCacheMetrics(reg) c := &metricMapperRRCache{ items: make(map[string]interface{}, size+1), size: size,