1
0
Fork 0

fix figures

This commit is contained in:
jsteemann 2017-05-11 00:25:20 +02:00
parent 1e0ce29d5b
commit 17e9ea3d39
2 changed files with 18 additions and 3 deletions

View File

@ -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

View File

@ -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));