diff options
author | Rickard Green <[email protected]> | 2015-06-17 13:32:37 +0200 |
---|---|---|
committer | Rickard Green <[email protected]> | 2015-06-17 13:32:37 +0200 |
commit | bcbc0bdd0f8e118687174c59aa8ea24bfc4b3107 (patch) | |
tree | 20f856376af65943a6a3b6a1db27079f85098fe1 /erts/preloaded/src/erts_internal.erl | |
parent | f08aaaf0d636ef987879dfb1e751e29ce80279bf (diff) | |
parent | 74f0d7c8ea47b363136c86de5d7ea78a48c40570 (diff) | |
download | otp-bcbc0bdd0f8e118687174c59aa8ea24bfc4b3107.tar.gz otp-bcbc0bdd0f8e118687174c59aa8ea24bfc4b3107.tar.bz2 otp-bcbc0bdd0f8e118687174c59aa8ea24bfc4b3107.zip |
Merge branch 'rickard/io-bytes/OTP-12842'
* rickard/io-bytes/OTP-12842:
Save IO bytes in scheduler specific data
Diffstat (limited to 'erts/preloaded/src/erts_internal.erl')
-rw-r--r-- | erts/preloaded/src/erts_internal.erl | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/erts/preloaded/src/erts_internal.erl b/erts/preloaded/src/erts_internal.erl index 65a1f1ed3a..cf8edefd7d 100644 --- a/erts/preloaded/src/erts_internal.erl +++ b/erts/preloaded/src/erts_internal.erl @@ -40,7 +40,7 @@ -export([flush_monitor_messages/3]). --export([await_result/1]). +-export([await_result/1, gather_io_bytes/2]). -export([time_unit/0]). @@ -67,6 +67,23 @@ await_result(Ref) when is_reference(Ref) -> end. %% +%% statistics(io) end up in gather_io_bytes/2 +%% + +gather_io_bytes(Ref, No) when is_reference(Ref), + is_integer(No), + No > 0 -> + gather_io_bytes(Ref, No, 0, 0). + +gather_io_bytes(_Ref, 0, InAcc, OutAcc) -> + {{input, InAcc}, {output, OutAcc}}; +gather_io_bytes(Ref, No, InAcc, OutAcc) -> + receive + {Ref, _SchedId, In, Out} -> + gather_io_bytes(Ref, No-1, InAcc + In, OutAcc + Out) + end. + +%% %% Statically linked port NIFs %% |