To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

Commit a05ab572 authored by Reto Da Forno's avatar Reto Da Forno

update to stats collection

parent f9d2d80c
...@@ -17,11 +17,11 @@ ...@@ -17,11 +17,11 @@
$statsfilename = "statistics.dat"; $statsfilename = "statistics.dat";
$stats = parse_ini_file($statsfilename); $stats = parse_ini_file($statsfilename);
// autorefresh stats after a certain amount of time // autorefresh stats after a certain amount of time -> now handled via Cron
include('update_stats.php'); /*include('update_stats.php');
if (!file_exists($statsfilename) || (time() - $stats['last_update']) > (3600*24*14)) { // update once a fortnight if (!file_exists($statsfilename) || (time() - $stats['last_update']) > (3600*24*14)) { // update once a fortnight
collect_stats($statsfilename); collect_stats($statsfilename);
} }*/
function create_pie_chart($elem_id, $data_array) { function create_pie_chart($elem_id, $data_array) {
echo "var myChart = new Chart(document.getElementById(\"$elem_id\"), { echo "var myChart = new Chart(document.getElementById(\"$elem_id\"), {
...@@ -200,4 +200,4 @@ ...@@ -200,4 +200,4 @@
--> -->
<?php <?php
do_layout('Statistics','Statistics'); do_layout('Statistics','Statistics');
?> ?>
\ No newline at end of file
...@@ -8,8 +8,16 @@ ...@@ -8,8 +8,16 @@
*/ */
?> ?>
<?php <?php
set_include_path(get_include_path() . PATH_SEPARATOR . "/home/flocklab/public_html/user");
require_once('include/libflocklab.php'); require_once('include/libflocklab.php');
if (!set_time_limit(120)) {
die("unable to set max. execution time");
}
$statsFileName = "/home/flocklab/public_html/user/statistics.dat";
function collect_stats($filename) function collect_stats($filename)
{ {
...@@ -294,4 +302,6 @@ powerprofusers_per_year = \"".str_replace('"', '\'', serialize($powerprofusers_p ...@@ -294,4 +302,6 @@ powerprofusers_per_year = \"".str_replace('"', '\'', serialize($powerprofusers_p
// write the stats into the file // write the stats into the file
file_put_contents($filename, $new_stats); file_put_contents($filename, $new_stats);
} }
?>
\ No newline at end of file collect_stats($statsFileName);
?>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment