From aed778a64ac772044dcebc803fb2d90d75c0fb02 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 9 Jun 2009 20:17:13 -0700 Subject: [PATCH] rados: remove testradoscio[pp] targets --- src/Makefile.am | 9 +-- src/testradoscio.c | 82 --------------------- src/testradosciopp.cc | 167 ------------------------------------------ 3 files changed, 1 insertion(+), 257 deletions(-) delete mode 100644 src/testradoscio.c delete mode 100644 src/testradosciopp.cc diff --git a/src/Makefile.am b/src/Makefile.am index 13a15a77f12..35e9a66981e 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -49,7 +49,7 @@ bin_PROGRAMS = \ ceph cconf \ mkmonfs monmaptool osdmaptool crushtool \ streamtest dupstore dumpjournal testmsgr \ - testrados testradospp testradoscio testradosciopp \ + testrados testradospp \ radostool sbin_PROGRAMS = \ @@ -121,13 +121,6 @@ testrados_LDADD = librados.la libcrush.la testradospp_SOURCES = testradospp.cc testradospp_LDADD = librados.la libcrush.la -#testradoscio_SOURCES = testradoscio.c librados.cc msg/SimpleMessenger.cc -#testradoscio_LDADD = libosdc.a libcrush.a libcommon.a -testradoscio_SOURCES = testradoscio.c -testradoscio_LDADD = librados.la libcrush.la -testradosciopp_SOURCES = testradosciopp.cc -testradosciopp_LDADD = librados.la libcrush.la - ## object classes # libtestclass.so: testclass.cc diff --git a/src/testradoscio.c b/src/testradoscio.c deleted file mode 100644 index 8fb338c1956..00000000000 --- a/src/testradoscio.c +++ /dev/null @@ -1,82 +0,0 @@ -// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- -// vim: ts=8 sw=2 smarttab -/* - * Ceph - scalable distributed file system - * - * - * This is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License version 2.1, as published by the Free Software - * Foundation. See file COPYING. - * - */ - -#include "include/librados.h" - -#include -#include -#include - -int main(int argc, const char **argv) { - if (argc<2) { - printf("need to assign # of concurrent ios to perform!\n"); - exit(1); - } - - int concurrentios = atoi(argv[1]); - printf("Performing %d ios\n", concurrentios); - - if (rados_initialize(argc, argv) < 0) { - printf("error initializing\n"); - exit(1); - } - - rados_pool_t pool; - int r = rados_open_pool("data", &pool); - printf("open pool result = %d, pool = %d\n", r, pool); - - rados_completion_t completions[concurrentios]; - char* name[concurrentios]; - char contents[128]; - // char* buffers[concurrentios]; - int i; - for (i=0; i -#include -#include -#include -#include -#include "common/Clock.h" -#include "include/utime.h" - -int main (int argc, const char **argv) { - Rados rados; - rados_pool_t pool; - if (rados.initialize(0, NULL) < 0) { - cerr << "couldn't initialize rados!\n"; - exit(1); - } - - //hacky arguments; fix this - int concurrentios = atoi(argv[1]); - int secondsToRun = double(atoi(argv[2])); - int writeSize = atoi(argv[3]); //bytes - int readOffResults = atoi(argv[4]); - - cout << "Maintaining " << concurrentios << " concurrent writes of " << writeSize - << " bytes for at least " << secondsToRun << " seconds.\n"; - - Rados::AioCompletion* completions[concurrentios]; - char* name[concurrentios]; - bufferlist* contents[concurrentios]; - char contentsChars[writeSize]; - double totalLatency = 0; - utime_t maxLatency; - utime_t startTimes[concurrentios]; - int writesMade = 0; - int writesCompleted = 0; - time_t initialTime; - utime_t startTime; - utime_t stopTime; - - time(&initialTime); - stringstream initialTimeS(""); - initialTimeS << initialTime; - const char* iTime = initialTimeS.str().c_str(); - maxLatency.set_from_double(0); - //set up writes so I can start them together - for (int i = 0; iappend(contentsChars, writeSize); - } - - //set up the pool, get start time, and go! - cout << "open pool result = " << rados.open_pool("data",&pool) << " pool = " << pool << std::endl; - - startTime = g_clock.now(); - - for (int i = 0; iappend(contentsChars, writeSize); - completions[slot]->wait_for_complete(); - currentLatency = g_clock.now() - startTimes[slot]; - totalLatency += currentLatency; - if( currentLatency > maxLatency) maxLatency = currentLatency; - ++writesCompleted; - completions[slot]->release(); - //write new stuff to rados, then delete old stuff - //and save locations of new stuff for later deletion - startTimes[slot] = g_clock.now(); - rados.aio_write(pool, newName, 0, *newContents, writeSize, &completions[slot]); - ++writesMade; - delete name[slot]; - delete contents[slot]; - name[slot] = newName; - contents[slot] = newContents; - } - - cerr << "Waiting for last writes to finish\n"; - while (writesCompleted < writesMade) { - slot = writesCompleted % concurrentios; - completions[slot]->wait_for_complete(); - currentLatency = g_clock.now() - startTimes[slot]; - totalLatency += currentLatency; - if (currentLatency > maxLatency) maxLatency = currentLatency; - completions[slot]-> release(); - ++writesCompleted; - delete name[slot]; - delete contents[slot]; - } - - utime_t timePassed = g_clock.now() - startTime; - - //check objects for consistency if requested - int errors = 0; - if (readOffResults) { - char matchName[128]; - object_t oid; - bufferlist actualContents; - for (int i = 0; i < writesCompleted; ++i ) { - snprintf(matchName, 128, "Object %s:%d", iTime, i); - oid = object_t(matchName); - snprintf(contentsChars, writeSize, "I'm the %dth object!", i); - rados.read(pool, oid, 0, actualContents, writeSize); - if (strcmp(contentsChars, actualContents.c_str()) != 0 ) { - cerr << "Object " << matchName << " is not correct!"; - ++errors; - } - actualContents.clear(); - } - } - - char bw[20]; - double bandwidth = ((double)writesCompleted)*((double)writeSize)/(double)timePassed; - bandwidth = bandwidth/(1024*1024); // we want it in MB/sec - sprintf(bw, "%.3lf \n", bandwidth); - - double averageLatency = totalLatency / writesCompleted; - - cout << "Total time run: " << timePassed << endl - << "Total writes made: " << writesCompleted << endl - << "Write size: " << writeSize << endl - << "Bandwidth (MB/sec): " << bw << endl - << "Average Latency: " << averageLatency << endl - << "Max latency: " << maxLatency << endl - << "Time waiting for Rados:" << totalLatency/concurrentios << endl; - - if (readOffResults) { - if (errors) cout << "WARNING: There were " << errors << " total errors in copying!\n"; - else cout << "No errors in copying!\n"; - } - return 0; -}