diff options
author | Brooks Rady <b.j.rady@gmail.com> | 2020-04-05 17:30:43 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-05 18:30:43 +0200 |
commit | 62a39464d7893cbb747f321c3bb662a0d939de14 (patch) | |
tree | aeae4458ff213d4199805c10b880fe70994d50f4 /src/tests/cases | |
parent | 1569f6038df215a85532fe2e77a8ed47ca797c0b (diff) |
feat(network): add accumlated usage (#155)
* Add accumlated usage
* Fixed a nasty performace leak
* Fix a silly reverse-ordering bug
* Address some feedback
* Finished some reorganizing
* Another silly reversal bug
* Let the test cases run
* Most tests are working
* Fix some formatting that got left behind
* Fix the rest of the tests
* Add some new tests to cover the total mode
* Whoops, a double newline
Diffstat (limited to 'src/tests/cases')
60 files changed, 619 insertions, 100 deletions
diff --git a/src/tests/cases/raw_mode.rs b/src/tests/cases/raw_mode.rs index 8c51dfa..636abb1 100644 --- a/src/tests/cases/raw_mode.rs +++ b/src/tests/cases/raw_mode.rs @@ -207,7 +207,7 @@ fn multiple_processes_with_multiple_connections() { "10.0.0.2", 1337, 4435, - b"Awesome, I'm from 3.3.3.3", + b"Greetings traveller, I'm from 3.3.3.3", )), Some(build_tcp_packet( "2.2.2.2", @@ -581,6 +581,7 @@ fn no_resolve_mode() { addresses: false, connections: false, processes: false, + total_utilization: false, }, }; start(backend, os_input, opts); diff --git a/src/tests/cases/snapshots/raw_mode__multiple_connections_from_remote_address.snap b/src/tests/cases/snapshots/raw_mode__multiple_connections_from_remote_address.snap index 22cb71f..ee79f90 100644 --- a/src/tests/cases/snapshots/raw_mode__multiple_connections_from_remote_address.snap +++ b/src/tests/cases/snapshots/raw_mode__multiple_connections_from_remote_address.snap @@ -3,7 +3,7 @@ source: src/tests/cases/raw_mode.rs expression: formatted --- process: <TIMESTAMP_REMOVED> "1" up/down Bps: 0/47 connections: 2 -connection: <TIMESTAMP_REMOVED> <interface_name>:443 => 1.1.1.1:12345 (tcp) up/down Bps: 0/22 process: "1" connection: <TIMESTAMP_REMOVED> <interface_name>:443 => 1.1.1.1:12346 (tcp) up/down Bps: 0/25 process: "1" +connection: <TIMESTAMP_REMOVED> <interface_name>:443 => 1.1.1.1:12345 (tcp) up/down Bps: 0/22 process: "1" remote_address: <TIMESTAMP_REMOVED> 1.1.1.1 up/down Bps: 0/47 connections: 2 diff --git a/src/tests/cases/snapshots/raw_mode__multiple_processes_with_multiple_connections.snap b/src/tests/cases/snapshots/raw_mode__multiple_processes_with_multiple_connections.snap index 609bbf5..6709ffd 100644 --- a/src/tests/cases/snapshots/raw_mode__multiple_processes_with_multiple_connections.snap +++ b/src/tests/cases/snapshots/raw_mode__multiple_processes_with_multiple_connections.snap @@ -2,16 +2,16 @@ source: src/tests/cases/raw_mode.rs expression: formatted --- +process: <TIMESTAMP_REMOVED> "5" up/down Bps: 0/28 connections: 1 +process: <TIMESTAMP_REMOVED> "4" up/down Bps: 0/26 connections: 1 process: <TIMESTAMP_REMOVED> "1" up/down Bps: 0/22 connections: 1 process: <TIMESTAMP_REMOVED> "2" up/down Bps: 0/21 connections: 1 -process: <TIMESTAMP_REMOVED> "4" up/down Bps: 0/26 connections: 1 -process: <TIMESTAMP_REMOVED> "5" up/down Bps: 0/22 connections: 1 -connection: <TIMESTAMP_REMOVED> <interface_name>:443 => 1.1.1.1:12345 (tcp) up/down Bps: 0/22 process: "1" +connection: <TIMESTAMP_REMOVED> <interface_name>:4435 => 3.3.3.3:1337 (tcp) up/down Bps: 0/28 process: "5" connection: <TIMESTAMP_REMOVED> <interface_name>:4434 => 2.2.2.2:54321 (tcp) up/down Bps: 0/26 process: "4" -connection: <TIMESTAMP_REMOVED> <interface_name>:4435 => 3.3.3.3:1337 (tcp) up/down Bps: 0/22 process: "5" +connection: <TIMESTAMP_REMOVED> <interface_name>:443 => 1.1.1.1:12345 (tcp) up/down Bps: 0/22 process: "1" connection: <TIMESTAMP_REMOVED> <interface_name>:4432 => 4.4.4.4:1337 (tcp) up/down Bps: 0/21 process: "2" -remote_address: <TIMESTAMP_REMOVED> 1.1.1.1 up/down Bps: 0/22 connections: 1 +remote_address: <TIMESTAMP_REMOVED> 3.3.3.3 up/down Bps: 0/28 connections: 1 remote_address: <TIMESTAMP_REMOVED> 2.2.2.2 up/down Bps: 0/26 connections: 1 -remote_address: <TIMESTAMP_REMOVED> 3.3.3.3 up/down Bps: 0/22 connections: 1 +remote_address: <TIMESTAMP_REMOVED> 1.1.1.1 up/down Bps: 0/22 connections: 1 remote_address: <TIMESTAMP_REMOVED> 4.4.4.4 up/down Bps: 0/21 connections: 1 diff --git a/src/tests/cases/snapshots/raw_mode__one_process_with_multiple_connections.snap b/src/tests/cases/snapshots/raw_mode__one_process_with_multiple_connections.snap index cf08105..cb3efff 100644 --- a/src/tests/cases/snapshots/raw_mode__one_process_with_multiple_connections.snap +++ b/src/tests/cases/snapshots/raw_mode__one_process_with_multiple_connections.snap @@ -3,7 +3,7 @@ source: src/tests/cases/raw_mode.rs expression: formatted --- process: <TIMESTAMP_REMOVED> "1" up/down Bps: 0/46 connections: 2 -connection: <TIMESTAMP_REMOVED> <interface_name>:443 => 1.1.1.1:12345 (tcp) up/down Bps: 0/22 process: "1" connection: <TIMESTAMP_REMOVED> <interface_name>:443 => 1.1.1.1:12346 (tcp) up/down Bps: 0/24 process: "1" +connection: <TIMESTAMP_REMOVED> <interface_name>:443 => 1.1.1.1:12345 (tcp) up/down Bps: 0/22 process: "1" remote_address: <TIMESTAMP_REMOVED> 1.1.1.1 up/down Bps: 0/46 connections: 2 diff --git a/src/tests/cases/snapshots/ui__basic_only_addresses.snap b/src/tests/cases/snapshots/ui__basic_only_addresses.snap index 3f875dd..98e855e 100644 --- a/src/tests/cases/snapshots/ui__basic_only_addresses.snap +++ b/src/tests/cases/snapshots/ui__basic_only_addresses.snap @@ -2,9 +2,9 @@ source: src/tests/cases/ui.rs expression: "&terminal_draw_events_mirror[0]" --- - Total Rate Up / Down: 0Bps / 0Bps + Total Up / Down: 0Bps / 0Bps ┌Utilization by remote address───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ -│Remote Address Connections Rate Up / Down │ +│Remote Address Connections Up / Down │ │ │ │ │ │ │ diff --git a/src/tests/cases/snapshots/ui__basic_only_connections.snap b/src/tests/cases/snapshots/ui__basic_only_connections.snap index 1fa5bb7..fa318b0 100644 --- a/src/tests/cases/snapshots/ui__basic_only_connections.snap +++ b/src/tests/cases/snapshots/ui__basic_only_connections.snap @@ -2,9 +2,9 @@ source: src/tests/cases/ui.rs expression: "&terminal_draw_events_mirror[0]" --- - Total Rate Up / Down: 0Bps / 0Bps + Total Up / Down: 0Bps / 0Bps ┌Utilization by connection───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ -│Connection Process Rate Up / Down │ +│Connection Process Up / Down │ │ │ │ │ │ │ diff --git a/src/tests/cases/snapshots/ui__basic_only_processes.snap b/src/tests/cases/snapshots/ui__basic_only_processes.snap index 0e1d4c2..d72fe63 100644 --- a/src/tests/cases/snapshots/ui__basic_only_processes.snap +++ b/src/tests/cases/snapshots/ui__basic_only_processes.snap @@ -2,9 +2,9 @@ source: src/tests/cases/ui.rs expression: "&terminal_draw_events_mirror[0]" --- - Total Rate Up / Down: 0Bps / 0Bps + Total Up / Down: 0Bps / 0Bps ┌Utilization by process name─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ -│Process Connections Rate Up / Down │ +│Process Connections Up / Down │ │ │ │ │ │ │ diff --git a/src/tests/cases/snapshots/ui__basic_startup.snap b/src/tests/cases/snapshots/ui__basic_startup.snap index 0609187..7f3863a 100644 --- a/src/tests/cases/snapshots/ui__basic_startup.snap +++ b/src/tests/cases/snapshots/ui__basic_startup.snap @@ -2,9 +2,9 @@ source: src/tests/cases/ui.rs expression: "&terminal_draw_events_mirror[0]" --- - Total Rate Up / Down: 0Bps / 0Bps + Total Up / Down: 0Bps / 0Bps ┌Utilization by process name──────────────────────────────────────────────────────────────────┐┌Utilization by remote address────────────────────────────────────────────────────────────────┐ -│Process Connections Rate Up / Down ││Remote Address Connections Rate Up / Down │ +│Process Connections Up / Down ││Remote Address Connections Up / Down │ │ ││ │ │ ││ │ │ ││ │ @@ -28,7 +28,7 @@ expression: "&terminal_draw_events_mirror[0]" │ ││ │ └─────────────────────────────────────────────────────────────────────────────────────────────┘└─────────────────────────────────────────────────────────────────────────────────────────────┘ ┌Utilization by connection───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ -│Connection Process Rate Up / Down │ +│Connection Process Up / Down │ │ │ │ │ │ │ diff --git a/src/tests/cases/snapshots/ui__bi_directional_traffic-2.snap b/src/tests/cases/snapshots/ui__bi_directional_traffic-2.snap index cb9693b..dde1eb7 100644 --- a/src/tests/cases/snapshots/ui__bi_directional_traffic-2.snap +++ b/src/tests/cases/snapshots/ui__bi_directional_traffic-2.snap @@ -2,7 +2,7 @@ source: src/tests/cases/ui.rs expression: "&terminal_draw_events_mirror[1]" --- - 24Bps / 25Bps + 24Bps / 25Bps diff --git a/src/tests/cases/snapshots/ui__bi_directional_traffic.snap b/src/tests/cases/snapshots/ui__bi_directional_traffic.snap index 0609187..7f3863a 100644 --- a/src/tests/cases/snapshots/ui__bi_directional_traffic.snap +++ b/src/tests/cases/snapshots/ui__bi_directional_traffic.snap @@ -2,9 +2,9 @@ source: src/tests/cases/ui.rs expression: "&terminal_draw_events_mirror[0]" --- - Total Rate Up / Down: 0Bps / 0Bps + Total Up / Down: 0Bps / 0Bps ┌Utilization by process name──────────────────────────────────────────────────────────────────┐┌Utilization by remote address────────────────────────────────────────────────────────────────┐ -│Process Connections Rate Up / Down ││Remote Address Connections Rate Up / Down │ +│Process Connections Up / Down ││Remote Address Connections Up / Down │ │ ││ │ │ ││ │ │ ││ │ @@ -28,7 +28,7 @@ expression: "&terminal_draw_events_mirror[0]" │ ││ │ └─────────────────────────────────────────────────────────────────────────────────────────────┘└─────────────────────────────────────────────────────────────────────────────────────────────┘ ┌Utilization by connection─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── |