mirror of https://gitee.com/bigwinds/arangodb
fix figures
This commit is contained in:
parent
1e0ce29d5b
commit
17e9ea3d39
|
@ -1220,8 +1220,16 @@ void RocksDBCollection::deferDropCollection(
|
|||
|
||||
/// @brief return engine-specific figures
|
||||
void RocksDBCollection::figuresSpecific(
|
||||
std::shared_ptr<arangodb::velocypack::Builder>&) {
|
||||
// no specific figures yet
|
||||
std::shared_ptr<arangodb::velocypack::Builder>& builder) {
|
||||
|
||||
rocksdb::TransactionDB* db = rocksutils::globalRocksDB();
|
||||
RocksDBKeyBounds bounds = RocksDBKeyBounds::CollectionDocuments(_objectId);
|
||||
rocksdb::Range r(bounds.start(), bounds.end());
|
||||
|
||||
uint64_t out = 0;
|
||||
db->GetApproximateSizes(&r, 1, &out, true);
|
||||
|
||||
builder->add("documentsSize", VPackValue(out));
|
||||
}
|
||||
|
||||
/// @brief creates the initial indexes for the collection
|
||||
|
|
|
@ -383,9 +383,16 @@ std::shared_ptr<arangodb::velocypack::Builder> PhysicalCollection::figures() {
|
|||
// add index information
|
||||
size_t sizeIndexes = memory();
|
||||
size_t numIndexes = 0;
|
||||
bool seenEdgeIndex = false;
|
||||
for (auto const& idx : _indexes) {
|
||||
// only count an edge index instance
|
||||
if (idx->type() != Index::TRI_IDX_TYPE_EDGE_INDEX || !seenEdgeIndex) {
|
||||
++numIndexes;
|
||||
}
|
||||
if (idx->type() == Index::TRI_IDX_TYPE_EDGE_INDEX) {
|
||||
seenEdgeIndex = true;
|
||||
}
|
||||
sizeIndexes += static_cast<size_t>(idx->memory());
|
||||
++numIndexes;
|
||||
}
|
||||
|
||||
builder->add("indexes", VPackValue(VPackValueType::Object));
|
||||
|
|
Loading…
Reference in New Issue