]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
added 2 more workloads
authoranwleung <anwleung@29311d96-e01e-0410-9327-a35deaab8ce9>
Sat, 31 Mar 2007 05:38:01 +0000 (05:38 +0000)
committeranwleung <anwleung@29311d96-e01e-0410-9327-a35deaab8ce9>
Sat, 31 Mar 2007 05:38:01 +0000 (05:38 +0000)
git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@1328 29311d96-e01e-0410-9327-a35deaab8ce9

branches/aleung/security1/ceph/client/SyntheticClient.cc
branches/aleung/security1/ceph/client/SyntheticClient.h

index fa44490cc52b23f95569d5fc7f66490148b095c5..d34a757608592075d92c67db40059d3ae942c2b7 100644 (file)
@@ -57,6 +57,12 @@ void parse_syn_options(vector<char*>& args)
       } else if (strcmp(args[i],"ior") == 0) {
         syn_modes.push_back( SYNCLIENT_MODE_IOR2 );
         syn_iargs.push_back( atoi(args[++i]) );
+      } else if (strcmp(args[i],"mixed") == 0) {
+        syn_modes.push_back( SYNCLIENT_MODE_MIXED );
+        syn_iargs.push_back( atoi(args[++i]) );
+      } else if (strcmp(args[i],"renewal") == 0) {
+        syn_modes.push_back( SYNCLIENT_MODE_RENEWAL );
+        syn_iargs.push_back( atoi(args[++i]) );
       } else if (strcmp(args[i],"wrshared") == 0) {
         syn_modes.push_back( SYNCLIENT_MODE_WRSHARED );
         syn_iargs.push_back( atoi(args[++i]) );
@@ -412,10 +418,10 @@ int SyntheticClient::run()
        cout << "Setup trace:" << setupfile << endl;
 
        // choose random IOR2 file to open
-       //int randf = rand() % 500;
+       int filenum = rand() % 500;
        // cant be trace 0, its broken
-       //randf++;
-       int filenum = client->whoami + 1;
+       filenum++;
+       //int filenum = client->whoami + 1;
        
        ostringstream ost;
        ost << "IOR2/IOR_trace_fileperproc.p" << filenum << "t.cephtrace";
@@ -443,6 +449,71 @@ int SyntheticClient::run()
        
       }
       break;
+    case SYNCLIENT_MODE_MIXED:
+      {
+       string shared1 = "/shared1";
+       string shared2 = "/shared2";
+       string shared3 = "/shared3";
+       string shared4 = "/shared4";
+       string shared5 = "/shared5";
+       string shared6 = "/shared6";
+
+       string personal1 = get_sarg(0);
+       string personal2 = get_sarg(1);
+       string personal3 = get_sarg(2);
+       string personal4 = get_sarg(3);
+
+        int iterations = iargs.front();  iargs.pop_front();
+
+       int size = 10;
+       int inc = 128*1024;
+
+       if (run_me()) {
+         
+          for (int i=0; i<iterations; i++) {
+
+           if (time_to_stop()) break;
+           write_file(shared1, size, inc);
+           write_file(personal1, size, inc);
+           write_file(shared2, size, inc);
+           write_file(shared3, size, inc);
+           write_file(personal2, size, inc);
+           write_file(shared4, size, inc);
+           write_file(personal3, size, inc);
+           write_file(shared5, size, inc);
+           write_file(personal4, size, inc);
+           write_file(shared6, size, inc);
+          }
+         
+        }
+      }
+      break;
+    case SYNCLIENT_MODE_RENEWAL:
+      {
+        int stop_int = iargs.front();  iargs.pop_front();
+       utime_t stop_time(stop_int, 0);
+
+       int size = 32;
+       int inc = 1024*1024;
+
+       if (run_me()) {
+         utime_t start_time = g_clock.now();
+         utime_t cur_time = g_clock.now();
+         int counter = 0;
+         string pfile;
+          while (cur_time - start_time < stop_time) {
+           pfile = get_sarg(counter);
+           if (time_to_stop()) break;
+           cout << "Writting " << pfile << endl;
+           write_file(pfile, size, inc);
+           cur_time = g_clock.now();
+           cout << "Time check " << cur_time - start_time << endl;
+           counter++;
+          }
+         
+        }
+      }
+      break;
     case SYNCLIENT_MODE_WRITEFILE:
       {
         string sarg1 = get_sarg(0);
index 515e605131ada3da2aca5df89b852edb24b3a077..1a06fac1f96a362c6fd64c75e5c2e953fecede76 100644 (file)
@@ -37,6 +37,8 @@
 #define SYNCLIENT_MODE_CREATESHARED 13     // num
 #define SYNCLIENT_MODE_OPENSHARED   14     // num count
 #define SYNCLIENT_MODE_IOR2         15
+#define SYNCLIENT_MODE_MIXED        16
+#define SYNCLIENT_MODE_RENEWAL      17
 
 #define SYNCLIENT_MODE_WRITEFILE   20
 #define SYNCLIENT_MODE_READFILE    21