Opened 4 years ago

Closed 4 years ago

#1319 closed Bug (fixed)

Visitor Log always shows all data

Reported by: Beatgarantie Owned by: peterb
Priority: low Milestone: Piwik 0.8 - A Web Analytics platform
Component: UI - UX (AngularJS, twig, less) Keywords:
Cc: Sensitive: no

Description

I have discovered that the "visitor log" always shows the whole data. E.g. 30 April is selected but the table also shows data from 29 April and so on...
This behavior makes the "visitor log" very slow.

Attachments (4)

live.patch (1.8 KB) - added by JulienM 4 years ago.
#1319.patch (3.6 KB) - added by JulienM 4 years ago.
piwik-dev2 (#1319).patch (3.5 KB) - added by JulienM 4 years ago.
LivePluginApiApplyDateRange.patch (4.9 KB) - added by peterb 4 years ago.
Can't we keep it simple with getting the date / period in the given method? Then we'll not make the Plugin even more complicated; Patch running without bugs in my local repository

Download all attachments as: .zip

Change History (17)

comment:1 Changed 4 years ago by JulienM (JulienMoumne)

I have added a patch to solve the issue.

Do tell me what you think about it.

Changed 4 years ago by JulienM (JulienMoumne)

comment:2 Changed 4 years ago by vipsoft (robocoder)

  • Keywords visitor log removed
  • Owner set to jr-ewing

comment:3 Changed 4 years ago by matt (mattab)

looks good to me - did you test the patch with more than 1000 visits in one day? does the visitor log load faster with the patch? (visits generator can be found in misc/generateVisits.php)

comment:4 Changed 4 years ago by JulienM (JulienMoumne)

After testing with a lot of data, there is a cap at 1000 visits (both before and after suggested patch).

You will see improvement if you select a day period with less than 1000 visits.

comment:5 Changed 4 years ago by matt (mattab)

Core review: The private method loadLastVisitorDetailsFromDatabase() signature has changed (added $period parameter) but there are other calls to this method that haven't been updated to add the new $period parameter.

comment:6 Changed 4 years ago by JulienM (JulienMoumne)

I have updated and tested required methods.

If you look at /plugins/Live/Controller.php there is an API call to method 'getLastVisits'. Method 'getLastVisits' has been updated to add $period and $date parameters.

I didn't know if the call at lign 133 had to be updated as well to provide period and date values. I tried to leave it as it is and also tried to provide the values. In both cases the values for period and date are provided to the API method 'getLastVisits'.

This is why I didn't update the API call.

Please advise on this matter.

Changed 4 years ago by JulienM (JulienMoumne)

comment:7 Changed 4 years ago by matt (mattab)

Call at line 133 builds a Piwik_Api_Request object, which will look into _GET for parameters not passed in the constructor string so this is OK.

comment:8 Changed 4 years ago by matt (mattab)

sorry for delay,
I applied the patch but It breaks the Live! visitors plugin (not on first load, but after few seconds and reload).

maybe some API calls haven't passed new parameters?

comment:9 Changed 4 years ago by matt (mattab)

  • Owner changed from jr-ewing to JulienM

comment:10 Changed 4 years ago by JulienM (JulienMoumne)

My mistake.

When the API call is made with the jQuery spy plugin, no Date and no Period is provided to the call. The jQuery spy plugin receives the error "period parameter not provided" and breaks the widget.

I just had to specify that those parameters (date and period) are mendatory. Cf. new patch.

comment:11 Changed 4 years ago by JulienM (JulienMoumne)

I meant "not mandatory".

Changed 4 years ago by peterb (peterbo)

Can't we keep it simple with getting the date / period in the given method? Then we'll not make the Plugin even more complicated; Patch running without bugs in my local repository

comment:12 Changed 4 years ago by peterb (peterbo)

  • Owner changed from JulienM to peterb

comment:13 Changed 4 years ago by peterb (peterbo)

  • Resolution set to fixed
  • Status changed from new to closed

(In [2784]) fixes #1375, #1319

Note: See TracTickets for help on using tickets.