feat(vmselect): add tmp block dir size metrics vm_tmp_blocks_files_size_total (#527)

* feat(vmselect): add tmp block dir size metrics `vm_tmp_blocks_files_size_total`

* refactor(vmselect): use free space instead of used space in tmp block file metrics

* fix: add `bytes` suffix to tmp dir free space metric
This commit is contained in:
DexterZhang 2020-06-04 18:05:50 +08:00 committed by GitHub
parent 89a922fb19
commit fa103875a0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -85,7 +85,12 @@ func (addr tmpBlockAddr) String() string {
return fmt.Sprintf("offset %d, size %d", addr.offset, addr.size) return fmt.Sprintf("offset %d, size %d", addr.offset, addr.size)
} }
var tmpBlocksFilesCreated = metrics.NewCounter(`vm_tmp_blocks_files_created_total`) var (
tmpBlocksFilesCreated = metrics.NewCounter(`vm_tmp_blocks_files_created_total`)
_ = metrics.NewGauge(`vm_tmp_blocks_files_directory_free_bytes`, func() float64 {
return float64(fs.MustGetFreeSpace(tmpBlocksDir))
})
)
// WriteBlockData writes b to tbf. // WriteBlockData writes b to tbf.
// //