Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: sitescripts/stats/template/fileOverview.html

Issue 11481051: Update stats processing (Closed)
Patch Set: Improved performance using memoization Created Aug. 29, 2013, 1:39 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sitescripts/stats/static/stats.css ('k') | sitescripts/stats/template/fileStats.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sitescripts/stats/template/fileOverview.html
===================================================================
rename from sitescripts/logs/template/subscriptionOverview.html
rename to sitescripts/stats/template/fileOverview.html
--- a/sitescripts/logs/template/subscriptionOverview.html
+++ b/sitescripts/stats/template/fileOverview.html
@@ -1,89 +1,76 @@
-<!--
- - This file is part of the Adblock Plus web scripts,
- - Copyright (C) 2006-2013 Eyeo GmbH
- -
- - Adblock Plus is free software: you can redistribute it and/or modify
- - it under the terms of the GNU General Public License version 3 as
- - published by the Free Software Foundation.
- -
- - Adblock Plus is distributed in the hope that it will be useful,
- - but WITHOUT ANY WARRANTY; without even the implied warranty of
- - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- - GNU General Public License for more details.
- -
- - You should have received a copy of the GNU General Public License
- - along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
- -->
-
-
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <meta name="robots" content="noindex,nofollow" />
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <link rel="stylesheet" type="text/css" href="static/subscriptions.css" />
- <title>Overview for filter subscription {{fileName}}</title>
- </head>
-
- <body style="margin-top: 0px">
- <a name="top">&nbsp;</a>
- <table class="block" width="100%">
- <tr>
- <td class="title" width="250">Overview for subscription:</td>
- <td>easylist-downloads.adblockplus.org/{{fileName}}</td>
- </tr>
- <tr>
- <td class="title" width="250">Last update:</td>
- <td>{{now|formattime}}</td>
- </tr>
- </table>
-
- <div class="block_title">Monthly history</div>
- <div class="block">
- <table align="center" style="margin-bottom: 20px;">
- <tr align="bottom">
- {%- set maxHits = month|max(attribute='hits')|ensuremin(1) %}
- {%- set maxBandwidth = month|max(attribute='bandwidth')|ensuremin(1) %}
- {%- set totalHits = month|sum(attribute='hits')|ensuremin(1) %}
- {%- set totalBandwidth = month|sum(attribute='bandwidth')|ensuremin(1) %}
- {%- for info in month %}
- <td align="center" style="vertical-align: bottom;">
- <div class="hitsChart vertical" title="Hits: {{info.hits}}" style="height: {{(info.hits / maxHits * 100)|round(method='ceil')|int}}px;"></div>
- {{- '' -}}
- <div class="bandwidthChart vertical" title="Bandwidth: {{info.bandwidth|bytes}}" style="height: {{(info.bandwidth / maxBandwidth * 100)|round(method='ceil')|int}}px;"></div>
- </td>
- {%- endfor %}
- </tr>
- <tr>
- {%- for info in month %}
- <td align="center">
- <a href="{{info.url}}">{{info.id|monthname(format='%b')}}<br />{{info.id|monthname(format='%Y')}}</a>
- </td>
- {%- endfor %}
- </tr>
- </table>
-
- <table align="center">
- <tr>
- <th bgcolor="#ECECEC">Month</th>
- <th bgcolor="#66DDEE" colspan="2">Hits</th>
- <th bgcolor="#2EA495">Bandwidth</th>
- </tr>
- {%- for info in month %}
- <tr>
- <td><a href="{{info.url}}">{{info.id|monthname}}</a></td>
- <td align="right">{{info.hits}}</td>
- <td align="right">{{(info.hits / totalHits * 100)|round(precision=1)}}%</td>
- <td align="right">{{info.bandwidth|bytes}}</td>
- </tr>
- {%- endfor %}
- <tr class="special">
- <td style="font-weight: bold">Total</td>
- <td align="right">{{totalHits}}</td>
- <td align="right">&nbsp;</td>
- <td align="right">{{totalBandwidth|bytes}}</td>
- </tr>
- </table>
- </div>
- </body>
-</html>
+<!--
+ - This file is part of the Adblock Plus web scripts,
+ - Copyright (C) 2006-2013 Eyeo GmbH
+ -
+ - Adblock Plus is free software: you can redistribute it and/or modify
+ - it under the terms of the GNU General Public License version 3 as
+ - published by the Free Software Foundation.
+ -
+ - Adblock Plus is distributed in the hope that it will be useful,
+ - but WITHOUT ANY WARRANTY; without even the implied warranty of
+ - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ - GNU General Public License for more details.
+ -
+ - You should have received a copy of the GNU General Public License
+ - along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
+ -->
+
+
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <meta name="robots" content="noindex,nofollow" />
+ <meta charset="utf-8">
+ <link rel="stylesheet" type="text/css" href="../static/stats.css" />
+ <title>Overview for file {{url}}</title>
+ </head>
+
+ <body style="margin-top: 0px">
+ <a name="top">&nbsp;</a>
+ <table class="block" width="100%">
+ <tr>
+ <td class="title" width="250">Overview for file:</td>
+ <td>{{url}}</td>
+ </tr>
+ <tr>
+ <td class="title" width="250">Last update:</td>
+ <td>{{now|formattime}}</td>
+ </tr>
+ </table>
+
+ <div class="block_title">Monthly history</div>
+ <div class="block">
+ <table align="center" style="margin-bottom: 20px;">
+ <tr>
+ <th bgcolor="#ECECEC">Month</th>
+ <th bgcolor="#66DDEE">Hits</th>
+ <th bgcolor="#2EA495">Bandwidth</th>
+ <th>&nbsp;</th>
+ </tr>
+ {%- set data = data.items() %}
+ {%- set maxhits = data|maxhits %}
+ {%- set maxbandwidth = data|maxbandwidth %}
+ {%- for name, value in data %}
+ <tr>
+ <td><a href="{{value.url}}">{{name|monthname}}</a></td>
+ <td align="right">{{value.hits}}</td>
+ <td align="right">{{value.bandwidth|bytes}}</td>
+ <td class="chart">
+ <div class="hitsChart" style="width: {{(value.hits / maxhits * 100)|round(method='ceil')|int}}px;"></div><br />
+ <div class="bandwidthChart" style="width: {{(value.bandwidth / maxbandwidth * 100)|round(method='ceil')|int}}px;"></div>
+ </td>
+ </tr>
+ {%- endfor %}
+
+ {%- set totalhits = data|sumhits %}
+ {%- set totalbandwidth = data|sumbandwidth %}
+ <tr class="special">
+ <td class="emph">Total</td>
+ <td align="right">{{totalhits}}</td>
+ <td align="right">{{totalbandwidth|bytes}}</td>
+ <td align="right">&nbsp;</td>
+ </tr>
+ </table>
+ </div>
+ </body>
+</html>
« no previous file with comments | « sitescripts/stats/static/stats.css ('k') | sitescripts/stats/template/fileStats.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld