Skip to content
Snippets Groups Projects
Commit ae31ccc8 authored by Ashu Guru's avatar Ashu Guru
Browse files

Merge pull request #1 from s-dweitze2/for-ashu

Adding dn efficiency graph and Site exit code.
parents a5091216 be909fc7
No related branches found
No related tags found
No related merge requests found
...@@ -122,6 +122,76 @@ ...@@ -122,6 +122,76 @@
<attribute name="column_names" /> <attribute name="column_names" />
<attribute name="column_units" /> <attribute name="column_units" />
</query> </query>
<query name="simple_glidein_master_summary">
<inputs>
<input name="span" type="int" kind="sql">86400</input>
<input name="starttime" partial="down" type="datetime" kind="sql">time.time()-14*86400</input>
<input name="endtime" partial="up" type="datetime" kind="sql">time.time()</input>
<input name="includeFailed" kind="sql"> true </input>
<input name="includeSuccess" kind="sql"> true </input>
<input name="facility" kind="sql"> .* </input>
<input name="probe" kind="sql"> .* </input>
<input name="user" kind="sql"> .* </input>
<input name="vo" kind="sql"> .* </input>
<input name="role" kind="sql"> .* </input>
<input name="exclude-role" kind="sql"> NONE </input>
<input name="exclude-vo" kind="sql"> unknown|other </input>
<input name="exclude-user" kind="sql"> NONE </input>
<input name="exclude-facility" kind="sql"> NONE </input>
<input name="resource-type" kind="sql"> BatchPilot </input>
<input name="grid" kind="sql"> .* </input>
</inputs>
<sql>
SELECT
<slot name="group"/>,
<slot name="column"/>
FROM
MasterSummaryData R
JOIN
Probe P on R.ProbeName = P.probename
JOIN
Site S on S.siteid = P.siteid
JOIN
VONameCorrection VC ON (VC.corrid=R.VOcorrid)
JOIN
VO on (VC.void = VO.void)
<slot name="join"/>
WHERE
R.EndTime &gt;= :starttime AND
R.EndTime &lt; :endtime AND
R.HostDescription regexp :facility AND
R.Grid regexp :grid AND
VO.VOName regexp :vo AND
VC.VOName regexp :role AND
(NOT (VC.VOName regexp :exclude-role)) AND
(R.ResourceType regexp :resource-type or R.ResourceType = '') AND
R.CommonName regexp :user AND
(:includeFailed='true' OR ApplicationExitCode=0) AND
(:includeSuccess ='true' OR ApplicationExitCode!=0) AND
(NOT (S.SiteName regexp :exclude-facility)) AND
(NOT (R.CommonName regexp :exclude-user)) AND
(NOT (VO.VOName regexp :exclude-vo)) AND
R.WallDuration &lt; 1100000000 AND
R.ProbeName regexp :probe
<slot name="where"/>
GROUP BY
<slot name="group"/>
<slot name="having"/>
</sql>
<results module="graphtool.database.query_handler" function="simple_results_parser">
<inputs>
<input name="pivots"> 0 </input>
<input name="results"> 1 </input>
</inputs>
</results>
<attribute name="graph_type">GratiaPie</attribute>
<attribute name="pivot_name" />
<attribute name="title" />
<attribute name="column_names" />
<attribute name="column_units" />
</query>
<query name="glidein_master_summary"> <query name="glidein_master_summary">
<inputs> <inputs>
<input name="span" type="int" kind="sql">86400</input> <input name="span" type="int" kind="sql">86400</input>
......
...@@ -96,6 +96,52 @@ ...@@ -96,6 +96,52 @@
<attribute name="graph_type">GratiaStackedBar</attribute> <attribute name="graph_type">GratiaStackedBar</attribute>
</query> </query>
<query name="glidein_dn_efficiency_summary" base="GratiaGenericQuery.simple_glidein_master_summary">
<inputs>
<input name="vo" kind="sql">cms</input>
<input name="fixed-height">False</input>
<input name="min_hours" kind="sql" type="eval">0</input>
</inputs>
<sql>
<filler name="group"> COALESCE(R.CommonName, "UNKNOWN") </filler>
<filler name="column"> sum(case when ApplicationExitCode = 0 then CpuUserDuration + CpuSystemDuration else 0 end)/sum(Cores*WallDuration) </filler>
<filler name="where"> AND WallDuration > 0 AND WallDuration > 3600*:min_hours </filler>
</sql>
<results>
<inputs>
<input name="pivot_transform">displayName</input>
</inputs>
</results>
<attribute name="pivot_name">User</attribute>
<attribute name="title">CPU Efficiency Quality Map by User for $vo</attribute>
<attribute name="graph_type">QualityBarGraph</attribute>
</query>
<query name="glidein_exitcode_user_bar" base="GratiaGenericQuery.glidein_master_summary">
<inputs>
<!--<input name="includeSuccessful" type="int" kind="sql">1</input>-->
</inputs>
<sql>
<filler name="group"> R.CommonName, R.ApplicationExitCode, R.HostDescription </filler>
<filler name="column"> sum(Njobs) </filler>
<!--<filler name="where"> AND CASE WHEN :includeSuccessful!=1 THEN R.ApplicationExitCode!=0 ELSE true END </filler>-->
</sql>
<results module="graphtool.database.query_handler" function="results_parser">
<inputs>
<input name="pivots"> 1, 0, 2 </input>
<input name="grouping"> 3 </input>
<input name="results"> 4 </input>
<input name="pivot_transform">displayNameExitSite</input>
</inputs>
</results>
<attribute name="pivot_name">Exit Code</attribute>
<attribute name="grouping_name">Time</attribute>
<attribute name="title">Exit Code Count by User and Site (Glidein)</attribute>
<attribute name="column_names">Exit Code Count</attribute>
<attribute name="column_units">Jobs</attribute>
<attribute name="graph_type">GratiaStackedBar</attribute>
</query>
</class> </class>
......
...@@ -429,6 +429,14 @@ def displayNameSite(*args, **kw): ...@@ -429,6 +429,14 @@ def displayNameSite(*args, **kw):
return return
return "%s @ %s" % (dn, site) return "%s @ %s" % (dn, site)
def displayNameExitSite(*args, **kw):
exitcode = args[1]
site = args[2]
dn = displayName(*args, **kw)
if not dn:
return
return "%s: %s @ %s" % (dn, exitcode, site)
model_re = re.compile("model='(.*)'") model_re = re.compile("model='(.*)'")
def model_parser(pivot, **kw): def model_parser(pivot, **kw):
m = model_re.search(pivot) m = model_re.search(pivot)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment