{"action":"created","issue":{"url":"https://api.github.com/repos/Fourdee/DietPi/issues/203","repository_url":"https://api.github.com/repos/Fourdee/DietPi","labels_url":"https://api.github.com/repos/Fourdee/DietPi/issues/203/labels{/name}","comments_url":"https://api.github.com/repos/Fourdee/DietPi/issues/203/comments","events_url":"https://api.github.com/repos/Fourdee/DietPi/issues/203/events","html_url":"https://github.com/Fourdee/DietPi/issues/203","id":135115056,"number":203,"title":"dietpi-cloudshell -  Scene Selection - Network Usage, CPU, Storage, Network Details (only locales change)","user":{"login":"k-plan","id":17237601,"avatar_url":"https://avatars.githubusercontent.com/u/17237601?v=3","gravatar_id":"","url":"https://api.github.com/users/k-plan","html_url":"https://github.com/k-plan","followers_url":"https://api.github.com/users/k-plan/followers","following_url":"https://api.github.com/users/k-plan/following{/other_user}","gists_url":"https://api.github.com/users/k-plan/gists{/gist_id}","starred_url":"https://api.github.com/users/k-plan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/k-plan/subscriptions","organizations_url":"https://api.github.com/users/k-plan/orgs","repos_url":"https://api.github.com/users/k-plan/repos","events_url":"https://api.github.com/users/k-plan/events{/privacy}","received_events_url":"https://api.github.com/users/k-plan/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Fourdee/DietPi/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/Fourdee/DietPi/milestones/9","html_url":"https://github.com/Fourdee/DietPi/milestones/v110","labels_url":"https://api.github.com/repos/Fourdee/DietPi/milestones/9/labels","id":1581294,"number":9,"title":"v110","description":"","creator":{"login":"Fourdee","id":7077026,"avatar_url":"https://avatars.githubusercontent.com/u/7077026?v=3","gravatar_id":"","url":"https://api.github.com/users/Fourdee","html_url":"https://github.com/Fourdee","followers_url":"https://api.github.com/users/Fourdee/followers","following_url":"https://api.github.com/users/Fourdee/following{/other_user}","gists_url":"https://api.github.com/users/Fourdee/gists{/gist_id}","starred_url":"https://api.github.com/users/Fourdee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fourdee/subscriptions","organizations_url":"https://api.github.com/users/Fourdee/orgs","repos_url":"https://api.github.com/users/Fourdee/repos","events_url":"https://api.github.com/users/Fourdee/events{/privacy}","received_events_url":"https://api.github.com/users/Fourdee/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":4,"state":"open","created_at":"2016-02-13T18:06:11Z","updated_at":"2016-02-26T17:33:05Z","due_on":null,"closed_at":null},"comments":31,"created_at":"2016-02-20T20:01:58Z","updated_at":"2016-02-26T21:54:52Z","closed_at":"2016-02-26T17:33:05Z","body":"Hi Fourdee,\r\ntested on Odroid C1+ (Jessie: v.109) (locales: en_GB.UTF-8) (root filesystem is on USB device) :\r\n\r\n- Install (`apt-get install iperf`) and start iperf (server) `root@oDroide-C1:~# iperf -s -f m -i 10`\r\n\r\n- Start `dietpi-cloudshell` (v4) on Odroid.\r\n\r\n- Start iperf (client) on a wired local network connected PC: `admin@PC$ iperf -c 10.10.10.10 -f m -i 2 -d -t 360`\r\n\r\n- Do same more iperf speed test and watch output on dietpi-cloudshell \r\n\r\nResult, if more traffic when 9999 MB is generated:\r\n![160214-0004](https://cloud.githubusercontent.com/assets/17237601/13198765/f9184730-d811-11e5-9647-ceb433261828.gif)\r\n Is dietpi-cloudshell not able to print traffic in GB?\r\n\r\n______________\r\n\r\n- While iperf is running, watch Scene : CPU and `root@oDroide-C1:~# htop`\r\n\r\nResult:\r\n![160214-0006](https://cloud.githubusercontent.com/assets/17237601/13198801/c3bd5886-d812-11e5-82db-d3b24bde1dca.gif)\r\n![160214-0005](https://cloud.githubusercontent.com/assets/17237601/13198804/d0323b7c-d812-11e5-87bd-12b71cacc102.gif)\r\nHow come margin?\r\n\r\n_____________\r\n\r\n- Watch Scene : Storage / Memory:\r\n\r\nResult:\r\n![160220-0002](https://cloud.githubusercontent.com/assets/17237601/13198818/6ea4abc8-d813-11e5-8010-ccc48a428885.gif)\r\n![160214-0003](https://cloud.githubusercontent.com/assets/17237601/13198852/5bf9428a-d814-11e5-9ed5-0b95f0296644.gif)\r\n\r\nroot filesystem is on USB device ([https://github.com/Fourdee/DietPi/issues/200](url))\r\n\r\n_______________\r\n\r\n- Now change setting locales: en_GB.UTF-8 to locales: de_DE.UTF-8\r\n\r\n-  Watch Scene : Network Details:\r\n\r\nResult:\r\n\r\n![160214-0002](https://cloud.githubusercontent.com/assets/17237601/13198859/7b449fa4-d814-11e5-8814-02a4a29bca7f.gif)\r\n\r\n_______________\r\n\r\nBe in doubt, if it is better to split this issue or post it in your forum.\r\nThanks for your assistance.\r\n\r\ncu\r\nk-plan"},"comment":{"url":"https://api.github.com/repos/Fourdee/DietPi/issues/comments/189497754","html_url":"https://github.com/Fourdee/DietPi/issues/203#issuecomment-189497754","issue_url":"https://api.github.com/repos/Fourdee/DietPi/issues/203","id":189497754,"user":{"login":"k-plan","id":17237601,"avatar_url":"https://avatars.githubusercontent.com/u/17237601?v=3","gravatar_id":"","url":"https://api.github.com/users/k-plan","html_url":"https://github.com/k-plan","followers_url":"https://api.github.com/users/k-plan/followers","following_url":"https://api.github.com/users/k-plan/following{/other_user}","gists_url":"https://api.github.com/users/k-plan/gists{/gist_id}","starred_url":"https://api.github.com/users/k-plan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/k-plan/subscriptions","organizations_url":"https://api.github.com/users/k-plan/orgs","repos_url":"https://api.github.com/users/k-plan/repos","events_url":"https://api.github.com/users/k-plan/events{/privacy}","received_events_url":"https://api.github.com/users/k-plan/received_events","type":"User","site_admin":false},"created_at":"2016-02-26T21:54:52Z","updated_at":"2016-02-26T21:54:52Z","body":"@Fourdee \r\n\r\n> The current calculations are based on:\r\n> `packet count * MTU byte size = byte` value If packets are fragmented, that would increase the results.\r\n\r\n`packet count * MTU byte size = byte` that's correct. \r\nBI values are calculated using Binary Units. (8 bit = 1 byte / 1024 byte = 1 kbyte)\r\nBinary units  (binary prefixes) are prefered by operating systems. \r\n\r\nNetwork throughput speed / Bandwidth are calculated using the Internation System of Units (SI values )\r\nNetwork throughput speed / Bandwidth calculated using SI Units in decimal prefixes. (1000 bit/s = 1 kbit/s / 1000 kbit/s = 1 Mbit/s) \r\n( Links: [1*](http://www.ibeast.com/content/tools/band-calc.asp) and  [2*](http://www.heise.de/netze/tools/bandbreitenrechner/) )\r\nBut MTU is in bytes, for example MTU=1500 bytes.\r\n\r\nTake a look in your code ([line 781](https://github.com/Fourdee/DietPi/commit/f5159a3e3f1f49b2cf7c0461c0d14318c374a658#diff-9ccf5cb326d9008aaceab7f80ce4ffdbL730)): \r\n\r\n```\r\nlocal now_sent_output=$( BYTE_PRINT_CONVERSION $NETWORK_USAGE_NOW_CURRENT_SENT )\r\nlocal now_recieved_output=$( BYTE_PRINT_CONVERSION $NETWORK_USAGE_NOW_CURRENT_RECIEVED )\r\n```\r\nTo get correct unit (Mbit/s) we needed additional:\r\n\r\n```\r\n\t#Converts a bit into string in human readable format.\r\n\t## (for network data transmission rate (LAN, WLAN, ...)\r\n\tBIT_PRINT_CONVERSION(){\r\n\r\n                local return_value=0\r\n                local decimal_count=1\r\n\r\n                #$1=bit value\r\n\r\n                # - Kbit\r\n                if (( $1 < 1048576 )); then\r\n                        #return_value=\"$(( $1 * 8 / 1000 )) Kbit\"\r\n                        return_value=\"$(echo \"scale=$decimal_count; $1 * 8 / 1000\" | bc -l) Kbit\"\r\n\r\n                # - MBit\r\n                elif (( $1 < 1073741824 )); then\r\n                        #return_value=\"$(( $1 * 8 / 1000 / 1000 )) Mbit\"\r\n                        return_value=\"$(echo \"scale=$decimal_count; $1  * 8 / 1000 / 1000\" | bc -l) Mbit\"\r\n\r\n                # - GBit\r\n                else\r\n                        #return_value=\"$(( $1 * 8 / 1000 / 1000 / 1000 )) Gbit\"\r\n                        return_value=\"$(echo \"scale=$decimal_count; $1 * 8 / 1000 / 1000 / 1000\" | bc -l) Gbit\"\r\n\r\n                fi\r\n\r\n                echo \"$return_value\"\r\n\r\n\t}\r\n\r\n```\r\n\r\nand have to change:\r\n\r\n```\r\n        #NETWORK USAGE\r\n        Update_Scene_4(){\r\n\r\n                #Update data\r\n                Obtain_NETWORK_USAGE\r\n\r\n                # - Convert usage values into human readable format. Run before clearing screen due to additional processing (delay)\r\n                local total_sent_output=$( BYTE_PRINT_CONVERSION $NETWORK_USAGE_TOTAL_CURRENT_SENT )\r\n                local total_recieved_output=$( BYTE_PRINT_CONVERSION $NETWORK_USAGE_TOTAL_CURRENT_RECIEVED )\r\n\r\n                local today_sent_output=$( BYTE_PRINT_CONVERSION $NETWORK_USAGE_DAY_CURRENT_SENT )\r\n                local today_recieved_output=$( BYTE_PRINT_CONVERSION $NETWORK_USAGE_DAY_CURRENT_RECIEVED )\r\n\r\n                ##local now_sent_output=$( BYTE_PRINT_CONVERSION $NETWORK_USAGE_NOW_CURRENT_SENT )\r\n                ##local now_recieved_output=$( BYTE_PRINT_CONVERSION $NETWORK_USAGE_NOW_CURRENT_RECIEVED )\r\n\r\n                local now_sent_output=$( BIT_PRINT_CONVERSION $NETWORK_USAGE_NOW_CURRENT_SENT )\r\n                local now_recieved_output=$( BIT_PRINT_CONVERSION $NETWORK_USAGE_NOW_CURRENT_RECIEVED )\r\n\r\n```\r\n\r\n![160226-0001 kopie](https://cloud.githubusercontent.com/assets/17237601/13365603/451f1834-dcd6-11e5-85ee-52d231822924.gif)\r\n![160226-0002](https://cloud.githubusercontent.com/assets/17237601/13365607/4ae62294-dcd6-11e5-9729-e27998ba74b5.gif)\r\n![160226-0003](https://cloud.githubusercontent.com/assets/17237601/13365611/5462e1ae-dcd6-11e5-91a4-fd5e797387de.gif)\r\n![160226-0004 kopie](https://cloud.githubusercontent.com/assets/17237601/13365619/5d1059a8-dcd6-11e5-8b00-1dc0d2a4637b.gif)\r\n\r\nSo you can see, Incoming/Receved does now fit.\r\nBut Outgoing/Sent doesn't. Yes, this will be, because we calculated using fix MTU of 1500 bytes.\r\nTCP Acknowledgment packets are containing clearly less bits. I have no solution for this at the moment.\r\n\r\n--------\r\n\r\n> I assume you mean the formatting issue with characters for the scrolldown? \r\n\r\nChecked, it is a ssh-Client display problem.\r\n\r\n--------\r\n\r\n> dietpi-cloudshell uses `ps -axo %cpu | sed '1d' | sed 's/ //'` to get a list of all processes cpu usage (%). As ps -axo %cpu values are relative to a per-core basis (eg: 1 process can show as 100%, but only 25% of a 4 core cpu is actually used), we add up the values and divided by cpu core count, to get overall usage across all cores.\r\n\r\nHmm, test it. Can not tell what is going on with `ps`\r\n\r\n`htop`\r\ncpu0 = 2%\r\ncpu1 = 100%\r\ncpu2 = 100%\r\ncpu3 = 0%\r\n= = = = = =\r\ncalculated load (by me): 202% / 4 = 50,5 %\r\n\r\ncloudshell print: 6%\r\n\r\nif I added all printed values of `ps -axo %cpu | sed '1d' | sed 's/ //'` = 18 %\r\n\r\n\r\n\r\n\r\n\r\n"}}