mirror of
https://github.com/prometheus/statsd_exporter.git
synced 2024-11-29 10:41:00 +00:00
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/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 (
|
||||
|
|
|
@ -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 (
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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
|
|
@ -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"
|
||||
|
|
@ -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,
|
Loading…
Reference in a new issue