From 96114a16b0f6056f19827c6d7a87481505347370 Mon Sep 17 00:00:00 2001 From: Gerhard Gonter <ggonter@gmail.com> Date: Tue, 12 Oct 2021 18:00:45 +0200 Subject: [PATCH] activity messages improved --- eprints1.pl | 42 ++++++++++++++++++++++++++++++++++-------- 1 file changed, 34 insertions(+), 8 deletions(-) diff --git a/eprints1.pl b/eprints1.pl index 004b162..c09463f 100755 --- a/eprints1.pl +++ b/eprints1.pl @@ -2671,7 +2671,7 @@ sub oma # my $col_sync= $db_ot2ut->get_collection('sync'); my $col_req= $db_ot2ut->get_collection('requests'); - activity({ activity => 'listening' }); + activity({ activity => 'listening', msg => ": context $ot2ut_context" }); # send_message("oma is listening..."); REQ: while($running && $serving_requests) @@ -2681,7 +2681,7 @@ sub oma { print __LINE__, " oma sleeping until ", scalar localtime(time()+$oma_sleep_time), "\n"; sleep ($oma_sleep_time); - activity({ activity => 'sleeping'}) if ($last_activity + $activity_period <= time()); + activity({ activity => 'sleeping', msg => ": context $ot2ut_context" }) if ($last_activity + $activity_period <= time()); next REQ; } @@ -2704,7 +2704,7 @@ sub oma $col_req->update( { _id => $row->{_id} }, { '$set' => { status => 'finish', ts_start => Util::ts::ts_ISO_gmt() }} ); my $msg= "send_batch: sending $bs objects in $ot2ut_eprint_status to $ot2ut_context"; - activity({ activity => 'send_batch', msg => $msg}); + activity({ activity => 'send_batch', msg => ': '. $msg}); send_message($msg); my ($synced, $res)= ot2ut(); @@ -2720,7 +2720,7 @@ sub oma $col_req->update({ _id => $row->{_id}}, { '$set' => { status => 'in_progress', ts_start => Util::ts::ts_ISO_gmt() }}); my $msg= "send_block: sending objects of block $block to $ot2ut_context"; - activity({ activity => 'send_block', msg => $msg}); + activity({ activity => 'send_block', msg => ': '. $msg}); send_message($msg); my ($synced, $res)= ot2ut('block' => $block); @@ -2739,7 +2739,7 @@ sub oma my $cnt= @ids; my $msg= "send_ids: sending $cnt objects to $ot2ut_context"; - activity({ activity => 'send_batch', msg => $msg}); + activity({ activity => 'send_batch', msg => ': '. $msg}); send_message($msg); $silent_upload_success= 0; @@ -2753,7 +2753,7 @@ sub oma } $col_req->update({ _id => $row->{_id}}, { '$set' => { status => $new_status, ts_finish => Util::ts::ts_ISO_gmt() }}); - activity({ activity => 'listening'}); + activity({ activity => 'listening', msg => ": context $ot2ut_context" }); } } @@ -2881,13 +2881,13 @@ sub ot2ut if ($ts[2] == 23 && $ts[1] >= 50) { send_message("it's almost midnight! ot2ut pausing for 20 minutes..."); - activity({ activity => 'pause', note => 'sleep out midnight activities in the environment' }); + activity({ activity => 'pause', note => ": sleep out midnight activities in the environment; context $ot2ut_context" }); sleep(20*60); send_message("ot2ut pause ended"); } - activity({ activity => 'ot2ut', msg => "processing $eprint_id" }); # CHECK if ($last_activity + $activity_period <= time()); + activity({ activity => 'ot2ut', msg => ": processing $eprint_id; context $ot2ut_context" }); # CHECK if ($last_activity + $activity_period <= time()); my $t_start= time(); @@ -5164,6 +5164,7 @@ sub policies_stats <p><font color="red">$msg</font></p> <p><a href="buckets.html" target="buckets">$bucket_cnt buckets</a></p> <h2>upload counters</h2> +<p><a href="http://xx2.test.univie.ac.at:3001/html/metablocks" target="opa">Live Counter</a></p> <table border="1"> <tr> <th>metablock</th> @@ -5451,12 +5452,37 @@ EOX Util::JSON::write_json_file('stale_uploads.json', \%stale_uploads); } +=begin comment + + if (exists ($incomplete_blocks{'entw'})) + { + my $ibe= $incomplete_blocks{'entw'}; + print IDX "<h2>incomplete blocks in context entw</h2>\n"; + print IDX join(' ', @$ibe), "\n"; + } + +=end comment +=cut + if (exists ($incomplete_blocks{'test'})) { my $ibt= $incomplete_blocks{'test'}; print IDX "<h2>incomplete blocks in context test</h2>\n"; print IDX join(' ', @$ibt), "\n"; } + +=begin comment + + if (exists ($incomplete_blocks{'prod'})) + { + my $ibp= $incomplete_blocks{'prod'}; + print IDX "<h2>incomplete blocks in context prod</h2>\n"; + print IDX join(' ', @$ibp), "\n"; + } + +=end comment +=cut + Util::JSON::write_json_file('incomplete_blocks.json', \%incomplete_blocks); print IDX "<h2>errors</h2>\n". Dumper(\%cnt_errors); -- GitLab