r9143: print out the rate of rounttrips
authorStefan Metzmacher <metze@samba.org>
Fri, 5 Aug 2005 22:22:15 +0000 (22:22 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:31:22 +0000 (13:31 -0500)
metze

swat/esptest/qooxdoo.esp

index ed43fd41c60b60515109bc86a499e549c19c5b9d..f98fe01bd4990161b1b994d25152bc10fb5a03e9 100644 (file)
@@ -48,7 +48,6 @@
 
     var stopit = 0;
     var shared = new Object();
-    shared.counter = 0;
 
     function callback(o) {
            shared = o;
                    r = r + "\\t" + i + " : " + shared[i] + "\\n";
            }
            ta.setText(r);
+           if (shared.start_time == 0) {
+                   shared.start_time = shared.nttime;
+           }
+           shared.time_diff = shared.nttime - shared.start_time;
+           shared.rate = shared.counter / (shared.time_diff * 0.0000001);
            shared.counter++;
            if (stopit == 0) {
                    server_call('remote.esp', 'testfunc', callback, shared);
@@ -67,6 +71,8 @@
            server_call('remote.esp', 'printf', null, 
                        "Starting calls ... (stopit=%d)\\n", stopit);
            stopit = 0;
+           shared.counter = 0;
+           shared.start_time = 0;
            server_call('remote.esp', 'testfunc', callback, shared);
     };