aboutsummaryrefslogtreecommitdiffstats
path: root/lib/observer/src/observer_sys.erl
diff options
context:
space:
mode:
authorDan Gudmundsson <[email protected]>2011-10-03 14:12:32 +0200
committerDan Gudmundsson <[email protected]>2011-11-08 08:46:08 +0100
commitffcacd111c61019a502a895b1edcfbc1578ddfa7 (patch)
tree5eb16cad1a8406e261f1e0c3f7cf2228e3d36c06 /lib/observer/src/observer_sys.erl
parent41dc04f0b76474596076bdc909760228fffc6a73 (diff)
downloadotp-ffcacd111c61019a502a895b1edcfbc1578ddfa7.tar.gz
otp-ffcacd111c61019a502a895b1edcfbc1578ddfa7.tar.bz2
otp-ffcacd111c61019a502a895b1edcfbc1578ddfa7.zip
[observer] Clean up code
system tab, timer handling and "etop" code More info in system tab, same timer handling in all tabs. Remove dependency off etop process, do the roughly the same functionality on our own.
Diffstat (limited to 'lib/observer/src/observer_sys.erl')
-rw-r--r--lib/observer/src/observer_sys.erl131
1 files changed, 0 insertions, 131 deletions
diff --git a/lib/observer/src/observer_sys.erl b/lib/observer/src/observer_sys.erl
deleted file mode 100644
index 8db7bb0e46..0000000000
--- a/lib/observer/src/observer_sys.erl
+++ /dev/null
@@ -1,131 +0,0 @@
-%%
-%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2011. All Rights Reserved.
-%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
-%%
-%% %CopyrightEnd%
-
--module(observer_sys).
-
--export([node_info/0, node_name_str/1, no_procs_str/1, no_cpu_str/1,
- no_cpu_available_str/1, no_cpu_online_str/1, tot_alloc_str/1,
- proc_used_str/1, proc_alloc_str/1, atom_used_str/1, atom_alloc_str/1,
- binary_alloc_str/1, code_alloc_str/1, ets_alloc_str/1]).
-
--record(node_info, {node_name,
- no_procs, % number of processes
- no_cpu, % number of logical cpu's
- no_cpu_available, %number of logical cpu's available
- no_cpu_online, % number of logical cpu's online
- tot_alloc, % total memory allocated
- proc_used, % memory used by processes
- proc_alloc, % memory alloc by processes,
- atom_used, % memory used by atoms
- atom_alloc, % memory allocated by atoms
- binary_alloc, % memory allocated for binaries
- code_alloc, % memory allocated by code
- ets_alloc}).% memory allocated by ets
-
-
-%%%%%%%%%%%%%%%%%%%%%%% functions %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-node_info() ->
- #node_info{node_name = node_name(),
- no_procs = process_count(),
- no_cpu = logical_cpus(),
- no_cpu_available = logical_cpus_available(),
- no_cpu_online = logical_cpus_online(),
- tot_alloc = total_alloc(),
- proc_used = processes_used(),
- proc_alloc = processes_alloc(),
- atom_used = atom_used(),
- atom_alloc = atom_alloc(),
- binary_alloc = binary_alloc(),
- code_alloc = code_alloc(),
- ets_alloc = ets_alloc()
- }.
-
-node_name() ->
- node().
-
-process_count() ->
- erlang:system_info(process_count).
-
-logical_cpus() ->
- erlang:system_info(logical_processors). % detected number of logical cpus configured on system
-
-logical_cpus_available() -> % detected number of logical cpus available to erlang runtime system
- erlang:system_info(logical_processors_available).
-
-logical_cpus_online() -> % detected number of logical cpus online on system
- erlang:system_info(logical_processors_online).
-
-total_alloc() ->
- erlang:memory(total). % total amount of memory currently allocated
-
-processes_used() -> % amount of memory currently used by the erlang processes
- erlang:memory(processes_used).
-
-processes_alloc() -> % allocated by erlang processes
- erlang:memory(processes).
-
-atom_used() -> % amount of memory used for atoms
- erlang:memory(atom_used).
-
-atom_alloc() -> % amount allocated for atoms
- erlang:memory(atom).
-
-binary_alloc() -> % amount allocated for binaries
- erlang:memory(binary).
-
-code_alloc() -> % amount allocated for code
- erlang:memory(code).
-
-ets_alloc() -> % amount allocated for ets tables
- erlang:memory(ets).
-
-
-%% formatting functions, from the record-value to string
-node_name_str(#node_info{node_name = ToReturn}) ->
- erlang:atom_to_list(ToReturn).
-no_procs_str(#node_info{no_procs = ToReturn}) ->
- erlang:integer_to_list(ToReturn).
-no_cpu_str(#node_info{no_cpu = ToReturn}) ->
- erlang:integer_to_list(ToReturn).
-no_cpu_available_str(#node_info{no_cpu_available = ToReturn}) ->
- erlang:integer_to_list(ToReturn).
-no_cpu_online_str(#node_info{no_cpu_online = ToReturn}) ->
- erlang:integer_to_list(ToReturn).
-tot_alloc_str(#node_info{tot_alloc = ToReturn}) ->
- erlang:integer_to_list(ToReturn).
-
-proc_used_str(#node_info{proc_used = ToReturn}) ->
- erlang:integer_to_list(ToReturn).
-
-proc_alloc_str(#node_info{proc_alloc = ToReturn}) ->
- erlang:integer_to_list(ToReturn).
-
-atom_used_str(#node_info{atom_used = ToReturn}) ->
- erlang:integer_to_list(ToReturn).
-
-atom_alloc_str(#node_info{atom_alloc = ToReturn}) ->
- erlang:integer_to_list(ToReturn).
-
-binary_alloc_str(#node_info{binary_alloc = ToReturn}) ->
- erlang:integer_to_list(ToReturn).
-
-code_alloc_str(#node_info{code_alloc = ToReturn}) ->
- erlang:integer_to_list(ToReturn).
-
-ets_alloc_str(#node_info{ets_alloc = ToReturn}) ->
- erlang:integer_to_list(ToReturn).