[Bio] / FigWebServices / local_sim_compute.cgi Repository:
ViewVC logotype

Annotation of /FigWebServices/local_sim_compute.cgi

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (view) (download)

1 : olson 1.1 #
2 :     # CGI that display the status of any local sim computations, including information about the
3 :     # queue of pegs awaiting computation, queued computations, and any running computations.
4 :     #
5 :     # It might also include information about the current size of the set of dynamic sims.
6 :     #
7 :    
8 :     use FIG;
9 :     use FIG_Config;
10 :     use FIG_CGI;
11 :     use HTML;
12 :    
13 :     my $html = [];
14 :    
15 :     my $sim_q = "$FIG_Config::global/queued_similarities";
16 :    
17 :     my($fig, $cgi, $user) = FIG_CGI::init(debug_save => 0,
18 :     debug_load => 0,
19 :     print_params => 0);
20 :    
21 :     push @$html,
22 :     $cgi->title("Similarity queue manager"),
23 :     $cgi->h1("Similarity queue manager"),
24 :     ;
25 :    
26 :    
27 :     #
28 :     # Gather information.
29 :     #
30 :    
31 :     my $sim_q_size = -s $sim_q;
32 :     my $sim_q_count;
33 :    
34 :     if ($sim_q_size and $sim_q_size < 100000)
35 :     {
36 :     $sim_q_count = 0;
37 :     open(S, "<$sim_q");
38 :     while (<S>)
39 :     {
40 :     $sim_queue_count++;
41 :     }
42 :     close(S);
43 :     }
44 :    
45 :     push @$html, "Similarity queue: $sim_q_size bytes ";
46 :     push @$html, "$sim_queue_count pegs" if $sim_queue_count;
47 :     push @$html, $cgi->p, "\n";
48 :    
49 :     my $db = $fig->db_handle();
50 :    
51 :     if ($db->table_exists("sim_queue"))
52 :     {
53 :     my $res = $db->SQL("select qid, finished, count(chunk_id), sum(len) from sim_queue group by qid, finished order by qid, finished");
54 :    
55 :     }
56 :    
57 :     HTML::show_page($cgi, $html);

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3