Permalink
Browse files

Add code to make sure that all nodes show up in the graph.

Also, group machines by name (and leave off port/protocol)
  • Loading branch information...
1 parent 54be8ca commit 15fc63b1e8726dbbe1c787ec00f82d7b6eec6811 @okayzed okayzed committed Aug 7, 2011
Showing with 15 additions and 7 deletions.
  1. +0 −1 packet_flight/js/packet-flight.js
  2. +15 −6 process-dump.py
@@ -126,7 +126,6 @@ function NetworkNode(name, x, y) {
this.name = name;
this.x = x;
this.y = y;
- nodes.push(this);
var sendPacket = function(node, delay, bytes, type, t) {
var packet = new Packet(this, node, delay, bytes, type, t),
View
@@ -132,12 +132,21 @@ def get_seq(s):
if dest == dump_source:
start -= (1 * scale)
- if not machines.has_key(src):
- try:
- machines[src] = {'xy':spots[spos], 'packets':[]}
- spos += 1
- except:
- machines[src] = {'xy':(random.randint(10, 600), random.randint(30, 440)), 'packets':[]}
+ def add_machine(mch):
+ split_mch = mch.split('.')
+ mch = ".".join(split_mch[:-1])
+ port = split_mch[-1]
+ if not machines.has_key(mch):
+ try:
+ machines[mch] = {'xy':spots[spos], 'packets':[]}
+ spos += 1
+ except:
+ machines[mch] = {'xy':(random.randint(10, 600), random.randint(30, 440)), 'packets':[]}
+
+ return mch
+
+ src = add_machine(src)
+ dest = add_machine(dest)
machines[src]['packets'].append((dest, (start / scale), int(size), cls))
maxtime = (time / scale) + 1

0 comments on commit 15fc63b

Please sign in to comment.