summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2007-02-18 02:12:50 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:48:29 -0500
commitd0feaf0c0314c0f867a2f8e94b7b1774634d29d5 (patch)
treec99e9ea0316d7ba7616f51eef8ffdef1a29044cf
parent446b6bfcba8fd33748fe87e7deef12149bb6a7d4 (diff)
downloadsamba-d0feaf0c0314c0f867a2f8e94b7b1774634d29d5.tar.gz
samba-d0feaf0c0314c0f867a2f8e94b7b1774634d29d5.tar.bz2
samba-d0feaf0c0314c0f867a2f8e94b7b1774634d29d5.zip
r21418: Return the ratio as well
(This used to be commit 56ed4499d69adf57a41632ba12cbfef383a35ab2)
-rw-r--r--source4/torture/local/dbspeed.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/source4/torture/local/dbspeed.c b/source4/torture/local/dbspeed.c
index ba2517e24d..08012fc5e9 100644
--- a/source4/torture/local/dbspeed.c
+++ b/source4/torture/local/dbspeed.c
@@ -28,6 +28,7 @@
#include "lib/db_wrap.h"
#include "torture/torture.h"
+float tdb_speed;
static BOOL tdb_add_record(struct tdb_wrap *tdbw, const char *fmt1, const char *fmt2, int i)
{
@@ -110,7 +111,8 @@ static BOOL test_tdb_speed(struct torture_context *torture, const void *_data)
free(data.dptr);
}
- torture_comment(torture, "tdb speed %.2f ops/sec\n", count/timeval_elapsed(&tv));
+ tdb_speed = count/timeval_elapsed(&tv);
+ torture_comment(torture, "tdb speed %.2f ops/sec\n", tdb_speed);
unlink("test.tdb");
@@ -164,6 +166,7 @@ static BOOL test_ldb_speed(struct torture_context *torture, const void *_data)
struct ldb_ldif *ldif;
const char *init_ldif = "dn: @INDEXLIST\n" \
"@IDXATTR: UID\n";
+ float ldb_speed;
unlink("./test.ldb");
@@ -227,7 +230,10 @@ static BOOL test_ldb_speed(struct torture_context *torture, const void *_data)
torture_fail(torture, "memory leak in ldb search");
}
- torture_comment(torture, "ldb speed %.2f ops/sec\n", count/timeval_elapsed(&tv));
+ ldb_speed = count/timeval_elapsed(&tv);
+ torture_comment(torture, "ldb speed %.2f ops/sec\n", ldb_speed);
+
+ torture_comment(torture, "ldb/tdb speed ratio is %.2f%%\n", (100*ldb_speed/tdb_speed));
unlink("./test.ldb");