aboutsummaryrefslogtreecommitdiffstats
path: root/lib/os_mon/src/cpu_sup.erl
diff options
context:
space:
mode:
authorErlang/OTP <[email protected]>2010-02-17 11:13:42 +0000
committerErlang/OTP <[email protected]>2010-02-17 11:13:42 +0000
commit40b76c2e854c9771f8699fd143299ad2d6de4603 (patch)
tree0785b7428656150c1ee6d19345dee941355ab4f6 /lib/os_mon/src/cpu_sup.erl
parent4a33e37e8c1b4f60a6890dccae438cd8fbbb05ef (diff)
parenta8bf1fe3b9f5f69354403231a3c47489d9015977 (diff)
downloadotp-40b76c2e854c9771f8699fd143299ad2d6de4603.tar.gz
otp-40b76c2e854c9771f8699fd143299ad2d6de4603.tar.bz2
otp-40b76c2e854c9771f8699fd143299ad2d6de4603.zip
Merge branch 'ks/cleanups' into ccase/r13b04_dev
* ks/cleanups: percept: Clean up as suggested by tidier percept: Modernize types and specs parsetools: Don't use 'try...of' when 'try' will do parsetools: Use %% for comments at the beginning of a line parsetools: Replace lists:keysearch/3 with lists:keyfind/3 parsetools: Modernize types and specs parsetools: Replace TABs with spaces runtime_tools: Modernize specs sasl: Eliminate tuple used as fun sasl: Add missing modules to app file asn1: Clean up as suggested by tidier os_mon: Modernize types and specs wx: Clean up as suggested by tidier OTP-8455 ks/cleanups
Diffstat (limited to 'lib/os_mon/src/cpu_sup.erl')
-rw-r--r--lib/os_mon/src/cpu_sup.erl37
1 files changed, 16 insertions, 21 deletions
diff --git a/lib/os_mon/src/cpu_sup.erl b/lib/os_mon/src/cpu_sup.erl
index 742e20b1fa..e414e2c10b 100644
--- a/lib/os_mon/src/cpu_sup.erl
+++ b/lib/os_mon/src/cpu_sup.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 1997-2010. 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(cpu_sup).
@@ -65,15 +65,10 @@
%% Contract specifications
%%----------------------------------------------------------------------
--type(util_cpus() :: 'all' | integer() | [integer()]).
--type(util_state() ::
- 'user' |
- 'nice_user' |
- 'kernel' |
- 'wait' |
- 'idle').
--type(util_value() :: {util_state(), float()} | float()).
--type(util_desc() :: {util_cpus(), util_value(), util_value(), []}).
+-type util_cpus() :: 'all' | integer() | [integer()].
+-type util_state() :: 'user' | 'nice_user' | 'kernel' | 'wait' | 'idle'.
+-type util_value() :: {util_state(), float()} | float().
+-type util_desc() :: {util_cpus(), util_value(), util_value(), []}.
%%----------------------------------------------------------------------
%% Exported functions
@@ -88,28 +83,28 @@ start_link() ->
stop() ->
gen_server:call(cpu_sup, ?quit, infinity).
--spec(nprocs/0 :: () -> integer() | {'error', any()}).
+-spec nprocs() -> integer() | {'error', any()}.
nprocs() ->
os_mon:call(cpu_sup, ?nprocs, infinity).
--spec(avg1/0 :: () -> integer() | {'error', any()}).
+-spec avg1() -> integer() | {'error', any()}.
avg1() ->
os_mon:call(cpu_sup, ?avg1, infinity).
--spec(avg5/0 :: () -> integer() | {'error', any()}).
+-spec avg5() -> integer() | {'error', any()}.
avg5() ->
os_mon:call(cpu_sup, ?avg5, infinity).
--spec(avg15/0 :: () -> integer() | {'error', any()}).
+-spec avg15() -> integer() | {'error', any()}.
avg15() ->
os_mon:call(cpu_sup, ?avg15, infinity).
--spec(util/1 :: ([ 'detailed' | 'per_cpu']) ->
- util_desc() | [util_desc()] | {'error', any()}).
+-spec util(['detailed' | 'per_cpu']) ->
+ util_desc() | [util_desc()] | {'error', any()}.
util(Args) when is_list (Args) ->
% Get arguments
@@ -126,7 +121,7 @@ util(Args) when is_list (Args) ->
util(_) ->
erlang:error(badarg).
--spec(util/0 :: () -> float()).
+-spec util() -> float().
util() ->
case util([]) of