1
0
forked from MTSR/mapserver

add changed_block_count metric (counter)

This commit is contained in:
NatureFreshMilk 2019-03-22 12:57:04 +01:00
parent 4bacd9dfa9
commit b545f3580a
2 changed files with 10 additions and 0 deletions

View File

@ -31,6 +31,8 @@ func (a *MapBlockAccessor) FindMapBlocksByMtime(lastmtime int64, limit int, laye
blocks, err := a.accessor.FindBlocksByMtime(lastmtime, limit)
timer.ObserveDuration()
changedBlockCount.Add(float64(len(blocks)))
if err != nil {
return nil, err
}

View File

@ -23,6 +23,12 @@ var (
Help: "Count of db blocks inserted",
},
)
changedBlockCount = prometheus.NewCounter(
prometheus.CounterOpts{
Name: "changed_block_count",
Help: "Count of db blocks changed (database)",
},
)
cacheBlocks = prometheus.NewGauge(
prometheus.GaugeOpts{
Name: "dbcache_blocks",
@ -48,6 +54,8 @@ func init() {
prometheus.MustRegister(cacheBlockCount)
prometheus.MustRegister(cacheBlocks)
prometheus.MustRegister(changedBlockCount)
prometheus.MustRegister(dbGetDuration)
prometheus.MustRegister(dbGetMtimeDuration)
}