Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improved views and added duplicates to index
- Loading branch information
Showing
6 changed files
with
50 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,8 @@ | ||
<li> | ||
<div class='container'> | ||
<div class="span-24 last"> | ||
<span class='req-url'><%= url %></span> (<span class='date'><%= timestamp %></span>) | ||
</div> | ||
<div class="span-4"> | ||
Duration: <span class='duration'><%= duration %></span>s | ||
</div> | ||
<div class="span-16"> | ||
queries: <%= amount_queries %> | ||
</div> | ||
<div class="span-4 last"> | ||
<a href="<%= link %>">More Info</a> | ||
</div> | ||
</div> | ||
</li> | ||
<tr> | ||
<td><span class='date'><%= timestamp %></span></td> | ||
<td><span class='req-url'><%= url %></span></td> | ||
<td><span class='duration'><%= duration %></span>s</td> | ||
<td><%= amount_queries %> DB queries</td> | ||
<td><%= duplicates %> duplicates</td> | ||
<td><a href="<%= link %>">More Info</a></td> | ||
</tr> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,19 @@ | ||
function(doc) { | ||
emit(doc.started_at, { | ||
timestamp : doc.started_at, | ||
duration : doc.duration, | ||
url : doc.url, | ||
amount_queries : (doc['queries'] ? doc.queries.length : 0 ) | ||
}); | ||
var duplicates = []; | ||
if(doc['queries']){ | ||
var flattened_queries = doc.queries.map(function(query){ return (query['method'] + query['url'] + ((query['payload'] && query['payload']['keys']) ? query.payload.keys.join(', ') : '') ) }).sort(); | ||
for (var i = 0; i < flattened_queries.length - 1; i += 1) { | ||
if (flattened_queries[i + 1] == flattened_queries[i]) { | ||
duplicates.push(flattened_queries[i]); | ||
}; | ||
}; | ||
}; | ||
|
||
emit(doc.started_at, { | ||
timestamp : doc.started_at, | ||
duration : doc.duration, | ||
url : doc.url, | ||
amount_queries : (doc['queries'] ? doc.queries.length : 0 ), | ||
amount_duplicates : duplicates.length | ||
}); | ||
}; |