aboutsummaryrefslogtreecommitdiffstats
path: root/lib/snmp/src/misc/snmp_verbosity.erl
diff options
context:
space:
mode:
authorMicael Karlberg <[email protected]>2019-04-05 18:12:15 +0200
committerMicael Karlberg <[email protected]>2019-04-11 18:55:44 +0200
commit0d125432b4a33c0f4ef1e179e60a8e842125227c (patch)
tree4074d91139393e8366b6480fafc71c8be9721042 /lib/snmp/src/misc/snmp_verbosity.erl
parent5ac8a73af358e47666e4a3bb6bbe3edbfe98bf36 (diff)
downloadotp-0d125432b4a33c0f4ef1e179e60a8e842125227c.tar.gz
otp-0d125432b4a33c0f4ef1e179e60a8e842125227c.tar.bz2
otp-0d125432b4a33c0f4ef1e179e60a8e842125227c.zip
[snmp|agent|test] Timestamps and test manager
Added common (formated) timestamp function(s). Made use of these in the verbosity module (for debug printouts) and in the test suite(s). I also *think* I found the cause for some if the test case failures (timeouts). For v3 (agent) test cases the test manager makes use of parts of the agent code: snmp_framework_mib and snmp_user_based_sm_mib. And since they store their data in snmpa_local_db, that also needs to be running. And this was the problem (I think). On some (slow) machines, the snmpa_local_db process from the *previous* test case might still be running when the we tried to start it. That meant that no new snmpa_local_db was started. Instead the old one, still running but terminating, was retain. For a while. Until it actually finally stopped. So the next operation towards snmpa_local_db, insert, simply hanged until the process terminated. This in combination with the fact that the packet server process, which was started using proc_lib, previously called init_ack before this init was actually done, could actually start and then at a much later time hang because some operation timed out (the packet server was hanging). Yuckety yuck-yuck.
Diffstat (limited to 'lib/snmp/src/misc/snmp_verbosity.erl')
-rw-r--r--lib/snmp/src/misc/snmp_verbosity.erl13
1 files changed, 2 insertions, 11 deletions
diff --git a/lib/snmp/src/misc/snmp_verbosity.erl b/lib/snmp/src/misc/snmp_verbosity.erl
index bca4bad283..9b2676d048 100644
--- a/lib/snmp/src/misc/snmp_verbosity.erl
+++ b/lib/snmp/src/misc/snmp_verbosity.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2015. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2019. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -70,16 +70,7 @@ print2(_Verbosity,Format,Arguments) ->
timestamp() ->
- format_timestamp(os:timestamp()).
-
-format_timestamp({_N1, _N2, N3} = Now) ->
- {Date, Time} = calendar:now_to_datetime(Now),
- {YYYY,MM,DD} = Date,
- {Hour,Min,Sec} = Time,
- FormatDate =
- io_lib:format("~.4w:~.2.0w:~.2.0w ~.2.0w:~.2.0w:~.2.0w ~w",
- [YYYY,MM,DD,Hour,Min,Sec,round(N3/1000)]),
- lists:flatten(FormatDate).
+ snmp_misc:formated_timestamp().
process_args([], Acc) ->
lists:reverse(Acc);