Skip to content

Commit

Permalink
statistic: add the statistic of flow (#1548)
Browse files Browse the repository at this point in the history
* store_statistic: add the statistic of flow

Signed-off-by: nolouch <nolouch@gmail.com>
  • Loading branch information
nolouch committed May 22, 2019
1 parent 0fe66a0 commit c44ddf4
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions server/store_statistics.go
Expand Up @@ -101,6 +101,15 @@ func (s *storeStatistics) Observe(store *core.StoreInfo) {
storeStatusGauge.WithLabelValues(s.namespace, storeAddress, id, "store_available").Set(float64(store.GetAvailable()))
storeStatusGauge.WithLabelValues(s.namespace, storeAddress, id, "store_used").Set(float64(store.GetUsedSize()))
storeStatusGauge.WithLabelValues(s.namespace, storeAddress, id, "store_capacity").Set(float64(store.GetCapacity()))

// Store flows.
storeFlowStats := store.GetRollingStoreStats()
storeWriteRateBytes, storeReadRateBytes := storeFlowStats.GetBytesRate()
storeStatusGauge.WithLabelValues(s.namespace, storeAddress, id, "store_write_rate_bytes").Set(float64(storeWriteRateBytes))
storeStatusGauge.WithLabelValues(s.namespace, storeAddress, id, "store_read_rate_bytes").Set(float64(storeReadRateBytes))
storeWriteRateKeys, storeReadRateKeys := storeFlowStats.GetKeysWriteRate(), storeFlowStats.GetKeysReadRate()
storeStatusGauge.WithLabelValues(s.namespace, storeAddress, id, "store_write_rate_keys").Set(float64(storeWriteRateKeys))
storeStatusGauge.WithLabelValues(s.namespace, storeAddress, id, "store_read_rate_keys").Set(float64(storeReadRateKeys))
}

func (s *storeStatistics) Collect() {
Expand Down

0 comments on commit c44ddf4

Please sign in to comment.