Adding data intra-day.
This commit is contained in:
parent
ae8415758b
commit
6214205a56
|
@ -104,6 +104,22 @@ EOF
|
|||
my $dbh = BurguillosInfo::DB->connect($app);
|
||||
my $data = $dbh->selectall_arrayref(<<"EOF", {Slice => {}});
|
||||
SELECT paths.path,
|
||||
(
|
||||
$SELECT_GLOBAL
|
||||
where requests.path = paths.path and date > NOW() - interval '1 hour'
|
||||
) as unique_ips_last_1_hour,
|
||||
(
|
||||
$SELECT_GLOBAL
|
||||
where requests.path = paths.path and date > NOW() - interval '3 hour'
|
||||
) as unique_ips_last_3_hours,
|
||||
(
|
||||
$SELECT_GLOBAL
|
||||
where requests.path = paths.path and date > NOW() - interval '6 hour'
|
||||
) as unique_ips_last_6_hours,
|
||||
(
|
||||
$SELECT_GLOBAL
|
||||
where requests.path = paths.path and date > NOW() - interval '12 hour'
|
||||
) as unique_ips_last_12_hours,
|
||||
(
|
||||
$SELECT_GLOBAL
|
||||
where requests.path = paths.path and date > NOW() - interval '1 day'
|
||||
|
|
|
@ -11,6 +11,10 @@
|
|||
<table>
|
||||
<tr>
|
||||
<th>Path</th>
|
||||
<th data-sort-method="number">Visitors 1h</th>
|
||||
<th data-sort-method="number">Visitors 3h</th>
|
||||
<th data-sort-method="number">Visitors 6h</th>
|
||||
<th data-sort-method="number">Visitors 12h</th>
|
||||
<th data-sort-method="number">Visitors 24h</th>
|
||||
<th data-sort-method="number">Visitors week</th>
|
||||
<th data-sort-method="number">Visitors month</th>
|
||||
|
@ -18,6 +22,10 @@
|
|||
% for my $row (@$tracking_by_url) {
|
||||
<tr>
|
||||
<td><%="${base_url}$row->{path}"%></td>
|
||||
<td><%=$row->{unique_ips_last_1_hour}%></td>
|
||||
<td><%=$row->{unique_ips_last_3_hours}%></td>
|
||||
<td><%=$row->{unique_ips_last_6_hours}%></td>
|
||||
<td><%=$row->{unique_ips_last_12_hours}%></td>
|
||||
<td><%=$row->{unique_ips_last_24_hours}%></td>
|
||||
<td><%=$row->{unique_ips_last_week}%></td>
|
||||
<td><%=$row->{unique_ips_last_month}%></td>
|
||||
|
|
Loading…
Reference in New Issue