Committed by
Gerrit Code Review
Fixing port stats topo view rendering.
Change-Id: I6209268fc6dbdbf8914739305c35c5352a57a842
Showing
2 changed files
with
18 additions
and
2 deletions
| ... | @@ -78,4 +78,19 @@ public class DefaultEdgeLink extends DefaultLink implements EdgeLink { | ... | @@ -78,4 +78,19 @@ public class DefaultEdgeLink extends DefaultLink implements EdgeLink { |
| 78 | location, isIngress); | 78 | location, isIngress); |
| 79 | } | 79 | } |
| 80 | 80 | ||
| 81 | + /** | ||
| 82 | + * Creates a an edge link, to the specified end-station. | ||
| 83 | + * | ||
| 84 | + * @param host host | ||
| 85 | + * @param isIngress true to indicate host-to-network direction; false | ||
| 86 | + * for network-to-host direction | ||
| 87 | + * @return new phantom edge link | ||
| 88 | + */ | ||
| 89 | + public static DefaultEdgeLink createEdgeLink(Host host, boolean isIngress) { | ||
| 90 | + checkNotNull(host, "Host cannot be null"); | ||
| 91 | + return new DefaultEdgeLink(ProviderId.NONE, | ||
| 92 | + new ConnectPoint(host.id(), PortNumber.P0), | ||
| 93 | + host.location(), isIngress); | ||
| 94 | + } | ||
| 95 | + | ||
| 81 | } | 96 | } | ... | ... |
| ... | @@ -601,7 +601,8 @@ public abstract class TopologyViewMessageHandlerBase extends UiMessageHandler { | ... | @@ -601,7 +601,8 @@ public abstract class TopologyViewMessageHandlerBase extends UiMessageHandler { |
| 601 | 601 | ||
| 602 | private void addEdgeLinks(Map<LinkKey, BiLink> biLinks) { | 602 | private void addEdgeLinks(Map<LinkKey, BiLink> biLinks) { |
| 603 | hostService.getHosts().forEach(host -> { | 603 | hostService.getHosts().forEach(host -> { |
| 604 | - addLink(biLinks, createEdgeLink(host.location(), false)); | 604 | + addLink(biLinks, createEdgeLink(host, true)); |
| 605 | + addLink(biLinks, createEdgeLink(host, false)); | ||
| 605 | }); | 606 | }); |
| 606 | } | 607 | } |
| 607 | 608 | ||
| ... | @@ -722,7 +723,7 @@ public abstract class TopologyViewMessageHandlerBase extends UiMessageHandler { | ... | @@ -722,7 +723,7 @@ public abstract class TopologyViewMessageHandlerBase extends UiMessageHandler { |
| 722 | for (Link link : links) { | 723 | for (Link link : links) { |
| 723 | BiLink biLink = addLink(biLinks, link); | 724 | BiLink biLink = addLink(biLinks, link); |
| 724 | if (showTraffic) { | 725 | if (showTraffic) { |
| 725 | - biLink.addLoad(flowStatsService.load(link)); | 726 | + biLink.addLoad(getLinkLoad(link)); |
| 726 | } | 727 | } |
| 727 | biLink.addClass(type); | 728 | biLink.addClass(type); |
| 728 | } | 729 | } | ... | ... |
-
Please register or login to post a comment