Skip to content

Commit

Permalink
Refs #3632 Adding more tests cases for log replay functionnality
Browse files Browse the repository at this point in the history
Forcing all recorders and recorders max payload to 1, to prevent random behavior (eg. in Live.getLastVisitsDetails, the pageIdAction may be random order if recorders import data in random thread order)
  • Loading branch information
mattab committed Mar 13, 2014
1 parent face332 commit 73f3346
Show file tree
Hide file tree
Showing 68 changed files with 4,370 additions and 637 deletions.
10 changes: 5 additions & 5 deletions tests/PHPUnit/Fixtures/ManySitesImportedLogs.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ private function logVisitsWithStaticResolver()
// automatically if needed
$opts = array('--idsite' => $this->idSite,
'--enable-testmode' => false,
'--recorders' => '4',
'--recorder-max-payload-size' => '2');
'--recorders' => '1',
'--recorder-max-payload-size' => '1');

self::executeLogImporter($logFile, $opts);
}
Expand All @@ -147,7 +147,7 @@ public function logVisitsWithDynamicResolver()
// automatically if needed
$opts = array('--add-sites-new-hosts' => false,
'--enable-testmode' => false,
'--recorders' => '4',
'--recorders' => '1',
'--recorder-max-payload-size' => '1');
self::executeLogImporter($logFile, $opts);
}
Expand All @@ -163,7 +163,7 @@ private function logVisitsWithAllEnabled()
$opts = array('--idsite' => $this->idSite,
'--token-auth' => self::getTokenAuth(),
'--recorders' => '1',
'--recorder-max-payload-size' => '2',
'--recorder-max-payload-size' => '1',
'--enable-static' => false,
'--enable-bots' => false,
'--enable-http-errors' => false,
Expand All @@ -184,7 +184,7 @@ private function replayLogFile()

$opts = array('--token-auth' => self::getTokenAuth(),
'--recorders' => '1',
'--recorder-max-payload-size' => '2',
'--recorder-max-payload-size' => '1',
'--replay-tracking' => false);

self::executeLogImporter($logFile, $opts);
Expand Down
8 changes: 8 additions & 0 deletions tests/PHPUnit/Integration/ImportLogsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@ public function getApiForTesting()
'date' => '2012-08-09',
'periods' => 'month')),

array('Live.getLastVisitsDetails', array(
'idSite' => self::$fixture->idSite,
'date' => '2012-08-09',
'periods' => 'month',
'otherRequestParameters' => array(
'filter_limit' => 1000
))),

array('MultiSites.getAll', array('idSite' => self::$fixture->idSite,
'date' => '2012-08-09',
'periods' => array('month'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,23 @@
</row>
</subtable>
</row>
<row>
<label>builds.piwik.org</label>
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
<exit_nb_visits>1</exit_nb_visits>
<subtable>
<row>
<label>/latest.zip</label>
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
<exit_nb_visits>1</exit_nb_visits>
<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
<sum_daily_exit_nb_uniq_visitors>1</sum_daily_exit_nb_uniq_visitors>
<url>http://builds.piwik.org/latest.zip</url>
</row>
</subtable>
</row>
</result>
Original file line number Diff line number Diff line change
@@ -1,23 +1,72 @@
<?xml version="1.0" encoding="utf-8" ?>
<result>
<row>
<label> Liberate Web Analytics - Analytics - Piwik</label>
<nb_visits>4</nb_visits>
<nb_hits>4</nb_hits>
<sum_time_spent>40</sum_time_spent>
<nb_hits_with_time_generation>3</nb_hits_with_time_generation>
<min_time_generation>0.058</min_time_generation>
<max_time_generation>0.292</max_time_generation>
<entry_nb_visits>4</entry_nb_visits>
<entry_nb_actions>8</entry_nb_actions>
<entry_sum_visit_length>51</entry_sum_visit_length>
<entry_bounce_count>1</entry_bounce_count>
<exit_nb_visits>2</exit_nb_visits>
<sum_daily_nb_uniq_visitors>4</sum_daily_nb_uniq_visitors>
<sum_daily_entry_nb_uniq_visitors>4</sum_daily_entry_nb_uniq_visitors>
<sum_daily_exit_nb_uniq_visitors>2</sum_daily_exit_nb_uniq_visitors>
<avg_time_on_page>10</avg_time_on_page>
<bounce_rate>25%</bounce_rate>
<exit_rate>50%</exit_rate>
<avg_time_generation>0.177</avg_time_generation>
</row>
<row>
<label> Log Analytics - Analytics - Piwik</label>
<nb_visits>2</nb_visits>
<nb_hits>2</nb_hits>
<sum_time_spent>0</sum_time_spent>
<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
<min_time_generation>0.145</min_time_generation>
<max_time_generation>0.145</max_time_generation>
<entry_nb_visits>2</entry_nb_visits>
<entry_nb_actions>2</entry_nb_actions>
<entry_sum_visit_length>0</entry_sum_visit_length>
<entry_bounce_count>2</entry_bounce_count>
<exit_nb_visits>2</exit_nb_visits>
<sum_daily_nb_uniq_visitors>2</sum_daily_nb_uniq_visitors>
<sum_daily_entry_nb_uniq_visitors>2</sum_daily_entry_nb_uniq_visitors>
<sum_daily_exit_nb_uniq_visitors>2</sum_daily_exit_nb_uniq_visitors>
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
<exit_rate>100%</exit_rate>
<avg_time_generation>0.145</avg_time_generation>
</row>
<row>
<label>301</label>
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>180</sum_time_spent>
<nb_hits_with_time_generation>0</nb_hits_with_time_generation>
<min_time_generation />
<max_time_generation>0</max_time_generation>
<entry_nb_visits>1</entry_nb_visits>
<entry_nb_actions>2</entry_nb_actions>
<entry_sum_visit_length>182</entry_sum_visit_length>
<entry_bounce_count>0</entry_bounce_count>
<avg_time_on_page>180</avg_time_on_page>
<bounce_rate>0%</bounce_rate>
<exit_rate>0%</exit_rate>
<avg_time_generation>0</avg_time_generation>
<subtable>
<row>
<label> URL = http://piwik.net/moved-permanently</label>
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>180</sum_time_spent>
<nb_hits_with_time_generation>0</nb_hits_with_time_generation>
<min_time_generation />
<max_time_generation />
<entry_nb_visits>1</entry_nb_visits>
<entry_nb_actions>2</entry_nb_actions>
<entry_sum_visit_length>182</entry_sum_visit_length>
Expand All @@ -27,6 +76,7 @@
<avg_time_on_page>180</avg_time_on_page>
<bounce_rate>0%</bounce_rate>
<exit_rate>0%</exit_rate>
<avg_time_generation>0</avg_time_generation>
</row>
</subtable>
</row>
Expand All @@ -35,6 +85,9 @@
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
<nb_hits_with_time_generation>0</nb_hits_with_time_generation>
<min_time_generation />
<max_time_generation>0</max_time_generation>
<entry_nb_visits>1</entry_nb_visits>
<entry_nb_actions>1</entry_nb_actions>
<entry_sum_visit_length>0</entry_sum_visit_length>
Expand All @@ -43,12 +96,16 @@
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
<exit_rate>100%</exit_rate>
<avg_time_generation>0</avg_time_generation>
<subtable>
<row>
<label> URL = http://piwik.net/this/is/not/the/page/i/am/looking/for/</label>
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
<nb_hits_with_time_generation>0</nb_hits_with_time_generation>
<min_time_generation />
<max_time_generation />
<entry_nb_visits>1</entry_nb_visits>
<entry_nb_actions>1</entry_nb_actions>
<entry_sum_visit_length>0</entry_sum_visit_length>
Expand All @@ -60,6 +117,7 @@
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
<exit_rate>100%</exit_rate>
<avg_time_generation>0</avg_time_generation>
</row>
</subtable>
</row>
Expand All @@ -68,6 +126,9 @@
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
<nb_hits_with_time_generation>0</nb_hits_with_time_generation>
<min_time_generation />
<max_time_generation>0</max_time_generation>
<entry_nb_visits>1</entry_nb_visits>
<entry_nb_actions>1</entry_nb_actions>
<entry_sum_visit_length>0</entry_sum_visit_length>
Expand All @@ -76,12 +137,16 @@
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
<exit_rate>100%</exit_rate>
<avg_time_generation>0</avg_time_generation>
<subtable>
<row>
<label> URL = http://piwik.net/to-an-error</label>
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
<nb_hits_with_time_generation>0</nb_hits_with_time_generation>
<min_time_generation />
<max_time_generation />
<entry_nb_visits>1</entry_nb_visits>
<entry_nb_actions>1</entry_nb_actions>
<entry_sum_visit_length>0</entry_sum_visit_length>
Expand All @@ -93,6 +158,67 @@
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
<exit_rate>100%</exit_rate>
<avg_time_generation>0</avg_time_generation>
</row>
</subtable>
</row>
<row>
<label> Changelog Archive - Analytics - Piwik</label>
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>79</sum_time_spent>
<nb_hits_with_time_generation>0</nb_hits_with_time_generation>
<min_time_generation />
<max_time_generation />
<entry_nb_visits>1</entry_nb_visits>
<entry_nb_actions>2</entry_nb_actions>
<entry_sum_visit_length>81</entry_sum_visit_length>
<entry_bounce_count>0</entry_bounce_count>
<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
<sum_daily_entry_nb_uniq_visitors>1</sum_daily_entry_nb_uniq_visitors>
<avg_time_on_page>79</avg_time_on_page>
<bounce_rate>0%</bounce_rate>
<exit_rate>0%</exit_rate>
<avg_time_generation>0</avg_time_generation>
</row>
<row>
<label>demo.piwik.org</label>
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
<min_time_generation>0.413</min_time_generation>
<max_time_generation>0.413</max_time_generation>
<entry_nb_visits>1</entry_nb_visits>
<entry_nb_actions>1</entry_nb_actions>
<entry_sum_visit_length>0</entry_sum_visit_length>
<entry_bounce_count>1</entry_bounce_count>
<exit_nb_visits>1</exit_nb_visits>
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
<exit_rate>100%</exit_rate>
<avg_time_generation>0.413</avg_time_generation>
<subtable>
<row>
<label> Piwik Forums - Piwik › Web Analytics Reports</label>
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
<min_time_generation>0.413</min_time_generation>
<max_time_generation>0.413</max_time_generation>
<entry_nb_visits>1</entry_nb_visits>
<entry_nb_actions>1</entry_nb_actions>
<entry_sum_visit_length>0</entry_sum_visit_length>
<entry_bounce_count>1</entry_bounce_count>
<exit_nb_visits>1</exit_nb_visits>
<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
<sum_daily_entry_nb_uniq_visitors>1</sum_daily_entry_nb_uniq_visitors>
<sum_daily_exit_nb_uniq_visitors>1</sum_daily_exit_nb_uniq_visitors>
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
<exit_rate>100%</exit_rate>
<avg_time_generation>0.413</avg_time_generation>
</row>
</subtable>
</row>
Expand All @@ -101,6 +227,72 @@
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
<nb_hits_with_time_generation>0</nb_hits_with_time_generation>
<min_time_generation />
<max_time_generation />
<entry_nb_visits>1</entry_nb_visits>
<entry_nb_actions>1</entry_nb_actions>
<entry_sum_visit_length>0</entry_sum_visit_length>
<entry_bounce_count>1</entry_bounce_count>
<exit_nb_visits>1</exit_nb_visits>
<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
<sum_daily_entry_nb_uniq_visitors>1</sum_daily_entry_nb_uniq_visitors>
<sum_daily_exit_nb_uniq_visitors>1</sum_daily_exit_nb_uniq_visitors>
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
<exit_rate>100%</exit_rate>
<avg_time_generation>0</avg_time_generation>
</row>
<row>
<label> Installing Piwik - Analytics - Piwik</label>
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
<min_time_generation>0.134</min_time_generation>
<max_time_generation>0.134</max_time_generation>
<entry_nb_visits>1</entry_nb_visits>
<entry_nb_actions>1</entry_nb_actions>
<entry_sum_visit_length>0</entry_sum_visit_length>
<entry_bounce_count>1</entry_bounce_count>
<exit_nb_visits>1</exit_nb_visits>
<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
<sum_daily_entry_nb_uniq_visitors>1</sum_daily_entry_nb_uniq_visitors>
<sum_daily_exit_nb_uniq_visitors>1</sum_daily_exit_nb_uniq_visitors>
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
<exit_rate>100%</exit_rate>
<avg_time_generation>0.134</avg_time_generation>
</row>
<row>
<label> Integrate Piwik into your Rails Application - Analytics - Piwik</label>
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
<min_time_generation>0.391</min_time_generation>
<max_time_generation>0.391</max_time_generation>
<entry_nb_visits>1</entry_nb_visits>
<entry_nb_actions>1</entry_nb_actions>
<entry_sum_visit_length>0</entry_sum_visit_length>
<entry_bounce_count>1</entry_bounce_count>
<exit_nb_visits>1</exit_nb_visits>
<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
<sum_daily_entry_nb_uniq_visitors>1</sum_daily_entry_nb_uniq_visitors>
<sum_daily_exit_nb_uniq_visitors>1</sum_daily_exit_nb_uniq_visitors>
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
<exit_rate>100%</exit_rate>
<avg_time_generation>0.391</avg_time_generation>
</row>
<row>
<label> Piwik 2.1 — Massive Performance and Reliability Improvements - Analytics - Piwik</label>
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
<min_time_generation>0.119</min_time_generation>
<max_time_generation>0.119</max_time_generation>
<entry_nb_visits>1</entry_nb_visits>
<entry_nb_actions>1</entry_nb_actions>
<entry_sum_visit_length>0</entry_sum_visit_length>
Expand All @@ -112,12 +304,16 @@
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
<exit_rate>100%</exit_rate>
<avg_time_generation>0.119</avg_time_generation>
</row>
<row>
<label> Piwik Forums</label>
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
<nb_hits_with_time_generation>0</nb_hits_with_time_generation>
<min_time_generation />
<max_time_generation />
<entry_nb_visits>1</entry_nb_visits>
<entry_nb_actions>1</entry_nb_actions>
<entry_sum_visit_length>0</entry_sum_visit_length>
Expand All @@ -129,5 +325,6 @@
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
<exit_rate>100%</exit_rate>
<avg_time_generation>0</avg_time_generation>
</row>
</result>
Loading

0 comments on commit 73f3346

Please sign in to comment.