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
(This used to be commit c0e055ac989a24c2b6ad14a0eb2b3f8509cb9bab)

swat/esptest/qooxdoo.esp

index ed43fd4..f98fe01 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);
     };