MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / getInfo

Method getInfo

src/storage/rocksdbfactory.cpp:216–232  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

214}
215
216sdsstring RocksDBStorageFactory::getInfo() const
217{
218 struct statvfs fiData;
219 int status = statvfs(m_path.c_str(), &fiData);
220 if ( status == 0 ) {
221 return sdsstring(sdscatprintf(sdsempty(),
222 "storage_flash_used_bytes:%zu\r\n"
223 "storage_flash_total_bytes:%zu\r\n"
224 "storage_flash_rocksdb_bytes:%zu\r\n",
225 fiData.f_bfree * fiData.f_frsize,
226 fiData.f_blocks * fiData.f_frsize,
227 totalDiskspaceUsed()));
228 } else {
229 fprintf(stderr, "Failed to gather FLASH statistics with status: %d\r\n", status);
230 return sdsstring(sdsempty());
231 }
232}

Callers 1

genRedisInfoStringFunction · 0.45

Calls 4

statvfsClass · 0.85
sdsstringClass · 0.85
sdscatprintfFunction · 0.85
sdsemptyFunction · 0.85

Tested by

no test coverage detected