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

Unified Diff: modules/statsmaster/files/usercounts.html

Issue 5744622491926528: Issue 608 - Add 1-day user numbers to the user counter (Closed)
Patch Set: Created June 2, 2014, 1:35 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: modules/statsmaster/files/usercounts.html
===================================================================
--- a/modules/statsmaster/files/usercounts.html
+++ b/modules/statsmaster/files/usercounts.html
@@ -97,16 +97,18 @@
var hits = intervals[interval].hits;
for (var i = Math.max(offset, 0); i < data.length; i++)
{
if (i - offset < 30 && i - offset + days >= 30)
data[i]["30day " + type] += hits;
if (i - offset < 7 && i - offset + days >= 7)
data[i]["7day " + type] += hits;
+ if (i - offset < 1 && i - offset + days >= 1)
+ data[i]["1day " + type] += hits;
}
}
}
var month = zeroPad(date.getFullYear(), 4) + zeroPad(date.getMonth() + 1, 2);
if (month != curMonth)
{
doDownload("/raw/subscription/" + month + "/exceptionrules.txt.json", "acceptable ads data for month " + month, function(json)
@@ -144,16 +146,19 @@
resultBody.removeChild(resultBody.lastChild);
for (var i = 0; i < data.length; i++)
{
var date = new Date(fromDate.getTime() + i * MILLIS_IN_DAY);
var row = document.createElement("tr");
createCell(row, date.toLocaleDateString());
+ createCell(row, data[i]["1day total"].toLocaleString());
+ createCell(row, data[i]["1day acceptable"].toLocaleString());
+ createCell(row, (100 - data[i]["1day acceptable"] / data[i]["1day total"] * 100).toFixed(2) + "%");
createCell(row, data[i]["7day total"].toLocaleString());
createCell(row, data[i]["7day acceptable"].toLocaleString());
createCell(row, (100 - data[i]["7day acceptable"] / data[i]["7day total"] * 100).toFixed(2) + "%");
createCell(row, data[i]["30day total"].toLocaleString());
createCell(row, data[i]["30day acceptable"].toLocaleString());
createCell(row, (100 - data[i]["30day acceptable"] / data[i]["30day total"] * 100).toFixed(2) + "%");
resultBody.appendChild(row);
}
@@ -191,17 +196,17 @@
{
var tmp = fromDate;
fromDate = toDate;
toDate = tmp;
}
var data = [];
for (var d = fromDate; formatDate(d) <= formatDate(toDate); d = new Date(d.getTime() + MILLIS_IN_DAY))
- data.push({"7day total": 0, "7day acceptable": 0, "30day total": 0, "30day acceptable": 0});
+ data.push({"1day total": 0, "1day acceptable": 0, "7day total": 0, "7day acceptable": 0, "30day total": 0, "30day acceptable": 0});
var offset = -30;
var callback = function()
{
offset++;
if (offset >= data.length)
{
showResults(fromDate, data);
@@ -233,16 +238,17 @@
</form>
</p>
<p id="wait" hidden>
Please wait, data is being fetched...
</p>
<table id="result" hidden>
<tr>
<th rowspan="2">Date</th>
+ <th colspan="3">1-day active users</th>
<th colspan="3">7-day active users</th>
<th colspan="3">30-day active users</th>
</tr>
<tr>
<th>Total</th>
<th>Acceptable ads</th>
<th>Opt-out rate</th>
<th>Total</th>
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld