Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
0b0df3f2
Commit
0b0df3f2
authored
Jul 11, 2013
by
Leigh B Stoller
Browse files
Performance improvements to the query; it was taking too long.
parent
3a5a1ba9
Changes
1
Hide whitespace changes
Inline
Side-by-side
www/showstats.php3
View file @
0b0df3f2
<?php
#
# Copyright (c) 2000-201
2
University of Utah and the Flux Group.
# Copyright (c) 2000-201
3
University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
...
...
@@ -117,12 +117,13 @@ elseif ($showby == "project") {
USERERROR
(
"Must supply a project to view!"
,
1
);
}
$pid
=
$target_project
->
pid
();
$pid_idx
=
$target_project
->
pid_idx
();
if
(
!
$target_project
->
AccessCheck
(
$this_user
,
$TB_PROJECT_READINFO
))
{
USERERROR
(
"You do not have permission to view stats for "
.
"project
$pid
!"
,
1
);
}
$wclause
=
"where (s.pid='
$pid
')"
;
$wclause
=
"where (s.pid
_idx
='
$pid
_idx
')"
;
}
elseif
(
$showby
==
"expt"
)
{
#
...
...
@@ -167,12 +168,13 @@ elseif ($showby == "expt") {
elseif
(
$showby
==
"all"
)
{
if
(
isset
(
$target_project
))
{
$pid
=
$target_project
->
pid
();
$pid_idx
=
$target_project
->
pid_idx
();
if
(
!
$target_project
->
AccessCheck
(
$this_user
,
$TB_PROJECT_READINFO
))
{
USERERROR
(
"You do not have permission to view stats for "
.
"project
$pid
!"
,
1
);
}
$wclause
=
"where (s.pid='
$pid
')"
;
$wclause
=
"where (s.pid
_idx
='
$pid
_idx
')"
;
}
elseif
(
!
$isadmin
)
{
#
...
...
@@ -213,7 +215,7 @@ $query_result =
DBQueryFatal
(
"select t.exptidx,s.pid,s.eid,t.action,t.exitcode,t.uid, "
.
" r.pnodes,t.idx as statno,t.start_time,t.end_time, "
.
" s.archive_idx,r.archive_tag,t.uid_idx "
.
" from testbed_stats as t
force index (end_time, idx)
"
.
" from testbed_stats as t "
.
"left join experiment_stats as s on s.exptidx=t.exptidx "
.
"left join experiment_resources as r on r.idx=t.rsrcidx "
.
"
$wclause
"
.
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment