Skip to content

Commit

Permalink
storage:rocks_storage.go update metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
fengzi committed Apr 28, 2018
1 parent d8b8b9c commit ccacf20
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions storage/rocks_storage.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package storage

import (
"strconv"
"sync"
"time"

Expand Down Expand Up @@ -175,18 +176,17 @@ func RecordMetrics(storage *RocksStorage) {
cacheSize := storage.cache.GetUsage()
pinnedSize := storage.cache.GetPinnedUsage()

readersMemByte, err := byteutils.FromHex(readersMemStr)
readersMem, err := strconv.Atoi(readersMemStr)
if err != nil {
break
}

allMemTablesByte, err := byteutils.FromHex(allMemTablesStr)
allMemTables, err := strconv.Atoi(allMemTablesStr)
if err != nil {
break
}

metricsBlocksdbAllMemTables.Update(byteutils.Int64(allMemTablesByte))
metricsBlocksdbTableReaderMem.Update(byteutils.Int64(readersMemByte))
metricsBlocksdbAllMemTables.Update(int64(allMemTables))
metricsBlocksdbTableReaderMem.Update(int64(readersMem))
metricsBlocksdbCacheSize.Update(int64(cacheSize))
metricsBlocksdbCachePinnedSize.Update(int64(pinnedSize))
}
Expand Down

0 comments on commit ccacf20

Please sign in to comment.