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/D3441main
parent
8f293b68a9
commit
f50ece60c7
@ -0,0 +1,36 @@ |
|||||||
|
// 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_; |
||||||
|
}; |
||||||
|
} |
||||||
|
|
||||||
|
|
@ -0,0 +1,33 @@ |
|||||||
|
// 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.
|
||||||
|
|
||||||
|
#ifndef STORAGE_LEVELDB_INCLUDE_STATISTICS_H_ |
||||||
|
#define STORAGE_LEVELDB_INCLUDE_STATISTICS_H_ |
||||||
|
|
||||||
|
namespace leveldb { |
||||||
|
|
||||||
|
// Analyze the performance of a db
|
||||||
|
class Statistics { |
||||||
|
public:
|
||||||
|
// Create an Statistics object with default values for all fields.
|
||||||
|
Statistics() : numFileOpens_(0), numFileCloses_(0), |
||||||
|
numFileErrors_(0) {} |
||||||
|
|
||||||
|
virtual void incNumFileOpens() = 0; |
||||||
|
virtual void incNumFileCloses() = 0; |
||||||
|
virtual void incNumFileErrors() = 0; |
||||||
|
|
||||||
|
virtual long getNumFileOpens() { return numFileOpens_;} |
||||||
|
virtual long getNumFileCloses() { return numFileCloses_;} |
||||||
|
virtual long getNumFileErrors() { return numFileErrors_;} |
||||||
|
|
||||||
|
protected: |
||||||
|
long numFileOpens_; |
||||||
|
long numFileCloses_; |
||||||
|
long numFileErrors_; |
||||||
|
}; |
||||||
|
|
||||||
|
} // namespace leveldb
|
||||||
|
|
||||||
|
#endif // STORAGE_LEVELDB_INCLUDE_STATISTICS_H_
|
Loading…
Reference in new issue