You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ea...@apache.org on 2018/11/11 20:55:54 UTC

[1/4] qpid-dispatch git commit: DISPATCH-1180 Allow mouse over address dots on traffic legend

Repository: qpid-dispatch
Updated Branches:
  refs/heads/master 58fd3d5b6 -> 86b4c08a4


DISPATCH-1180 Allow mouse over address dots on traffic legend


Project: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/commit/6d55f1d1
Tree: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/tree/6d55f1d1
Diff: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/diff/6d55f1d1

Branch: refs/heads/master
Commit: 6d55f1d10e5665d920e2bc9a24c09221de81493b
Parents: 58fd3d5
Author: Ernest Allen <ea...@redhat.com>
Authored: Sun Nov 11 15:49:30 2018 -0500
Committer: Ernest Allen <ea...@redhat.com>
Committed: Sun Nov 11 15:49:30 2018 -0500

----------------------------------------------------------------------
 console/stand-alone/plugin/html/qdrTopology.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/6d55f1d1/console/stand-alone/plugin/html/qdrTopology.html
----------------------------------------------------------------------
diff --git a/console/stand-alone/plugin/html/qdrTopology.html b/console/stand-alone/plugin/html/qdrTopology.html
index 7407123..42f06c0 100644
--- a/console/stand-alone/plugin/html/qdrTopology.html
+++ b/console/stand-alone/plugin/html/qdrTopology.html
@@ -262,7 +262,7 @@ div.titleBar button {
                                     <li ng-repeat="(address, color) in addresses" class="legend-line">
                                         <checkbox style="background-color: {{addressColors[address]}};"
                                         title="{{address}}" ng-change="addressFilterChanged()"
-                                        ng-model="addresses[address]"></checkbox>
+                                        ng-model="addresses[address]" ng-mouseenter="enterLegend(address)" ng-mouseleave="leaveLegend()"></checkbox>
                                         <span class="legend-text" ng-mouseenter="enterLegend(address)" ng-mouseleave="leaveLegend()" ng-click="addressClick(address)" title="{{address}}">{{address | limitTo : 15}}{{address.length>15 ? '…' : ''}}</span>
                                     </li>
                             </ul>


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


[2/4] qpid-dispatch git commit: DISPATCH-1180 Prevent error if link's connection is requested before connections are available

Posted by ea...@apache.org.
DISPATCH-1180 Prevent error if link's connection is requested before connections are available


Project: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/commit/65b70d80
Tree: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/tree/65b70d80
Diff: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/diff/65b70d80

Branch: refs/heads/master
Commit: 65b70d809a5260d59f298c51fdbda409745607d0
Parents: 6d55f1d
Author: Ernest Allen <ea...@redhat.com>
Authored: Sun Nov 11 15:50:51 2018 -0500
Committer: Ernest Allen <ea...@redhat.com>
Committed: Sun Nov 11 15:50:51 2018 -0500

----------------------------------------------------------------------
 console/stand-alone/plugin/js/amqp/topology.js | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/65b70d80/console/stand-alone/plugin/js/amqp/topology.js
----------------------------------------------------------------------
diff --git a/console/stand-alone/plugin/js/amqp/topology.js b/console/stand-alone/plugin/js/amqp/topology.js
index d1dfa1a..3fd1764 100644
--- a/console/stand-alone/plugin/js/amqp/topology.js
+++ b/console/stand-alone/plugin/js/amqp/topology.js
@@ -292,6 +292,8 @@ class Topology {
   getConnForLink(link) {
     // find the connection for this link
     var conns = this._nodeInfo[link.nodeId].connection;
+    if (!conns)
+      return {};
     var connIndex = conns.attributeNames.indexOf('identity');
     var linkCons = conns.results.filter(function (conn) {
       return conn[connIndex] === link.connectionId;


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


[4/4] qpid-dispatch git commit: DISPATCH-1180 Handle traffic coming from or going to an edge router or client that is part of a group

Posted by ea...@apache.org.
DISPATCH-1180 Handle traffic coming from or going to an edge router or client that is part of a group


Project: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/commit/86b4c08a
Tree: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/tree/86b4c08a
Diff: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/diff/86b4c08a

Branch: refs/heads/master
Commit: 86b4c08a414bd1cb56e7c5e670f78edbf126ac86
Parents: b560bd8
Author: Ernest Allen <ea...@redhat.com>
Authored: Sun Nov 11 15:55:36 2018 -0500
Committer: Ernest Allen <ea...@redhat.com>
Committed: Sun Nov 11 15:55:36 2018 -0500

----------------------------------------------------------------------
 .../stand-alone/plugin/js/topology/traffic.js   | 100 ++++++++++++-------
 1 file changed, 66 insertions(+), 34 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/86b4c08a/console/stand-alone/plugin/js/topology/traffic.js
----------------------------------------------------------------------
diff --git a/console/stand-alone/plugin/js/topology/traffic.js b/console/stand-alone/plugin/js/topology/traffic.js
index f109f61..a7f5c62 100644
--- a/console/stand-alone/plugin/js/topology/traffic.js
+++ b/console/stand-alone/plugin/js/topology/traffic.js
@@ -82,6 +82,17 @@ class TrafficAnimation {
       if (node.container === name)
         return i;
     }
+    // not found. loop through normals
+    for (let i = 0; i < nodes.length; i++) {
+      let node = nodes[i];
+      if (node.normals) {
+        let normalIndex = node.normals.findIndex( function (normal) {
+          return normal.container === name;
+        });
+        if (normalIndex >= 0)
+          return i;
+      }
+    }
     return -1;
   }
 }
@@ -114,21 +125,26 @@ class Congestion extends TrafficAnimation{
     this.traffic.QDRService.management.topology.ensureAllEntities([{ entity: 'router.link', force: true }, { entity: 'connection' }], function () {
       let links = {};
       let nodeInfo = self.traffic.QDRService.management.topology.nodeInfo();
+      const nodes = self.traffic.topology.nodes.nodes;
+      const srv = self.traffic.QDRService;
       // accumulate all the inter-router links in an object
       // keyed by the svgs path id
       for (let nodeId in nodeInfo) {
         let node = nodeInfo[nodeId];
         let nodeLinks = node['router.link'];
+        if (!nodeLinks)
+          continue;
         for (let n = 0; n < nodeLinks.results.length; n++) {
-          let link = self.traffic.QDRService.utilities.flatten(nodeLinks.attributeNames, nodeLinks.results[n]);
+          let link = srv.utilities.flatten(nodeLinks.attributeNames, nodeLinks.results[n]);
           if (link.linkType !== 'router-control') {
-            let f = self.nodeIndexFor(self.traffic.topology.nodes.nodes, self.traffic.QDRService.utilities.nameFromId(nodeId));
+            let f = self.nodeIndexFor(nodes, srv.utilities.nameFromId(nodeId));
             let connection = self.findResult(node, 'connection', 'identity', link.connectionId);
             if (connection) {
-              let t = self.nodeIndexFor(self.traffic.topology.nodes.nodes, connection.container);
+              let t = self.nodeIndexFor(nodes, connection.container);
               let little = Math.min(f, t);
               let big = Math.max(f, t);
-              let key = ['#path', little, big].join('-');
+              let key = ['#path', nodes[little].uid(srv), 
+                nodes[big].uid(srv)].join('-');
               if (!links[key])
                 links[key] = [];
               links[key].push(link);
@@ -150,10 +166,12 @@ class Congestion extends TrafficAnimation{
             .attr('stroke', congestion)
             .classed('traffic', true)
             .attr('marker-start', function (d) {
-              return d.left ? 'url(' + self.traffic.prefix + '#' + id + ')' : '';
+              return null;
+              //return d.left ? 'url(' + self.traffic.prefix + '#' + id + ')' : null;
             })
             .attr('marker-end', function (d) {
-              return d.right ? 'url(' + self.traffic.prefix + '#' + id + ')' : '';
+              return null;
+              //return d.right ? 'url(' + self.traffic.prefix + '#' + id + ')' : null;
             });
         }
       }
@@ -168,8 +186,9 @@ class Congestion extends TrafficAnimation{
         .attr('refX', function (d) {
           return colors[d].dir === 'end' ? 24 : (colors[d].small) ? -24 : -14;
         })
-        .attr('markerWidth', 4)
-        .attr('markerHeight', 4)
+        .attr('markerWidth', 14)
+        .attr('markerHeight', 14)
+        .attr('markerUnits', 'userSpaceOnUse')
         .attr('orient', 'auto')
         .style('fill', function (d) { return colors[d].color; })
         .append('svg:path')
@@ -374,10 +393,10 @@ class Dots extends TrafficAnimation {
       });
   }
   // create dots along the path between routers
-  startAnimation(path, id, hop, rate) {
-    if (!path.node())
+  startAnimation(selection, id, hop, rate) {
+    if (selection.empty())
       return;
-    this.animateDots(path, id, hop, rate);
+    this.animateDots(selection, id, hop, rate);
   }
   animateDots(path, id, hop, rate) {
     let back = hop.back, address = hop.address;
@@ -415,30 +434,43 @@ class Dots extends TrafficAnimation {
     }
     return this.traffic.$scope.addressColors[n];
   }
+  // find the link that carries traffic for this address 
+  // going to nodes[f] if sender is true
+  // coming from nodes[f] if sender if false.
+  // Add the link's id to the hops array
   addClients(hops, nodes, f, val, sender, address) {
-    let cdir = sender ? 'out' : 'in';
-    for (let n = 0; n < nodes.length; n++) {
-      let node = nodes[n];
-      if (node.normals && node.key === nodes[f].key && (node.cdir === cdir || node.cdir === 'both')) {
-        let links = this.traffic.QDRService.management.topology._nodeInfo[node.key]['router.link'];
-        // find the 1st link with type 'endpoint' and owningAddr == address
-        if (!links)
-          continue;
-        for (let l=0; l<links.results.length; l++) {
-          let link = this.traffic.QDRService.utilities.flatten(links.attributeNames, links.results[l]);
-          if ((link.linkType === 'endpoint' ||
-               link.linkType === 'edge-downlink') &&
-               address === this.traffic.QDRService.utilities.addr_text(link.owningAddr)) {
-            for (let n1=n; n1<nodes.length; n1++) {
-              if (link.connectionId === nodes[n1].connectionId) {
-                let key = ['', f, n1].join('-');
-                if (!hops[key])
-                  hops[key] = [];
-                hops[key].push({ val: val, back: !sender, address: address });
-                return;
-              }
-            }
-          }
+    const cdir = sender ? 'out' : 'in';
+    const uuid = nodes[f].uid(this.traffic.QDRService);
+    const key = nodes[f].key;
+    const links = this.traffic.QDRService.management.topology._nodeInfo[key]['router.link'];
+    if (links) {
+      const ilt = links.attributeNames.indexOf('linkType');
+      const ioa = links.attributeNames.indexOf('owningAddr');
+      const ici = links.attributeNames.indexOf('connectionId');
+      const ild = links.attributeNames.indexOf('linkDir');
+      let linkIndex = links.results.findIndex( function (l) {
+        return (l[ilt] === 'endpoint' || l[ilt] === 'edge-downlink') && 
+          address === this.traffic.QDRService.utilities.addr_text(l[ioa]) &&
+          l[ild] === cdir;
+      }, this);
+      if (linkIndex >= 0) {
+        let nodeIndex = nodes.findIndex( function (node) {
+          if (node.normals && node.key === key && (node.cdir === cdir || node.cdir === 'both')) {
+            let ni = node.normals.findIndex( function (normal) {
+              return normal.connectionId === links.results[linkIndex][ici];
+            });
+            return ni >= 0;
+          } else
+            return false;
+        });
+        if (nodeIndex >= 0) {
+          // one of the normals for this node has the traffic
+          const uuid2 = nodes[nodeIndex].uid(this.traffic.QDRService);
+          const key = ['', uuid, uuid2].join('-');
+          if (!hops[key])
+            hops[key] = [];
+          hops[key].push({ val: val, back: !sender, address: address });
+          return;
         }
       }
     }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


[3/4] qpid-dispatch git commit: DISPATCH-1180 Change the way node and link uid are generated and used

Posted by ea...@apache.org.
DISPATCH-1180 Change the way node and link uid are generated and used


Project: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/commit/b560bd88
Tree: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/tree/b560bd88
Diff: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/diff/b560bd88

Branch: refs/heads/master
Commit: b560bd887eff1b79022a438f94d438e666042e4c
Parents: 65b70d8
Author: Ernest Allen <ea...@redhat.com>
Authored: Sun Nov 11 15:54:33 2018 -0500
Committer: Ernest Allen <ea...@redhat.com>
Committed: Sun Nov 11 15:54:33 2018 -0500

----------------------------------------------------------------------
 console/stand-alone/plugin/js/topology/links.js | 23 +++++++++++-------
 console/stand-alone/plugin/js/topology/nodes.js | 12 ++++++----
 .../plugin/js/topology/qdrTopology.js           | 25 +++++++++++---------
 3 files changed, 36 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/b560bd88/console/stand-alone/plugin/js/topology/links.js
----------------------------------------------------------------------
diff --git a/console/stand-alone/plugin/js/topology/links.js b/console/stand-alone/plugin/js/topology/links.js
index 04806ea..0ca9967 100644
--- a/console/stand-alone/plugin/js/topology/links.js
+++ b/console/stand-alone/plugin/js/topology/links.js
@@ -80,9 +80,11 @@ export class Links {
 
   initializeLinks (nodeInfo, nodes, unknowns, localStorage, height) {
     let animate = false;
-    let source = 0;
     let client = 1.0;
-    for (let id in nodeInfo) {
+    let nodeIds = Object.keys(nodeInfo);
+    for (let source=0; source<nodeIds.length; source++) {
+      let id = nodeIds[source];
+      const suid = nodes.get(source).uid(this.QDRService);
       let parts = id.split('/');
       let routerType = parts[1]; // _topo || _edge
       let onode = nodeInfo[id];
@@ -103,7 +105,8 @@ export class Links {
           let connId = connection.container;
           let target = getContainerIndex(connId, nodeInfo, this.QDRService);
           if (target >= 0) {
-            this.getLink(source, target, dir, '', source + '-' + target);
+            const tuid = nodes.get(target).uid(this.QDRService);
+            this.getLink(source, target, dir, '', suid + '-' + tuid);
           }
         }
         // handle external connections
@@ -134,7 +137,8 @@ export class Links {
         let cdir = getLinkDir(id, connection, onode, this.QDRService);
         if (existingNodeIndex >= 0) {
           // make a link between the current router (source) and the existing node
-          this.getLink(source, existingNodeIndex, dir, 'small', connection.name);
+          const tuid = nodes.get(existingNodeIndex).uid(this.QDRService);
+          this.getLink(source, existingNodeIndex, dir, 'small', suid + '-' + tuid);
         } else if (normalInfo.nodesIndex) {
           // get node index of node that contained this connection in its normals array
           let normalSource = this.getLinkSource(normalInfo.nodesIndex);
@@ -143,10 +147,12 @@ export class Links {
               cdir = dir;
             node.cdir = cdir;
             nodes.add(node);
+            const suidn = nodes.get(this.links[normalSource].source).uid(this.QDRService);
+            const tuid = node.uid(this.QDRService);
             // create link from original node to the new node
-            this.getLink(this.links[normalSource].source, nodes.getLength()-1, cdir, 'small', connection.name);
+            this.getLink(this.links[normalSource].source, nodes.getLength()-1, cdir, 'small', suidn + '-' + tuid);
             // create link from this router to the new node
-            this.getLink(source, nodes.getLength()-1, cdir, 'small', connection.name);
+            this.getLink(source, nodes.getLength()-1, cdir, 'small', suid + '-' + tuid);
             // remove the old node from the normals list
             nodes.get(normalInfo.nodesIndex).normals.splice(normalInfo.normalsIndex, 1);
           }
@@ -164,7 +170,7 @@ export class Links {
               nodes.add(node);
               node.normals = [node];
               // now add a link
-              this.getLink(source, nodes.getLength() - 1, cdir, 'small', connection.name);
+              this.getLink(source, nodes.getLength() - 1, cdir, 'small', suid + '-' + node.uid(this.QDRService));
               client++;
             } else {
               normalsParent[nodeType+cdir].normals.push(node);
@@ -176,11 +182,10 @@ export class Links {
         } else {
           nodes.add(node);
           // now add a link
-          this.getLink(source, nodes.getLength() - 1, dir, 'small', connection.name);
+          this.getLink(source, nodes.getLength() - 1, dir, 'small', suid + '-' + node.uid(this.QDRService));
           client++;
         }
       }
-      source++;
     }
     return animate;
   }

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/b560bd88/console/stand-alone/plugin/js/topology/nodes.js
----------------------------------------------------------------------
diff --git a/console/stand-alone/plugin/js/topology/nodes.js b/console/stand-alone/plugin/js/topology/nodes.js
index 2715541..2b51898 100644
--- a/console/stand-alone/plugin/js/topology/nodes.js
+++ b/console/stand-alone/plugin/js/topology/nodes.js
@@ -20,11 +20,11 @@ under the License.
 /* global d3 Promise */
 export class Node {
   constructor(QDRService, id, name, nodeType, properties, routerId, x, y, nodeIndex, resultIndex, fixed, connectionContainer) {
-    this.key = id;
-    this.name = name;
-    this.nodeType = nodeType;
+    this.key = id;                  // the router uri for this node (or group of clients) like: amqp:/_topo/0/<router id>/$management
+    this.name = name;               // the router id portion of the key
+    this.nodeType = nodeType;       // router.role
     this.properties = properties;
-    this.routerId = routerId;
+    this.routerId = routerId;       // the router uri of the router we are connected to (for groups)
     this.x = x;
     this.y = y;
     this.id = nodeIndex;
@@ -133,6 +133,10 @@ export class Node {
   radius() {
     return nodeProperties[this.nodeType].radius;
   }
+  uid(srv) {
+    return srv.utilities.nameFromId(this.key).replace(/ /g,'').replace(/\./g,'') + 
+    (this.connectionId ? this.connectionId : '');
+  }
 }
 const nodeProperties = {
   // router types

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/b560bd88/console/stand-alone/plugin/js/topology/qdrTopology.js
----------------------------------------------------------------------
diff --git a/console/stand-alone/plugin/js/topology/qdrTopology.js b/console/stand-alone/plugin/js/topology/qdrTopology.js
index 7e299ab..5425bad 100644
--- a/console/stand-alone/plugin/js/topology/qdrTopology.js
+++ b/console/stand-alone/plugin/js/topology/qdrTopology.js
@@ -530,7 +530,9 @@ export class TopologyController {
           return d.left ? `url(${urlPrefix}#start${d.markerId('start')})` : null;
         })
         .attr('id', function (d) {
-          return ['path', d.source.index, d.target.index].join('-');
+          const si = d.source.uid(QDRService);
+          const ti = d.target.uid(QDRService);
+          return ['path', si, ti].join('-');
         });
 
       enterpath.append('path')
@@ -541,15 +543,9 @@ export class TopologyController {
 
 
       // circle (node) group
-      // nodes are known by id
+      // nodes are known by router id, or for groups, by the router id + 1st connectionId
       circle = circle.data(nodes.nodes, function(d) {
-        if (!d.normals)
-          return d.name;
-        let connIds = [d.routerId];
-        d.normals.forEach( function (n) {
-          connIds.push(n.connectionId);
-        });
-        return connIds.join('.');
+        return d.uid(QDRService);
       });
 
       // update existing nodes visual states
@@ -563,6 +559,10 @@ export class TopologyController {
         .classed('fixed', function(d) {
           return d.fixed & 1;
         });
+      circle
+        .classed('multiple', function (d) {
+          return (d.normals && d.normals.length > 1);
+        });
 
       // add new circle nodes
       let g = circle.enter().append('svg:g')
@@ -1036,7 +1036,9 @@ export class TopologyController {
       initForceGraph();
       // after the graph is displayed fetch all .router.node info. This is done so highlighting between nodes
       // doesn't incur a delay
-      QDRService.management.topology.addUpdateEntities({entity: 'router.node', attrs: ['id','nextHop']});
+      QDRService.management.topology.addUpdateEntities([
+        {entity: 'router.node', attrs: ['id','nextHop']},
+        {entity: 'router.link', attrs: ['linkType', 'connectionId', 'owningAddr', 'linkDir']}]);
       // call this function every time a background update is done
       QDRService.management.topology.addUpdatedAction('topology', function() {
         let changed = hasChanged();
@@ -1075,7 +1077,8 @@ export class TopologyController {
     function setupInitialUpdate() {
       // make sure all router nodes have .connection info. if not then fetch any missing info
       QDRService.management.topology.ensureAllEntities(
-        [{entity: 'connection'}],
+        [{entity: 'connection'},
+          {entity: 'router.link', attrs: ['linkType', 'connectionId', 'owningAddr', 'linkDir']}],
         handleInitialUpdate);
     }
     if (!QDRService.management.connection.is_connected()) {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org