forked from MTSR/mapserver
add changed_block_count metric (counter)
This commit is contained in:
parent
4bacd9dfa9
commit
b545f3580a
@ -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
|
||||
}
|
||||
|
@ -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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user