files for test case
authorbdemsky <bdemsky>
Fri, 16 Mar 2007 01:14:53 +0000 (01:14 +0000)
committerbdemsky <bdemsky>
Fri, 16 Mar 2007 01:14:53 +0000 (01:14 +0000)
Robust/src/Benchmarks/Chat/BRISTLECONE [new file with mode: 0644]
Robust/src/Benchmarks/Chat/ChatServer.java
Robust/src/Benchmarks/Chat/analyze.java [new file with mode: 0644]
Robust/src/Benchmarks/Chat/doall [new file with mode: 0755]
Robust/src/Benchmarks/Chat/runtest.sh [new file with mode: 0755]

diff --git a/Robust/src/Benchmarks/Chat/BRISTLECONE b/Robust/src/Benchmarks/Chat/BRISTLECONE
new file mode 100644 (file)
index 0000000..4e3d652
--- /dev/null
@@ -0,0 +1 @@
+-initializerandom -injectinstructionfailures 45 0.0001667 10 -debugtask
index 50d256b92ca5c9f6abca37a689591e731eb7f186..773a13406b40778546f7afa39f3b6e193acc927d 100644 (file)
@@ -25,11 +25,11 @@ task ProcessRoom(ChatSocket cs{ProcessRoom}, RoomObject ro{Initialized}) {
 task Message(ChatSocket cs{InRoom && IOPending}) {
     byte buffer[]=new byte[1024];
     int length=cs.read(buffer);
-    String st=(new String(buffer)).subString(0, length);
-    Message m=new Message(st, cs){};
+    Message m=new Message(buffer, length, cs){};
 }
 
 task SendMessage(Message m{!Sent}) {
-    m.cs.room.sendToRoom(m.cs,m.st.getBytes());
+    String st=(new String(m.buffer)).subString(0, m.length);
+    m.cs.room.sendToRoom(m.cs,st.getBytes());
     taskexit(m {Sent});
 }
diff --git a/Robust/src/Benchmarks/Chat/analyze.java b/Robust/src/Benchmarks/Chat/analyze.java
new file mode 100644 (file)
index 0000000..fb376c1
--- /dev/null
@@ -0,0 +1,21 @@
+import java.io.*;
+public class analyze {
+    public static void main(String[] q) {
+       int sum=0;
+       int count=0;
+       try {
+       BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
+       while(true) {
+           String s=br.readLine();
+           String x=s.substring(6,s.indexOf(' ',6));
+           
+           sum+=(new Integer(x)).intValue();
+           count++;
+           System.out.println(sum+"   "+(((double)sum)/count));
+       }
+       } catch(Exception e) {}
+    }
+
+
+
+}
diff --git a/Robust/src/Benchmarks/Chat/doall b/Robust/src/Benchmarks/Chat/doall
new file mode 100755 (executable)
index 0000000..c2f9465
--- /dev/null
@@ -0,0 +1,7 @@
+#!/bin/bash
+./runtest.sh taskchat.bin &> tasklog
+mkdir task
+mv *.log task
+./runtest.sh threadchat.bin &> threadlog
+mkdir thread
+mv *.log thread
\ No newline at end of file
diff --git a/Robust/src/Benchmarks/Chat/runtest.sh b/Robust/src/Benchmarks/Chat/runtest.sh
new file mode 100755 (executable)
index 0000000..81be157
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/bash
+let i=0
+while [ $i -le 100 ];
+do
+./$1 &> $i.log &
+sleep 1
+java NetsClient 127.0.0.1 8000 2 50 8 1
+killall -SIGUSR2 $1
+sleep 1
+killall -9 $1
+let "i+=1"
+done
\ No newline at end of file