increased verbosity of test

git-svn-id: svn+ssh://svn.corp.yahoo.com/yahoo/yrl/labs/pnuts/code/logstore@2936 8dad8b1f-cf64-0410-95b6-bcf113ffbcfe
This commit is contained in:
sears 2011-08-22 23:50:14 +00:00
parent a780f4b78f
commit f05ccec98f

View file

@ -17,8 +17,7 @@
#include "regionAllocator.h" #include "regionAllocator.h"
#include <stasis/transactional.h> #include <stasis/transactional.h>
#undef begin #include <stasis/util/time.h>
#undef end
void insertWithConcurrentReads(size_t NUM_ENTRIES) { void insertWithConcurrentReads(size_t NUM_ENTRIES) {
srand(1001); srand(1001);
@ -59,6 +58,7 @@ void insertWithConcurrentReads(size_t NUM_ENTRIES) {
int64_t datasize = 0; int64_t datasize = 0;
std::vector<pageid_t> dsp; std::vector<pageid_t> dsp;
size_t last_i = 0; size_t last_i = 0;
for(size_t i = 0; i < NUM_ENTRIES; i++) for(size_t i = 0; i < NUM_ENTRIES; i++)
{ {
//prepare the key //prepare the key
@ -108,16 +108,17 @@ void insertWithConcurrentReads(size_t NUM_ENTRIES) {
assert(i < j); assert(i < j);
} }
} }
if(dp) { if(dp) {
dp->writes_done(); dp->writes_done();
delete dp; delete dp;
} }
printf("Total data set length: %lld\n", (long long)datasize); printf("Total data set length: %lld\n", (long long)datasize);
printf("Storage utilization: %.2f\n", (datasize+.0) / (PAGE_SIZE * pcount * dpages)); printf("Storage utilization: %.2f\n", (datasize+.0) / (PAGE_SIZE * pcount * dpages));
printf("Number of datapages: %d\n", dpages); printf("Number of datapages: %d\n", dpages);
printf("Writes complete.\n"); printf("Writes complete.\n");
Tcommit(xid); Tcommit(xid);
logtable::deinit_stasis(); logtable::deinit_stasis();
@ -154,6 +155,10 @@ void insertProbeIter(size_t NUM_ENTRIES)
RegionAllocator * alloc = new RegionAllocator(xid, 10000); // ~ 10 datapages per region. RegionAllocator * alloc = new RegionAllocator(xid, 10000); // ~ 10 datapages per region.
printf("Stage 1: Writing %llu keys\n", (unsigned long long)NUM_ENTRIES); printf("Stage 1: Writing %llu keys\n", (unsigned long long)NUM_ENTRIES);
struct timeval start, stop;
gettimeofday(&start, 0);
int pcount = 1000; int pcount = 1000;
int dpages = 0; int dpages = 0;
@ -181,15 +186,18 @@ void insertProbeIter(size_t NUM_ENTRIES)
dsp.push_back(dp->get_start_pid()); dsp.push_back(dp->get_start_pid());
} }
} }
gettimeofday(&stop, 0);
if(dp) { if(dp) {
dp->writes_done(); dp->writes_done();
delete dp; delete dp;
} }
printf("Total data set length: %lld\n", (long long)datasize); printf("Total data set length: %lld\n", (long long)datasize);
printf("Storage utilization: %.2f\n", (datasize+.0) / (PAGE_SIZE * pcount * dpages)); printf("Storage utilization: %.2f\n", (datasize+.0) / (PAGE_SIZE * pcount * dpages));
printf("Number of datapages: %d\n", dpages); printf("Number of datapages: %d\n", dpages);
printf("Writes complete.\n"); printf("Writes complete.\n");
double elapsed = stasis_timeval_to_double(stasis_subtract_timeval(stop, start));
printf("Writes took %f seconds; %f mb/sec\n", elapsed, ((double)datasize)/(1024.0*1024.0*elapsed));
Tcommit(xid); Tcommit(xid);
xid = Tbegin(); xid = Tbegin();