Skip to content

Commit

Permalink
various: Minor whitespace fixes at EOL
Browse files Browse the repository at this point in the history
  • Loading branch information
mariux committed Aug 13, 2015
1 parent ccf4ce6 commit e90f09f
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 84 deletions.
150 changes: 75 additions & 75 deletions mysql/fix_stats_runwaitidle_sec.sql
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,23 @@

DROP TEMPORARY TABLE IF EXISTS mytemp;

SET @sinq=0,@srun=0,@gid=0,@dt=0,@ot=0;
SET @sinq=0,@srun=0,@gid=0,@dt=0,@ot=0;

CREATE TEMPORARY TABLE IF NOT EXISTS mytemp AS
(
SELECT
group_id,
MAX(IF(last = "run", dtime, 0)) AS run,
MAX(IF(last = "wait", dtime, 0)) AS wait,
MAX(IF(last = "idle", dtime, 0)) AS idle,
group_id,
MAX(IF(last = "run", dtime, 0)) AS run,
MAX(IF(last = "wait", dtime, 0)) AS wait,
MAX(IF(last = "idle", dtime, 0)) AS idle,
MAX(date_end) AS date_end,
group_date_end,
stats_run_sec,
stats_wait_sec,
stats_idle_sec
stats_run_sec,
stats_wait_sec,
stats_idle_sec
FROM
(
SELECT
SELECT
gidchange,
group_id,
time,
Expand All @@ -35,145 +35,145 @@ CREATE TEMPORARY TABLE IF NOT EXISTS mytemp AS
group_date_end,
stats_wait_sec,
stats_run_sec,
stats_idle_sec
stats_idle_sec
FROM
(
SELECT
SELECT
@gidchange := @gid != group_id AS gidchange,
@gid := group_id AS group_id,
@gid := group_id AS group_id,
time,
sdinq,
sdrun,
@sinq := IF(@gidchange = 1,
sdinq,
sdrun,
@sinq := IF(@gidchange = 1,
sdinq,
@sinq + sdinq
) AS sinq,
@srun := IF(@gidchange = 1,
sdrun,
@srun := IF(@gidchange = 1,
sdrun,
@srun + sdrun
) AS srun,
IF(@gidchange, "new", @last) as last,
@last := IF(@srun > 0,
"run",
IF(@sinq > 0,
"wait",
) AS srun,
IF(@gidchange, "new", @last) as last,
@last := IF(@srun > 0,
"run",
IF(@sinq > 0,
"wait",
"idle"
)
) AS phase,
@dt := IF(@gidchange,
0,
) AS phase,
@dt := IF(@gidchange,
0,
time - @ot
) AS dt,
) AS dt,
@ot := time,
date_end,
group_date_end,
stats_wait_sec,
stats_run_sec,
stats_idle_sec
FROM
FROM
(
SELECT
group_id,
time,
SUM(dinq) as sdinq,
SELECT
group_id,
time,
SUM(dinq) as sdinq,
SUM(drun) as sdrun,
MAX(date_end) AS date_end,
group_date_end,
stats_wait_sec,
stats_run_sec,
stats_idle_sec
FROM
FROM
(
(
SELECT
SELECT
mxq_job.group_id AS group_id,
job_status,
unix_timestamp(date_submit) AS time,
1 AS event,
1 AS dinq,
job_status,
unix_timestamp(date_submit) AS time,
1 AS event,
1 AS dinq,
0 AS drun,
date_end,
group_date_end,
stats_wait_sec,
stats_run_sec,
stats_idle_sec
FROM
FROM
mxq_job, mxq_group
WHERE
WHERE
mxq_job.group_id = mxq_group.group_id
)
UNION ALL
(
(
SELECT
mxq_job.group_id AS group_id,
job_status,
unix_timestamp(date_start),
2,
-1,
job_status,
unix_timestamp(date_start),
2,
-1,
1,
date_end,
group_date_end,
stats_wait_sec,
stats_run_sec,
stats_idle_sec
FROM
FROM
mxq_job, mxq_group
WHERE
WHERE
mxq_job.group_id = mxq_group.group_id
AND date_start > 0
)
UNION ALL
(
UNION ALL
(
SELECT
mxq_job.group_id AS group_id,
job_status,
unix_timestamp(date_end),
3,
0,
job_status,
unix_timestamp(date_end),
3,
0,
-1,
date_end,
group_date_end,
stats_wait_sec,
stats_run_sec,
stats_idle_sec
FROM
FROM
mxq_job, mxq_group
WHERE
WHERE
mxq_job.group_id = mxq_group.group_id
AND date_end > 0
)
ORDER BY
group_id,
time,
ORDER BY
group_id,
time,
event
) AS S1
GROUP BY
group_id, time
ORDER BY
) AS S1
GROUP BY
group_id, time
ORDER BY
group_id, time
) AS S2
) AS S3
WHERE
last != "new"
GROUP BY
group_id, last
ORDER BY
WHERE
last != "new"
GROUP BY
group_id, last
ORDER BY
group_id, last
) AS S4
GROUP BY
GROUP BY
group_id
)
;

SET @sinq=0,@srun=0,@gid=0,@dt=0,@ot=0;

UPDATE mxq_group AS g
LEFT JOIN mytemp AS t
ON g.group_id = t.group_id
SET
g.stats_wait_sec = wait,
g.stats_run_sec = run,
g.stats_idle_sec = idle
UPDATE mxq_group AS g
LEFT JOIN mytemp AS t
ON g.group_id = t.group_id
SET
g.stats_wait_sec = wait,
g.stats_run_sec = run,
g.stats_idle_sec = idle
WHERE t.group_id
AND t.group_date_end
AND g.group_date_end
Expand Down
4 changes: 2 additions & 2 deletions web/lighttpd.conf.in
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ server.groupname="@HTTP_GROUP@"
server.port = @HTTP_PORT@

mimetype.assign = (
".html" => "text/html",
".html" => "text/html",
".txt" => "text/plain",
".css" => "text/css",
".jpg" => "image/jpeg",
Expand All @@ -21,6 +21,6 @@ mimetype.assign = (

server.modules = ( "mod_cgi" )


cgi.assign = ( "" => "" )
cgi.execute-x-only="enable"
14 changes: 7 additions & 7 deletions web/pages/mxq/mxq.in
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ sub HEAD {
$('#inner').load(window.location.pathname+"/inner",function() {
$("#progress").progressbar("value",0);
window.setTimeout(timeoutFunction,1000);
});
} else {
$("#progress").progressbar("value",i+1);
Expand All @@ -64,7 +64,7 @@ EOF
}

sub db_init {

open my $test,"<@MXQ_MYSQL_DEFAULT_FILE@" or die "@MXQ_MYSQL_DEFAULT_FILE@: $!\n";
$dbh= DBI->connect('DBI:mysql:mysql_read_default_file=@MXQ_MYSQL_DEFAULT_FILE@',undef,undef, { RaiseError => 1, AutoCommit => 1 });
# mxq_group.h
Expand Down Expand Up @@ -258,7 +258,7 @@ group_jobs_restarted : $o{group_jobs_restarted}
group_slots_running: : $o{group_slots_running}
group_mtime : $o{group_mtime}
group_date_end : $o{group_date_end}
stats_max_maxrss : $o{stats_max_maxrss}
Expand Down Expand Up @@ -328,7 +328,7 @@ job_umask: : $job_umask_text;
host_submit : $o{host_submit}
server_id : $o{server_id}
server_id : $o{server_id}
host_hostname : $o{host_hostname}
host_pid : $o{host_pid}
Expand Down Expand Up @@ -373,7 +373,7 @@ sub group_table_rows {

while (my $row=$sth->fetchrow_arrayref()) {
my ($group_id,$group_name,$user_name,$group_mtime,$group_status,
$group_jobs,$group_jobs_inq,$group_jobs_running,$group_jobs_finished,$group_jobs_failed,$group_jobs_cancelled,$group_jobs_unknown
$group_jobs,$group_jobs_inq,$group_jobs_running,$group_jobs_finished,$group_jobs_failed,$group_jobs_cancelled,$group_jobs_unknown
)=@$row;

$out.=$q->Tr(
Expand All @@ -389,8 +389,8 @@ sub group_table_rows {
$q->td({class=>'number'},$group_jobs_finished),
$q->td({class=>'number'},$group_jobs_failed),
$q->td({class=>'number'},$group_jobs_cancelled),
$q->td({class=>'number'},$group_jobs_unknown)
$q->td({class=>'number'},$group_jobs_unknown)

);
}
$out.='</table>';
Expand Down

0 comments on commit e90f09f

Please sign in to comment.