rocksdb/db/db_statistics.h
Dhruba Borthakur f50ece60c7 Fix table-cache size bug, gather table-cache statistics and prevent readahead done by fs. Summary:
Summary:
The db_bench test was not using the specified value for the max-file-open. Fixed.

The fs readhead is switched off.

Gather statistics about the table cache and print it out at the end of the tets run.

Test Plan: Revert Plan:

Reviewers: adsharma, sc

Reviewed By: adsharma

Differential Revision: https://reviews.facebook.net/D3441
2012-05-30 16:42:45 -07:00

37 lines
683 B
C++

// Copyright (c) 2011 The LevelDB Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. See the AUTHORS file for names of contributors.
#include <stdlib.h>
#include "leveldb/statistics.h"
#include "port/port.h"
#include "util/mutexlock.h"
namespace leveldb {
class DBStatistics: public Statistics {
public:
DBStatistics() { }
void incNumFileOpens() {
MutexLock l(&mu_);
numFileOpens_++;
}
void incNumFileCloses() {
MutexLock l(&mu_);
numFileCloses_++;
}
void incNumFileErrors() {
MutexLock l(&mu_);
numFileErrors_++;
}
private:
port::Mutex mu_;
};
}