diff options
author | ClementTsang <cjhtsang@uwaterloo.ca> | 2020-05-10 17:01:45 -0400 |
---|---|---|
committer | ClementTsang <cjhtsang@uwaterloo.ca> | 2020-05-10 17:01:45 -0400 |
commit | 56d6771d1bbfb5929c11b55a2704738610c711ac (patch) | |
tree | ac69de03890c42d7b78d2d01ae36dbe9d0e66d65 | |
parent | 90272777f7451c7e16e7d71f44f7c00133626177 (diff) |
refactor: re-enable tui-rs linear interpolation
-rw-r--r-- | Cargo.lock | 132 | ||||
-rw-r--r-- | Cargo.toml | 2 | ||||
-rw-r--r-- | src/app/data_farmer.rs | 139 | ||||
-rw-r--r-- | src/canvas/widgets/cpu_graph.rs | 3 | ||||
-rw-r--r-- | src/canvas/widgets/mem_graph.rs | 4 | ||||
-rw-r--r-- | src/canvas/widgets/network_graph.rs | 8 | ||||
-rw-r--r-- | src/data_conversion.rs | 57 |
7 files changed, 110 insertions, 235 deletions
@@ -126,17 +126,17 @@ dependencies = [ "crossterm 0.17.4 (registry+https://github.com/rust-lang/crates.io-index)", "dirs 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "fern 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", "heim 0.0.10 (registry+https://github.com/rust-lang/crates.io-index)", "itertools 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "predicates 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", "regex 1.3.7 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.106 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.110 (registry+https://github.com/rust-lang/crates.io-index)", "sysinfo 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)", "toml 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)", - "tui 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", + "tui 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)", "typed-builder 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-segmentation 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-width 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", @@ -374,50 +374,50 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "futures" -version = "0.3.4" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "futures-channel 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-executor 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-io 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-sink 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-task 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-util 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-channel 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-core 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-executor 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-io 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-sink 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-task 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-util 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "futures-channel" -version = "0.3.4" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-sink 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-core 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-sink 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "futures-core" -version = "0.3.4" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "futures-executor" -version = "0.3.4" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-task 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-util 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-core 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-task 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-util 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "futures-io" -version = "0.3.4" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "futures-macro" -version = "0.3.4" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro-hack 0.5.15 (registry+https://github.com/rust-lang/crates.io-index)", @@ -428,26 +428,30 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.4" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "futures-task" -version = "0.3.4" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "once_cell 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", +] [[package]] name = "futures-util" -version = "0.3.4" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "futures-channel 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-io 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-macro 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-sink 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-task 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-channel 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-core 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-io 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-macro 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-sink 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-task 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", "memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "pin-project 0.4.15 (registry+https://github.com/rust-lang/crates.io-index)", "pin-utils 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "proc-macro-hack 0.5.15 (registry+https://github.com/rust-lang/crates.io-index)", "proc-macro-nested 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -488,8 +492,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", "core-foundation 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-util 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-core 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-util 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.69 (registry+https://github.com/rust-lang/crates.io-index)", "mach 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -589,7 +593,7 @@ dependencies = [ "libc 0.2.69 (registry+https://github.com/rust-lang/crates.io-index)", "mach 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "ntapi 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "ntapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "ordered-float 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -600,7 +604,7 @@ version = "0.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-channel 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-channel 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", "heim-common 0.0.10 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "threadpool 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -805,7 +809,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "ntapi" -version = "0.3.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -883,6 +887,24 @@ dependencies = [ ] [[package]] +name = "pin-project" +version = "0.4.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "pin-project-internal 0.4.15 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "pin-project-internal" +version = "0.4.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 1.0.12 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.19 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] name = "pin-utils" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1051,15 +1073,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "serde" -version = "1.0.106" +version = "1.0.110" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde_derive 1.0.106 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.110 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "serde_derive" -version = "1.0.106" +version = "1.0.110" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 1.0.12 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1119,7 +1141,7 @@ dependencies = [ "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", "doc-comment 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.69 (registry+https://github.com/rust-lang/crates.io-index)", - "ntapi 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "ntapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "once_cell 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "rayon 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1163,7 +1185,7 @@ name = "toml" version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde 1.0.106 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.110 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1173,7 +1195,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "tui" -version = "0.9.1" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1343,15 +1365,15 @@ dependencies = [ "checksum float-cmp 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "da62c4f1b81918835a8c6a484a397775fff5953fe83529afd51b05f5c6a6617d" "checksum fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" "checksum fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" -"checksum futures 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "5c329ae8753502fb44ae4fc2b622fa2a94652c41e795143765ba0927f92ab780" -"checksum futures-channel 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "f0c77d04ce8edd9cb903932b608268b3fffec4163dc053b3b402bf47eac1f1a8" -"checksum futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "f25592f769825e89b92358db00d26f965761e094951ac44d3663ef25b7ac464a" -"checksum futures-executor 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "f674f3e1bcb15b37284a90cedf55afdba482ab061c407a9c0ebbd0f3109741ba" -"checksum futures-io 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "a638959aa96152c7a4cddf50fcb1e3fede0583b27157c26e67d6f99904090dc6" -"checksum futures-macro 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "9a5081aa3de1f7542a794a397cde100ed903b0630152d0973479018fd85423a7" -"checksum futures-sink 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "3466821b4bc114d95b087b850a724c6f83115e929bc88f1fa98a3304a944c8a6" -"checksum futures-task 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "7b0a34e53cf6cdcd0178aa573aed466b646eb3db769570841fda0c7ede375a27" -"checksum futures-util 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "22766cf25d64306bedf0384da004d05c9974ab104fcc4528f1236181c18004c5" +"checksum futures 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "1e05b85ec287aac0dc34db7d4a569323df697f9c55b99b15d6b4ef8cde49f613" +"checksum futures-channel 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "f366ad74c28cca6ba456d95e6422883cfb4b252a83bed929c83abfdbbf2967d5" +"checksum futures-core 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "59f5fff90fd5d971f936ad674802482ba441b6f09ba5e15fd8b39145582ca399" +"checksum futures-executor 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "10d6bb888be1153d3abeb9006b11b02cf5e9b209fda28693c31ae1e4e012e314" +"checksum futures-io 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "de27142b013a8e869c14957e6d2edeef89e97c289e69d042ee3a49acd8b51789" +"checksum futures-macro 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "d0b5a30a4328ab5473878237c447333c093297bded83a4983d10f4deea240d39" +"checksum futures-sink 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "3f2032893cb734c7a05d85ce0cc8b8c4075278e93b24b66f9de99d6eb0fa8acc" +"checksum futures-task 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "bdb66b5f09e22019b1ab0830f7785bcea8e7a42148683f99214f73f8ec21a626" +"checksum futures-util 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "8764574ff08b701a084482c3c7031349104b07ac897393010494beaa18ce32c6" "checksum getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "7abc8dd8451921606d809ba32e95b6111925cd2906060d2dcc29c070220503eb" "checksum heim 0.0.10 (registry+https://github.com/rust-lang/crates.io-index)" = "51b8e403c0598237327b4143bdc1c7e01db0b358b5420579637e27cc117d573c" "checksum heim-common 0.0.10 (registry+https://github.com/rust-lang/crates.io-index)" = "144af2a423102dd4dd3e9fdd2c77c4756fb3c6c009d691628997fd5a2247719a" @@ -1386,7 +1408,7 @@ dependencies = [ "checksum nix 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3b2e0b4f3320ed72aaedb9a5ac838690a8047c7b275da22711fddff4f8a14229" "checksum nix 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)" = "50e4785f2c3b7589a0d0c1dd60285e1188adac4006e8abd6dd578e1567027363" "checksum normalize-line-endings 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "61807f77802ff30975e01f4f071c8ba10c022052f98b3294119f3e615d13e5be" -"checksum ntapi 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "f26e041cd983acbc087e30fcba770380cfa352d0e392e175b2344ebaf7ea0602" +"checksum ntapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "7a31937dea023539c72ddae0e3571deadc1414b300483fa7aaec176168cfa9d2" "checksum num-integer 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "3f6ea62e9d81a77cd3ee9a2a5b9b609447857f3d358704331e4ef39eb247fcba" "checksum num-rational 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "5c000134b5dbf44adc5cb772486d335293351644b801551abe8f75c84cfa4aef" "checksum num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "c62be47e61d1842b9170f0fdeec8eba98e60e90e5446449a0545e5152acd7096" @@ -1395,6 +1417,8 @@ dependencies = [ "checksum ordered-float 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "18869315e81473c951eb56ad5558bbc56978562d3ecfb87abb7a1e944cea4518" "checksum parking_lot 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d3a704eb390aafdc107b0e392f56a82b668e3a71366993b5340f5833fd62505e" "checksum parking_lot_core 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d58c7c768d4ba344e3e8d72518ac13e259d7c7ade24167003b8488e10b6740a3" +"checksum pin-project 0.4.15 (registry+https://github.com/rust-lang/crates.io-index)" = "3c50dab4a05419117fe00216df4731e387ae616cd2a5f5dda1d8b02d863ac63d" +"checksum pin-project-internal 0.4.15 (registry+https://github.com/rust-lang/crates.io-index)" = "6c27e5ac1d4c76777afd4d47b8fe9c602b44bcf6f999d34e300bba5560c9837b" "checksum pin-utils 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" "checksum platforms 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "feb3b2b1033b8a60b4da6ee470325f887758c95d5320f52f9ce0df055a55940e" "checksum predicates 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "347a1b6f0b21e636bc9872fb60b83b8e185f6f5516298b8238699f7f9a531030" @@ -1417,8 +1441,8 @@ dependencies = [ "checksum scopeguard 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" "checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" "checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" -"checksum serde 1.0.106 (registry+https://github.com/rust-lang/crates.io-index)" = "36df6ac6412072f67cf767ebbde4133a5b2e88e76dc6187fa7104cd16f783399" -"checksum serde_derive 1.0.106 (registry+https://github.com/rust-lang/crates.io-index)" = "9e549e3abf4fb8621bd1609f11dfc9f5e50320802273b12f3811a67e6716ea6c" +"checksum serde 1.0.110 (registry+https://github.com/rust-lang/crates.io-index)" = "99e7b308464d16b56eba9964e4972a3eee817760ab60d88c3f86e1fecb08204c" +"checksum serde_derive 1.0.110 (registry+https://github.com/rust-lang/crates.io-index)" = "818fbf6bfa9a42d3bfcaca148547aa00c7b915bec71d1757aa2d44ca68771984" "checksum signal-hook 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "7c0893246f276ba1aac4983fb8711dad108e2886fd76bf618a382ab4e30e5bec" "checksum signal-hook-registry 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "94f478ede9f64724c5d173d7bb56099ec3e2d9fc2774aac65d34b8b890405f41" "checksum slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" @@ -1432,7 +1456,7 @@ dependencies = [ "checksum time 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)" = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438" "checksum toml 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)" = "ffc92d160b1eef40665be3a05630d003936a3bc7da7421277846c2613e92c71a" "checksum treeline 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a7f741b240f1a48843f9b8e0444fb55fb2a4ff67293b50a9179dfd5ea67f8d41" -"checksum tui 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b7de74b91c6cb83119a2140e7c215d95d9e54db27b58a500a2cbdeec4987b0a2" +"checksum tui 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)" = "8b1825bf17ac96464ae6f6a590358a961cb57ee81d03093c50abf5830e36df7a" "checksum typed-builder 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "78cea224ddd4282dfc40d1edabbd0c020a12e946e3a48e2c2b8f6ff167ad29fe" "checksum typenum 1.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "373c8a200f9e67a0c95e62a4f52fbf80c23b4381c05a17845531982fa99e6b33" "checksum unicode-segmentation 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e83e153d1053cbb5a118eeff7fd5be06ed99153f00dbcd8ae310c5fb2b22edc0" @@ -26,7 +26,7 @@ crossterm = "0.17" chrono = "0.4.11" clap = "2.33.0" dirs = "2.0.2" -futures = "0.3.4" +futures = "0.3.5" heim = "0.0.10" itertools = "0.9.0" regex = "1.3" diff --git a/src/app/data_farmer.rs b/src/app/data_farmer.rs index 352890f6..d9829896 100644 --- a/src/app/data_farmer.rs +++ b/src/app/data_farmer.rs @@ -21,20 +21,14 @@ use crate::data_harvester::{ pub type TimeOffset = f64; pub type Value = f64; -pub type JoinedDataPoints = (Value, Vec<(TimeOffset, Value)>); #[derive(Debug, Default)] pub struct TimedData { - // pub rx_data: Value, - // pub tx_data: Value, - // pub cpu_data: Vec<Value>, - // pub mem_data: Value, - // pub swap_data: Value, - pub rx_data: JoinedDataPoints, - pub tx_data: JoinedDataPoints, - pub cpu_data: Vec<JoinedDataPoints>, - pub mem_data: JoinedDataPoints, - pub swap_data: JoinedDataPoints, + pub rx_data: Value, + pub tx_data: Value, + pub cpu_data: Vec<Value>, + pub mem_data: Value, + pub swap_data: Value, } /// AppCollection represents the pooled data stored within the main app @@ -123,22 +117,19 @@ impl DataCollection { // Network if let Some(network) = &harvested_data.network { - // self.eat_network(network, &mut new_entry); - self.eat_network(network, harvested_time, &mut new_entry); + self.eat_network(network, &mut new_entry); } // Memory and Swap if let Some(memory) = &harvested_data.memory { if let Some(swap) = &harvested_data.swap { - // self.eat_memory_and_swap(memory, swap, &mut new_entry); - self.eat_memory_and_swap(memory, swap, harvested_time, &mut new_entry); + self.eat_memory_and_swap(memory, swap, &mut new_entry); } } // CPU if let Some(cpu) = &harvested_data.cpu { - // self.eat_cpu(cpu, &mut new_entry); - self.eat_cpu(cpu, harvested_time, &mut new_entry); + self.eat_cpu(cpu, &mut new_entry); } // Temp @@ -169,25 +160,14 @@ impl DataCollection { } fn eat_memory_and_swap( - &mut self, memory: &mem::MemHarvest, swap: &mem::MemHarvest, harvested_time: Instant, - new_entry: &mut TimedData, + &mut self, memory: &mem::MemHarvest, swap: &mem::MemHarvest, new_entry: &mut TimedData, ) { // Memory let mem_percent = match memory.mem_total_in_mb { 0 => 0f64, total => (memory.mem_used_in_mb as f64) / (total as f64) * 100.0, }; - // new_entry.mem_data = mem_percent; - - // Can delete this block - let mem_joining_pts = if let Some((time, last_pt)) = self.timed_data_vec.last() { - generate_joining_points(*time, last_pt.mem_data.0, harvested_time, mem_percent) - } else { - Vec::new() - }; - let mem_pt = (mem_percent, mem_joining_pts); - new_entry.mem_data = mem_pt; - // To here + new_entry.mem_data = mem_percent; // Swap if swap.mem_total_in_mb > 0 { @@ -195,17 +175,7 @@ impl DataCollection { 0 => 0f64, total => (swap.mem_used_in_mb as f64) / (total as f64) * 100.0, }; - // new_entry.swap_data = swap_percent; - - // Can delete to - let swap_joining_pt = if let Some((time, last_pt)) = self.timed_data_vec.last() { - generate_joining_points(*time, last_pt.swap_data.0, harvested_time, swap_percent) - } else { - Vec::new() - }; - let swap_pt = (swap_percent, swap_joining_pt); - new_entry.swap_data = swap_pt; - // here + new_entry.swap_data = swap_percent; } // In addition copy over latest data for easy reference @@ -213,27 +183,14 @@ impl DataCollection { self.swap_harvest = swap.clone(); } - fn eat_network( - &mut self, network: &network::NetworkHarvest, harvested_time: Instant, - new_entry: &mut TimedData, - ) { + fn eat_network(&mut self, network: &network::NetworkHarvest, new_entry: &mut TimedData) { // RX let logged_rx_val = if network.rx as f64 > 0.0 { (network.rx as f64).log(2.0) } else { 0.0 }; - // new_entry.rx_data = logged_rx_val; - - // Can delete - let rx_joining_pts = if let Some((time, last_pt)) = self.timed_data_vec.last() { - generate_joining_points(*time, last_pt.rx_data.0, harvested_time, logged_rx_val) - } else { - Vec::new() - }; - let rx_pt = (logged_rx_val, rx_joining_pts); - new_entry.rx_data = rx_pt; - // to here + new_entry.rx_data = logged_rx_val; // TX let logged_tx_val = if network.tx as f64 > 0.0 { @@ -241,46 +198,18 @@ impl DataCollection { } else { 0.0 }; - // new_entry.tx_data = logged_tx_val; - - // Can delete - let tx_joining_pts = if let Some((time, last_pt)) = self.timed_data_vec.last() { - generate_joining_points(*time, last_pt.tx_data.0, harvested_time, logged_tx_val) - } else { - Vec::new() - }; - let tx_pt = (logged_tx_val, tx_joining_pts); - new_entry.tx_data = tx_pt; - // to here + new_entry.tx_data = logged_tx_val; // In addition copy over latest data for easy reference self.network_harvest = network.clone(); } - fn eat_cpu( - &mut self, cpu: &[cpu::CPUData], harvested_time: Instant, new_entry: &mut TimedData, - ) { + fn eat_cpu(&mut self, cpu: &[cpu::CPUData], new_entry: &mut TimedData) { // Note this only pre-calculates the data points - the names will be // within the local copy of cpu_harvest. Since it's all sequential // it probably doesn't matter anyways. - // cpu.iter() - // .for_each(|cpu| new_entry.cpu_data.push(cpu.cpu_usage)); - - // Can delete - if let Some((time, last_pt)) = self.timed_data_vec.last() { - for (cpu, last_pt_data) in cpu.iter().zip(&last_pt.cpu_data) { - let cpu_joining_pts = - generate_joining_points(*time, last_pt_data.0, harvested_time, cpu.cpu_usage); - let cpu_pt = (cpu.cpu_usage, cpu_joining_pts); - new_entry.cpu_data.push(cpu_pt); - } - } else { - for cpu in cpu.iter() { - let cpu_pt = (cpu.cpu_usage, Vec::new()); - new_entry.cpu_data.push(cpu_pt); - } - } - // to here + cpu.iter() + .for_each(|cpu| new_entry.cpu_data.push(cpu.cpu_usage)); self.cpu_harvest = cpu.to_vec(); } @@ -333,37 +262,3 @@ impl DataCollection { self.battery_harvest = list_of_batteries.to_vec(); } } - -// Delete later -fn generate_joining_points( - start_x: Instant, start_y: f64, end_x: Instant, end_y: f64, -) -> Vec<(TimeOffset, Value)> { - let mut points: Vec<(TimeOffset, Value)> = Vec::new(); - - // Convert time floats first: - let tmp_time_diff = (end_x).duration_since(start_x).as_millis() as f64; - let time_difference = if tmp_time_diff == 0.0 { - 0.001 - } else { - tmp_time_diff - }; - let value_difference = end_y - start_y; - - // Let's generate... about this many points! - let num_points = std::cmp::min( - std::cmp::max( - (value_difference.abs() / time_difference * 2000.0) as u64, - 50, - ), - 2000, - ); - - for itx in (0..num_points).step_by(2) { - points.push(( - time_difference - (itx as f64 / num_points as f64 * time_difference), - start_y + (itx as f64 / num_points as f64 * value_difference), - )); - } - - points -} diff --git a/src/canvas/widgets/cpu_graph.rs b/src/canvas/widgets/cpu_graph.rs index 28d6dc21..07fb711c 100644 --- a/src/canvas/widgets/cpu_graph.rs +++ b/src/canvas/widgets/cpu_graph.rs @@ -162,7 +162,8 @@ impl CpuGraphWidget for Painter { self.colours.cpu_colour_styles [itx % self.colours.cpu_colour_styles.len()] }) - .data(&cpu.cpu_data[..]), // .graph_type(tui::widgets::GraphType::Line), + .data(&cpu.cpu_data[..]) + .graph_type(tui::widgets::GraphType::Line), ) } else { None diff --git a/src/canvas/widgets/mem_graph.rs b/src/canvas/widgets/mem_graph.rs index d25553ce..6dd81b75 100644 --- a/src/canvas/widgets/mem_graph.rs +++ b/src/canvas/widgets/mem_graph.rs @@ -73,7 +73,7 @@ impl MemGraphWidget for Painter { Marker::Braille }) .style(self.colours.ram_style) - .data(&mem_data), // .graph_type(tui::widgets::GraphType::Line), + .data(&mem_data).graph_type(tui::widgets::GraphType::Line), ); } @@ -87,7 +87,7 @@ impl MemGraphWidget for Painter { Marker::Braille }) .style(self.colours.swap_style) - .data(&swap_data), // .graph_type(tui::widgets::GraphType::Line), + .data(&swap_data) .graph_type(tui::widgets::GraphType::Line), ); } diff --git a/src/canvas/widgets/network_graph.rs b/src/canvas/widgets/network_graph.rs index 11aa9f85..9fab03c1 100644 --- a/src/canvas/widgets/network_graph.rs +++ b/src/canvas/widgets/network_graph.rs @@ -142,7 +142,7 @@ impl NetworkGraphWidget for Painter { Marker::Braille }) .style(self.colours.rx_style) - .data(&network_data_rx), // .graph_type(tui::widgets::GraphType::Line), + .data(&network_data_rx).graph_type(tui::widgets::GraphType::Line), ); } @@ -156,7 +156,7 @@ impl NetworkGraphWidget for Painter { Marker::Braille }) .style(self.colours.tx_style) - .data(&network_data_tx), // .graph_type(tui::widgets::GraphType::Line), + .data(&network_data_tx).graph_type(tui::widgets::GraphType::Line), ); ret_val.push( Dataset::default() @@ -191,7 +191,7 @@ impl NetworkGraphWidget for Painter { Marker::Braille }) .style(self.colours.rx_style) - .data(&network_data_rx), // .graph_type(tui::widgets::GraphType::Line), + .data(&network_data_rx).graph_type(tui::widgets::GraphType::Line), ); } @@ -205,7 +205,7 @@ impl NetworkGraphWidget for Painter { Marker::Braille }) .style(self.colours.tx_style) - .data(&network_data_tx), // .graph_type(tui::widgets::GraphType::Line), + .data(&network_data_tx).graph_type(tui::widgets::GraphType::Line), ); } diff --git a/src/data_conversion.rs b/src/data_conversion.rs index 78fb0e07..31b3ab0e 100644 --- a/src/data_conversion.rs +++ b/src/data_conversion.rs @@ -161,17 +161,8 @@ pub fn convert_cpu_data_points( } if let Some(cpu_data) = cpu_data_vector.get_mut(itx) { - // cpu_data.legend_value = format!("{:.0}%", cpu.round()); - // cpu_data.cpu_data.push((-time_from_start, *cpu)); - - // Delete - cpu_data.legend_value = format!("{:.0}%", cpu.0.round()); - for &(joiner_offset, joiner_val) in &cpu.1 { - let offset_time = time_from_start + joiner_offset as f64; - cpu_data.cpu_data.push((-offset_time, joiner_val)); - } - cpu_data.cpu_data.push((-time_from_start, cpu.0)); - // to here + cpu_data.legend_value = format!("{:.0}%", cpu.round()); + cpu_data.cpu_data.push((-time_from_start, *cpu)); } } @@ -199,17 +190,7 @@ pub fn convert_mem_data_points( for (time, data) in ¤t_data.timed_data_vec { let time_from_start: f64 = (current_time.duration_since(*time).as_millis() as f64).floor(); - - // result.push((-time_from_start, data.mem_data)); - - // Delete - for &(joiner_offset, joiner_val) in &data.mem_data.1 { - let offset_time = time_from_start + joiner_offset as f64; - result.push((-offset_time, joiner_val)); - } - result.push((-time_from_start, data.mem_data.0)); - // to here - + result.push((-time_from_start, data.mem_data)); if *time == current_time { break; } @@ -234,17 +215,7 @@ pub fn convert_swap_data_points( for (time, data) in ¤t_data.timed_data_vec { let time_from_start: f64 = (current_time.duration_since(*time).as_millis() as f64).floor(); - // result.push((-time_from_start, data.swap_data)); - - // Delete - for &(joiner_offset, joiner_val) in &data.swap_data.1 { - let offset_time = time_from_start + joiner_offset as f64; - result.push((-offset_time, joiner_val)); - } - - result.push((-time_from_start, data.swap_data.0)); - // to here - + result.push((-time_from_start, data.swap_data)); if *time == current_time { break; } @@ -307,24 +278,8 @@ pub fn get_rx_tx_data_points( for (time, data) in ¤t_data.timed_data_vec { let time_from_start: f64 = (current_time.duration_since(*time).as_millis() as f64).floor(); - // rx.push((-time_from_start, data.rx_data)); - // tx.push((-time_from_start, data.tx_data)); - - // Delete - for &(joiner_offset, joiner_val) in &data.rx_data.1 { - let offset_time = time_from_start + joiner_offset as f64; - rx.push((-offset_time, joiner_val)); - } - - for &(joiner_offset, joiner_val) in &data.tx_data.1 { - let offset_time = time_from_start + joiner_offset as f64; - tx.push((-offset_time, joiner_val)); - } - - rx.push((-time_from_start, data.rx_data.0)); - tx.push((-time_from_start, data.tx_data.0)); - // to here - + rx.push((-time_from_start, data.rx_data)); + tx.push((-time_from_start, data.tx_data)); if *time == current_time { break; } |