mirror of
https://github.com/ceph/ceph
synced 2024-12-21 02:42:48 +00:00
logger: fixes
This commit is contained in:
parent
61dd86d97e
commit
48533a5c2d
@ -31,7 +31,7 @@ class LogType {
|
||||
|
||||
public:
|
||||
LogType(int first, int tail) :
|
||||
first_key(first), num_keys(tail-first),
|
||||
first_key(first), num_keys(tail-first - 1),
|
||||
key_name(num_keys), inc_keys(num_keys), avg_keys(num_keys) {
|
||||
for (int i=0; i<num_keys; i++) {
|
||||
key_name[i] = 0;
|
||||
@ -40,7 +40,7 @@ class LogType {
|
||||
}
|
||||
}
|
||||
int lookup_key(int key, bool isnew=false) {
|
||||
int i = key - first_key;
|
||||
int i = key - first_key - 1;
|
||||
assert(i >= 0 && i < num_keys);
|
||||
assert(isnew || key_name[i]);
|
||||
return i;
|
||||
|
@ -165,9 +165,9 @@ void Logger::_flush()
|
||||
if (wrote_header_last > 10) {
|
||||
out << "#" << type->num_keys;
|
||||
for (int i=0; i<type->num_keys; i++) {
|
||||
out << "\t" << type->key_name[i];
|
||||
out << "\t" << (type->key_name[i] ? type->key_name[i] : "???");
|
||||
if (type->avg_keys[i])
|
||||
out << "\t" << type->key_name[i] << "*\t" << type->key_name[i] << "~";
|
||||
out << "\t(n)\t(var)";
|
||||
}
|
||||
out << std::endl; //out << "\t (" << type->keymap.size() << ")" << endl;
|
||||
wrote_header_last = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user