diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2011-09-14 08:10:13 +0930 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2011-09-14 08:10:13 +0930 |
commit | 26f3587d4bf60fe3c82084a7661c4f856534725f (patch) | |
tree | 4268149def9655420fc296e01dc98e9102039685 /lib/tdb2/tdb1_transaction.c | |
parent | b30bb0ed903a49a9a81d0418211e4f985eca20ab (diff) | |
download | samba-26f3587d4bf60fe3c82084a7661c4f856534725f.tar.gz samba-26f3587d4bf60fe3c82084a7661c4f856534725f.tar.xz samba-26f3587d4bf60fe3c82084a7661c4f856534725f.zip |
tdb2: add stats to tdb1 backend.
It's actually quite a good fit; we use compare_wrong_bucket for dead
records, which is kind of correct (they should be in the free list).
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(Imported from CCAN commit a3e4ebff2eb9dc2e386160b8acf77d70236f4def)
Diffstat (limited to 'lib/tdb2/tdb1_transaction.c')
-rw-r--r-- | lib/tdb2/tdb1_transaction.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/tdb2/tdb1_transaction.c b/lib/tdb2/tdb1_transaction.c index ecd7d2628e..126f768468 100644 --- a/lib/tdb2/tdb1_transaction.c +++ b/lib/tdb2/tdb1_transaction.c @@ -432,6 +432,7 @@ static int _tdb1_transaction_start(struct tdb_context *tdb) tdb->last_error = TDB_ERR_EINVAL; return -1; } + tdb->stats.transaction_nest++; tdb->tdb1.transaction->nesting++; return 0; } @@ -511,6 +512,7 @@ static int _tdb1_transaction_start(struct tdb_context *tdb) tdb->tdb1.transaction->io_methods = tdb->tdb1.io; tdb->tdb1.io = &transaction1_methods; + tdb->stats.transactions++; return 0; fail: @@ -621,6 +623,7 @@ static int _tdb1_transaction_cancel(struct tdb_context *tdb) */ int tdb1_transaction_cancel(struct tdb_context *tdb) { + tdb->stats.transaction_cancel++; return _tdb1_transaction_cancel(tdb); } @@ -739,6 +742,7 @@ static int tdb1_recovery_allocate(struct tdb_context *tdb, " failed to create recovery area"); return -1; } + tdb->stats.transaction_expand_file++; /* remap the file (if using mmap) */ methods->tdb1_oob(tdb, tdb->file->map_size + 1, 1); @@ -1000,6 +1004,7 @@ static int _tdb1_transaction_prepare_commit(struct tdb_context *tdb) " expansion failed"); return -1; } + tdb->stats.transaction_expand_file++; tdb->file->map_size = tdb->tdb1.transaction->old_map_size; methods->tdb1_oob(tdb, tdb->file->map_size + 1, 1); } |