Skip to content

Commit

Permalink
Merge pull request cms-sw#23 from dballesteros7/promptskimming
Browse files Browse the repository at this point in the history
Promptskimming view
  • Loading branch information
Stephen Foulkes committed Jul 18, 2012
2 parents 63912bf + d9df120 commit e2b1d39
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/couchapps/WorkloadSummary/lists/completedWorkflows.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/**
* This list function gets the view output from outputDataBy<*>
* and creates an html which contains the links to the
* performance histogram and summary for each row in the output view
*/
function(head, req) {
var row;
start({"headers": {"Content-Type": "text/html"}});

var response = "<html><head>\n";
response += "<title> Summary of completed worklows </title>\n";
response += "</head><body style=\"font-family: arial;\">\n";

while (row = getRow()) {
var key = row.key;
var id = row.id;
response += "<b>Run:</b> " + key[2] + "\t";
response += "<b>Primary dataset:</b> " + key[0] + "\n<br>\n";
response += "<div id=output style=\"margin: 0px 0px 0px 15px;\">\n";
response += "Workflow Summary: <a href=\"../../_show/histogramByWorkflow/"+ id + "\">" + id + "</a><br>\n";
response += "</div><br>\n";
}

response += "</body></html>";
return response
};

21 changes: 21 additions & 0 deletions src/couchapps/WorkloadSummary/views/outputDataByPrimDs/map.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/**
* This view gets the summaries with an Id that matches any the following patterns:
* Run<runnumber>-<PrimDs>-<ProcessedDataset>-Tier1PromptReco-<GUID>
* Run<runnumber>-<PrimDs>-<ProcessedDataset>-<SkimName>-<GUID>
* It returns them with the following key:
* [<PrimDs>,<WorkflowType>, <runnumber>]
* The possible workflow types are:
* T1Reco for the first pattern
* PromptSkim for the second pattern
*/
function(doc) {
var regexp = /^Run(\d+)-(\w+)-(\w+)(-\w+)?-v(\d+)-(\w+)/;
var match = doc._id.match(regexp);
if (match && match.length == 7){
var runNumber = parseInt(match[1]);
var primDs = match[2];
var isReco = (match[4] != null) ? "PromptSkim" : "T1Reco";
emit([primDs, isReco, runNumber], null);
}
}

0 comments on commit e2b1d39

Please sign in to comment.