mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-23 12:31:07 +01:00
all: consistency renaming: bytesSize -> sizeBytes
This commit is contained in:
parent
55fe36149c
commit
1fe6d784d8
@ -71,7 +71,7 @@ func InitRollupResultCache(cachePath string) {
|
||||
return stats
|
||||
}
|
||||
if len(rollupResultCachePath) > 0 {
|
||||
logger.Infof("loaded rollupResult cache from %q in %s; entriesCount: %d, bytesSize: %d",
|
||||
logger.Infof("loaded rollupResult cache from %q in %s; entriesCount: %d, sizeBytes: %d",
|
||||
rollupResultCachePath, time.Since(startTime), fcs().EntriesCount, fcs().BytesSize)
|
||||
}
|
||||
|
||||
@ -108,7 +108,7 @@ func StopRollupResultCache() {
|
||||
var fcs fastcache.Stats
|
||||
rollupResultCacheV.c.UpdateStats(&fcs)
|
||||
rollupResultCacheV.c.Reset()
|
||||
logger.Infof("saved rollupResult cache to %q in %s; entriesCount: %d, bytesSize: %d",
|
||||
logger.Infof("saved rollupResult cache to %q in %s; entriesCount: %d, sizeBytes: %d",
|
||||
rollupResultCachePath, time.Since(startTime), fcs.EntriesCount, fcs.BytesSize)
|
||||
}
|
||||
}
|
||||
|
@ -399,22 +399,22 @@ func registerStorageMetrics(strg *storage.Storage) {
|
||||
})
|
||||
|
||||
metrics.NewGauge(`vm_cache_size_bytes{type="storage/tsid"}`, func() float64 {
|
||||
return float64(m().TSIDCacheBytesSize)
|
||||
return float64(m().TSIDCacheSizeBytes)
|
||||
})
|
||||
metrics.NewGauge(`vm_cache_size_bytes{type="storage/metricIDs"}`, func() float64 {
|
||||
return float64(m().MetricIDCacheBytesSize)
|
||||
return float64(m().MetricIDCacheSizeBytes)
|
||||
})
|
||||
metrics.NewGauge(`vm_cache_size_bytes{type="storage/metricName"}`, func() float64 {
|
||||
return float64(m().MetricNameCacheBytesSize)
|
||||
return float64(m().MetricNameCacheSizeBytes)
|
||||
})
|
||||
metrics.NewGauge(`vm_cache_size_bytes{type="storage/date_metricID"}`, func() float64 {
|
||||
return float64(m().DateMetricIDCacheBytesSize)
|
||||
return float64(m().DateMetricIDCacheSizeBytes)
|
||||
})
|
||||
metrics.NewGauge(`vm_cache_size_bytes{type="indexdb/tagFilters"}`, func() float64 {
|
||||
return float64(idbm().TagCacheBytesSize)
|
||||
return float64(idbm().TagCacheSizeBytes)
|
||||
})
|
||||
metrics.NewGauge(`vm_cache_size_bytes{type="indexdb/uselessTagFilters"}`, func() float64 {
|
||||
return float64(idbm().UselessTagFiltersCacheBytesSize)
|
||||
return float64(idbm().UselessTagFiltersCacheSizeBytes)
|
||||
})
|
||||
|
||||
metrics.NewGauge(`vm_cache_requests_total{type="storage/tsid"}`, func() float64 {
|
||||
|
@ -764,7 +764,7 @@ func (tb *Table) mergeParts(pws []*partWrapper, stopCh <-chan struct{}, isOuterP
|
||||
|
||||
d := time.Since(startTime)
|
||||
if d > 10*time.Second {
|
||||
logger.Infof("merged %d items in %s at %d items/sec to %q; bytesSize: %d", outItemsCount, d, int(float64(outItemsCount)/d.Seconds()), dstPartPath, newPSize)
|
||||
logger.Infof("merged %d items in %s at %d items/sec to %q; sizeBytes: %d", outItemsCount, d, int(float64(outItemsCount)/d.Seconds()), dstPartPath, newPSize)
|
||||
}
|
||||
|
||||
return nil
|
||||
|
@ -153,12 +153,12 @@ func openIndexDB(path string, metricIDCache, metricNameCache *fastcache.Cache, c
|
||||
// IndexDBMetrics contains essential metrics for indexDB.
|
||||
type IndexDBMetrics struct {
|
||||
TagCacheSize uint64
|
||||
TagCacheBytesSize uint64
|
||||
TagCacheSizeBytes uint64
|
||||
TagCacheRequests uint64
|
||||
TagCacheMisses uint64
|
||||
|
||||
UselessTagFiltersCacheSize uint64
|
||||
UselessTagFiltersCacheBytesSize uint64
|
||||
UselessTagFiltersCacheSizeBytes uint64
|
||||
UselessTagFiltersCacheRequests uint64
|
||||
UselessTagFiltersCacheMisses uint64
|
||||
|
||||
@ -187,14 +187,14 @@ func (db *indexDB) UpdateMetrics(m *IndexDBMetrics) {
|
||||
cs.Reset()
|
||||
db.tagCache.UpdateStats(&cs)
|
||||
m.TagCacheSize += cs.EntriesCount
|
||||
m.TagCacheBytesSize += cs.BytesSize
|
||||
m.TagCacheSizeBytes += cs.BytesSize
|
||||
m.TagCacheRequests += cs.GetBigCalls
|
||||
m.TagCacheMisses += cs.Misses
|
||||
|
||||
cs.Reset()
|
||||
db.uselessTagFiltersCache.UpdateStats(&cs)
|
||||
m.UselessTagFiltersCacheSize += cs.EntriesCount
|
||||
m.UselessTagFiltersCacheBytesSize += cs.BytesSize
|
||||
m.UselessTagFiltersCacheSizeBytes += cs.BytesSize
|
||||
m.UselessTagFiltersCacheRequests += cs.GetBigCalls
|
||||
m.UselessTagFiltersCacheMisses += cs.Misses
|
||||
|
||||
|
@ -272,25 +272,25 @@ func (s *Storage) idb() *indexDB {
|
||||
// Metrics contains essential metrics for the Storage.
|
||||
type Metrics struct {
|
||||
TSIDCacheSize uint64
|
||||
TSIDCacheBytesSize uint64
|
||||
TSIDCacheSizeBytes uint64
|
||||
TSIDCacheRequests uint64
|
||||
TSIDCacheMisses uint64
|
||||
TSIDCacheCollisions uint64
|
||||
|
||||
MetricIDCacheSize uint64
|
||||
MetricIDCacheBytesSize uint64
|
||||
MetricIDCacheSizeBytes uint64
|
||||
MetricIDCacheRequests uint64
|
||||
MetricIDCacheMisses uint64
|
||||
MetricIDCacheCollisions uint64
|
||||
|
||||
MetricNameCacheSize uint64
|
||||
MetricNameCacheBytesSize uint64
|
||||
MetricNameCacheSizeBytes uint64
|
||||
MetricNameCacheRequests uint64
|
||||
MetricNameCacheMisses uint64
|
||||
MetricNameCacheCollisions uint64
|
||||
|
||||
DateMetricIDCacheSize uint64
|
||||
DateMetricIDCacheBytesSize uint64
|
||||
DateMetricIDCacheSizeBytes uint64
|
||||
DateMetricIDCacheRequests uint64
|
||||
DateMetricIDCacheMisses uint64
|
||||
DateMetricIDCacheCollisions uint64
|
||||
@ -311,7 +311,7 @@ func (s *Storage) UpdateMetrics(m *Metrics) {
|
||||
var cs fastcache.Stats
|
||||
s.tsidCache.UpdateStats(&cs)
|
||||
m.TSIDCacheSize += cs.EntriesCount
|
||||
m.TSIDCacheBytesSize += cs.BytesSize
|
||||
m.TSIDCacheSizeBytes += cs.BytesSize
|
||||
m.TSIDCacheRequests += cs.GetCalls
|
||||
m.TSIDCacheMisses += cs.Misses
|
||||
m.TSIDCacheCollisions += cs.Collisions
|
||||
@ -319,7 +319,7 @@ func (s *Storage) UpdateMetrics(m *Metrics) {
|
||||
cs.Reset()
|
||||
s.metricIDCache.UpdateStats(&cs)
|
||||
m.MetricIDCacheSize += cs.EntriesCount
|
||||
m.MetricIDCacheBytesSize += cs.BytesSize
|
||||
m.MetricIDCacheSizeBytes += cs.BytesSize
|
||||
m.MetricIDCacheRequests += cs.GetCalls
|
||||
m.MetricIDCacheMisses += cs.Misses
|
||||
m.MetricIDCacheCollisions += cs.Collisions
|
||||
@ -327,7 +327,7 @@ func (s *Storage) UpdateMetrics(m *Metrics) {
|
||||
cs.Reset()
|
||||
s.metricNameCache.UpdateStats(&cs)
|
||||
m.MetricNameCacheSize += cs.EntriesCount
|
||||
m.MetricNameCacheBytesSize += cs.BytesSize
|
||||
m.MetricNameCacheSizeBytes += cs.BytesSize
|
||||
m.MetricNameCacheRequests += cs.GetCalls
|
||||
m.MetricNameCacheMisses += cs.Misses
|
||||
m.MetricNameCacheCollisions += cs.Collisions
|
||||
@ -335,7 +335,7 @@ func (s *Storage) UpdateMetrics(m *Metrics) {
|
||||
cs.Reset()
|
||||
s.dateMetricIDCache.UpdateStats(&cs)
|
||||
m.DateMetricIDCacheSize += cs.EntriesCount
|
||||
m.DateMetricIDCacheBytesSize += cs.BytesSize
|
||||
m.DateMetricIDCacheSizeBytes += cs.BytesSize
|
||||
m.DateMetricIDCacheRequests += cs.GetCalls
|
||||
m.DateMetricIDCacheMisses += cs.Misses
|
||||
m.DateMetricIDCacheCollisions += cs.Collisions
|
||||
@ -492,7 +492,7 @@ func (s *Storage) mustLoadHourMetricIDs(hour uint64, name string) *hourMetricIDs
|
||||
src = src[8:]
|
||||
m[metricID] = struct{}{}
|
||||
}
|
||||
logger.Infof("loaded %s from %q in %s; entriesCount: %d; bytesSize: %d", name, path, time.Since(startTime), hmLen, srcOrigLen)
|
||||
logger.Infof("loaded %s from %q in %s; entriesCount: %d; sizeBytes: %d", name, path, time.Since(startTime), hmLen, srcOrigLen)
|
||||
return &hourMetricIDs{
|
||||
m: m,
|
||||
hour: hourLoaded,
|
||||
@ -518,17 +518,17 @@ func (s *Storage) mustSaveHourMetricIDs(hm *hourMetricIDs, name string) {
|
||||
if err := ioutil.WriteFile(path, dst, 0644); err != nil {
|
||||
logger.Panicf("FATAL: cannot write %d bytes to %q: %s", len(dst), path, err)
|
||||
}
|
||||
logger.Infof("saved %s to %q in %s; entriesCount: %d; bytesSize: %d", name, path, time.Since(startTime), len(hm.m), len(dst))
|
||||
logger.Infof("saved %s to %q in %s; entriesCount: %d; sizeBytes: %d", name, path, time.Since(startTime), len(hm.m), len(dst))
|
||||
}
|
||||
|
||||
func (s *Storage) mustLoadCache(info, name string, bytesSize int) *fastcache.Cache {
|
||||
func (s *Storage) mustLoadCache(info, name string, sizeBytes int) *fastcache.Cache {
|
||||
path := s.cachePath + "/" + name
|
||||
logger.Infof("loading %s cache from %q...", info, path)
|
||||
startTime := time.Now()
|
||||
c := fastcache.LoadFromFileOrNew(path, bytesSize)
|
||||
c := fastcache.LoadFromFileOrNew(path, sizeBytes)
|
||||
var cs fastcache.Stats
|
||||
c.UpdateStats(&cs)
|
||||
logger.Infof("loaded %s cache from %q in %s; entriesCount: %d; bytesSize: %d",
|
||||
logger.Infof("loaded %s cache from %q in %s; entriesCount: %d; sizeBytes: %d",
|
||||
info, path, time.Since(startTime), cs.EntriesCount, cs.BytesSize)
|
||||
return c
|
||||
}
|
||||
@ -544,7 +544,7 @@ func (s *Storage) mustSaveCache(c *fastcache.Cache, info, name string) {
|
||||
var cs fastcache.Stats
|
||||
c.UpdateStats(&cs)
|
||||
c.Reset()
|
||||
logger.Infof("saved %s cache to %q in %s; entriesCount: %d; bytesSize: %d",
|
||||
logger.Infof("saved %s cache to %q in %s; entriesCount: %d; sizeBytes: %d",
|
||||
info, path, time.Since(startTime), cs.EntriesCount, cs.BytesSize)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user