forked from mirrors/statsd_exporter
rename mapper_cache to mappercache
Signed-off-by: glightfoot <glightfoot@rsglab.com>
This commit is contained in:
parent
940e653ea6
commit
aa529c8884
6 changed files with 12 additions and 12 deletions
4
main.go
4
main.go
|
@ -39,8 +39,8 @@ import (
|
||||||
"github.com/prometheus/statsd_exporter/pkg/line"
|
"github.com/prometheus/statsd_exporter/pkg/line"
|
||||||
"github.com/prometheus/statsd_exporter/pkg/listener"
|
"github.com/prometheus/statsd_exporter/pkg/listener"
|
||||||
"github.com/prometheus/statsd_exporter/pkg/mapper"
|
"github.com/prometheus/statsd_exporter/pkg/mapper"
|
||||||
"github.com/prometheus/statsd_exporter/pkg/mapper_cache/lru"
|
"github.com/prometheus/statsd_exporter/pkg/mappercache/lru"
|
||||||
"github.com/prometheus/statsd_exporter/pkg/mapper_cache/randomreplacement"
|
"github.com/prometheus/statsd_exporter/pkg/mappercache/randomreplacement"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
|
@ -18,8 +18,8 @@ import (
|
||||||
"math/rand"
|
"math/rand"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/prometheus/statsd_exporter/pkg/mapper_cache/lru"
|
"github.com/prometheus/statsd_exporter/pkg/mappercache/lru"
|
||||||
"github.com/prometheus/statsd_exporter/pkg/mapper_cache/randomreplacement"
|
"github.com/prometheus/statsd_exporter/pkg/mappercache/randomreplacement"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
|
@ -19,7 +19,7 @@ import (
|
||||||
|
|
||||||
"github.com/prometheus/client_golang/prometheus"
|
"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 {
|
type mappings []struct {
|
||||||
|
|
|
@ -18,12 +18,12 @@ import (
|
||||||
|
|
||||||
lru2 "github.com/hashicorp/golang-lru"
|
lru2 "github.com/hashicorp/golang-lru"
|
||||||
|
|
||||||
"github.com/prometheus/statsd_exporter/pkg/mapper_cache"
|
"github.com/prometheus/statsd_exporter/pkg/mappercache"
|
||||||
)
|
)
|
||||||
|
|
||||||
type metricMapperLRUCache struct {
|
type metricMapperLRUCache struct {
|
||||||
cache *lru2.Cache
|
cache *lru2.Cache
|
||||||
metrics *mapper_cache.CacheMetrics
|
metrics *mappercache.CacheMetrics
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewMetricMapperLRUCache(reg prometheus.Registerer, size int) (*metricMapperLRUCache, error) {
|
func NewMetricMapperLRUCache(reg prometheus.Registerer, size int) (*metricMapperLRUCache, error) {
|
||||||
|
@ -31,7 +31,7 @@ func NewMetricMapperLRUCache(reg prometheus.Registerer, size int) (*metricMapper
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
metrics := mapper_cache.NewCacheMetrics(reg)
|
metrics := mappercache.NewCacheMetrics(reg)
|
||||||
cache, err := lru2.New(size)
|
cache, err := lru2.New(size)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return &metricMapperLRUCache{}, err
|
return &metricMapperLRUCache{}, err
|
|
@ -11,7 +11,7 @@
|
||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
package mapper_cache
|
package mappercache
|
||||||
|
|
||||||
import "github.com/prometheus/client_golang/prometheus"
|
import "github.com/prometheus/client_golang/prometheus"
|
||||||
|
|
|
@ -18,14 +18,14 @@ import (
|
||||||
|
|
||||||
"github.com/prometheus/client_golang/prometheus"
|
"github.com/prometheus/client_golang/prometheus"
|
||||||
|
|
||||||
"github.com/prometheus/statsd_exporter/pkg/mapper_cache"
|
"github.com/prometheus/statsd_exporter/pkg/mappercache"
|
||||||
)
|
)
|
||||||
|
|
||||||
type metricMapperRRCache struct {
|
type metricMapperRRCache struct {
|
||||||
lock sync.RWMutex
|
lock sync.RWMutex
|
||||||
size int
|
size int
|
||||||
items map[string]interface{}
|
items map[string]interface{}
|
||||||
metrics *mapper_cache.CacheMetrics
|
metrics *mappercache.CacheMetrics
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewMetricMapperRRCache(reg prometheus.Registerer, size int) (*metricMapperRRCache, error) {
|
func NewMetricMapperRRCache(reg prometheus.Registerer, size int) (*metricMapperRRCache, error) {
|
||||||
|
@ -33,7 +33,7 @@ func NewMetricMapperRRCache(reg prometheus.Registerer, size int) (*metricMapperR
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
metrics := mapper_cache.NewCacheMetrics(reg)
|
metrics := mappercache.NewCacheMetrics(reg)
|
||||||
c := &metricMapperRRCache{
|
c := &metricMapperRRCache{
|
||||||
items: make(map[string]interface{}, size+1),
|
items: make(map[string]interface{}, size+1),
|
||||||
size: size,
|
size: size,
|
Loading…
Reference in a new issue