[open-ils-commits] [GIT] Evergreen ILS branch master updated. 2b3c5f1e9c0801e896ea0f2b2bda6373598b2a18

Evergreen Git git at git.evergreen-ils.org
Wed Feb 28 22:45:42 EST 2018


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  2b3c5f1e9c0801e896ea0f2b2bda6373598b2a18 (commit)
       via  b529835718c0572ccd94cb37f2a8b3bd4e7302fe (commit)
      from  13be0c3e4bd80a5f899b8d7723b9e6b64efe738e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 2b3c5f1e9c0801e896ea0f2b2bda6373598b2a18
Author: Cesar Velez <cesar.velez at equinoxinitiative.org>
Date:   Wed Feb 28 14:34:10 2018 -0500

    LP#1739504 - add release notes for Latency Tester
    
    A word about the Latency Tester.
    
    Signed-off by: Cesar Velez <cesar.velez at equinoxinitiative.org>
    Signed-off-by: Dan Wells <dbw2 at calvin.edu>

diff --git a/docs/RELEASE_NOTES_NEXT/Administration/latency_tester_tool.adoc b/docs/RELEASE_NOTES_NEXT/Administration/latency_tester_tool.adoc
new file mode 100644
index 0000000..61e377e
--- /dev/null
+++ b/docs/RELEASE_NOTES_NEXT/Administration/latency_tester_tool.adoc
@@ -0,0 +1,14 @@
+New Latency Tester Tool
+^^^^^^^^^^^^^^^^^^^^^^^
+
+The Evergreen Web Staff Client now includes link to a section under the
+Administration > Workstation called Tests. This page houses a simple tool
+that can be used to test the latency of the websocket connection between the 
+client and the server (via the opensrf.echo service).
+
+This page displays which Evergreen host server is being queried. Upon hitting
+the blue "Start Test" button for the first time, it will issue 10 sequentially
+fired requests in order to get a solid initial average. Clicking the button a
+second time will just take one more measurement and recalculate the average
+latency. The results can be copied to clipboard for troubleshooting purposes
+and also cleared from display.

commit b529835718c0572ccd94cb37f2a8b3bd4e7302fe
Author: Cesar Velez <cesar.velez at equinoxinitiative.org>
Date:   Thu Jan 4 12:56:12 2018 -0500

    LP#1739504 - Fire off each ping sequentially
    
    As suggested by berick, tweaking latency tester
    to sequentially fire off pings.
    
    Signed-off by: Cesar Velez <cesar.velez at equinoxinitiative.org>
    
    Conflicts:
    	Open-ILS/web/js/ui/default/staff/admin/workstation/app.js
    
    Signed-off-by: Dan Wells <dbw2 at calvin.edu>

diff --git a/Open-ILS/web/js/ui/default/staff/admin/workstation/app.js b/Open-ILS/web/js/ui/default/staff/admin/workstation/app.js
index 20973ff..4ca997d 100644
--- a/Open-ILS/web/js/ui/default/staff/admin/workstation/app.js
+++ b/Open-ILS/web/js/ui/default/staff/admin/workstation/app.js
@@ -937,4 +937,84 @@ function($scope , egCore , ngToast) {
 
 }])
 
+/*
+ * Home of the Latency tester
+ * */
+.controller('testsCtrl', ['$scope', '$location', 'egCore', function($scope, $location, egCore) {
+    $scope.hostname = $location.host();
+
+    $scope.tests = [];
+    $scope.clearTestData = function(){
+        $scope.tests = [];
+        numPings = 0;
+    }
+
+    $scope.isTesting = false;
+    $scope.avrg = 0; // avrg latency
+    $scope.canCopyCommand = document.queryCommandSupported('copy');
+    var numPings = 0;
+    // initially fetch first 10 (gets a decent average)
+
+    function calcAverage(){
+
+        if ($scope.tests.length == 0) return 0;
+
+        if ($scope.tests.length == 1) return $scope.tests[0].l;
+
+        var sum = 0;
+        angular.forEach($scope.tests, function(t){
+            sum += t.l;
+        });
+
+        return sum / $scope.tests.length;
+    }
+
+    function ping(){
+        $scope.isTesting = true;
+        var t = Date.now();
+        return egCore.net.request(
+            "open-ils.pcrud", "opensrf.system.echo", "ping"
+        ).then(function(resp){
+            var t2 = Date.now();
+            var latency = t2 - t;
+            $scope.tests.push({t: new Date(t), l: latency});
+            console.log("Start: " + t + " and end: " + t2);
+            console.log("Latency: " + latency);
+            console.log(resp);
+        }).then(function(){
+            $scope.avrg = calcAverage();
+            numPings++;
+            $scope.isTesting = false;
+        });
+    }
+
+    $scope.testLatency = function(){
+
+        if (numPings >= 10){
+            ping(); // just ping once after the initial ten
+        } else {
+            ping()
+                .then($scope.testLatency)
+                .then(function(){
+                    if (numPings == 9){
+                        $scope.tests.shift(); // toss first result
+                        $scope.avrg = calcAverage();
+                    }
+                });
+        }
+    }
+
+    $scope.copyTests = function(){
+
+        var lNode = document.querySelector('#pingData');
+        var r = document.createRange();
+        r.selectNode(lNode);
+        var sel = window.getSelection();
+        sel.removeAllRanges();
+        sel.addRange(r);
+        document.execCommand('copy');
+    }
+
+}])
+
 

-----------------------------------------------------------------------

Summary of changes:
 .../js/ui/default/staff/admin/workstation/app.js   |   80 ++++++++++++++++++++
 .../Administration/latency_tester_tool.adoc        |   14 ++++
 2 files changed, 94 insertions(+), 0 deletions(-)
 create mode 100644 docs/RELEASE_NOTES_NEXT/Administration/latency_tester_tool.adoc


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list