Skip to content

Commit 8e732ff

Browse files
committed
Improved starting message and tap_aggr error logging
resolves #2
1 parent c8950a8 commit 8e732ff

File tree

2 files changed

+20
-9
lines changed

2 files changed

+20
-9
lines changed

src/tap_aggr.erl

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,22 @@
2525
-record(state,{raw_edge_list,tap_ds,tap_client_data,query_count,time_stamp}).
2626

2727
start()->
28+
Pid = spawn(?MODULE,start,[0,2,30]),
29+
Pid.
30+
31+
32+
33+
start(Time,Interval,MsgTime)->
2834
Receivers = tap_loom:get_ofdp_recv_list(),
2935
case Receivers of
30-
[] -> timer:sleep(2000),
31-
io:format("tap_aggr: waiting for data recievers...~n"),
32-
start();
33-
_ -> io:format("tap_aggr: starting...~n"),
36+
[] -> timer:sleep(Interval * 1000),
37+
case Rem = Time rem MsgTime of
38+
Rem when Rem == 0 ->
39+
error_logger:info_msg("tap_aggr: waiting for data recievers for ~p seconds...~n",[Time]),
40+
start(Time+Interval,Interval,MsgTime);
41+
_ -> start(Time+Interval,Interval,MsgTime)
42+
end;
43+
_ -> error_logger:info_msg("tap_aggr: starting...~n"),
3444
TapDS = tap_ds:start(),
3545
TCD = whereis(tap_client_data),
3646
{_Date,Time} = calendar:universal_time(),
@@ -41,6 +51,7 @@ start()->
4151
end.
4252

4353

54+
4455
listen(State)->
4556
receive
4657
{dns_reply,Reply}->

src/tapestry.erl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,17 @@
2626
-export([start/0, nci_from_log_lines/1, nci_from_benchmark_data/1]).
2727

2828
start()->
29+
error_logger:info_msg("Starting tapestry. View $TAPESTRY_HOME/log/console.log for operational messages.~n"),
2930
[code:add_pathz(Path) || Path <- filelib:wildcard("./lib/loom/ebin")],
3031
[code:add_pathz(Path) || Path <- filelib:wildcard("./lib/loom/deps/*/ebin")],
3132
[code:add_pathz(Path) || Path <- filelib:wildcard("./lib/loom/apps/*/ebin")],
32-
tap_yaws:start(),
3333
loom_app:start(),
3434
loom_sup:launch_controller(dns_tap,6634),
35-
%Pid = tap_ds:start(),
36-
%DataPid = whereis(tap_client_data),
37-
%spawn(tap_client_data,fake_nci_feed2,[DataPid]),
35+
tap_yaws:start(),
3836
Pid = tap_aggr:start(),
39-
{Pid,ok}.
37+
error_logger:info_msg("Stared tapestry with Process ID ~p.",[Pid]),
38+
Pid.
39+
4040

4141

4242

0 commit comments

Comments
 (0)