Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Giehl <stefan@piwik.org>2018-04-23 07:00:49 +0300
committerMatthieu Aubry <mattab@users.noreply.github.com>2018-04-23 07:00:49 +0300
commit2cdedac6792c99a4652016b513ee597e24868d9b (patch)
treeabafef158505e2fe1ed97ff1abfc78cc1580ee3e /plugins/UserCountryMap
parent72224c194e6f138ddf0ea25c5005c12420beb396 (diff)
Faster Real Time Maps (#12752)
* do not use min timestamp for realtime map queries if not needed * remove some unused code * Plot only the last 7 days rather than last 30 days
Diffstat (limited to 'plugins/UserCountryMap')
-rw-r--r--plugins/UserCountryMap/Controller.php4
-rw-r--r--plugins/UserCountryMap/javascripts/realtime-map.js17
2 files changed, 7 insertions, 14 deletions
diff --git a/plugins/UserCountryMap/Controller.php b/plugins/UserCountryMap/Controller.php
index 7f291a8b15..d89974649a 100644
--- a/plugins/UserCountryMap/Controller.php
+++ b/plugins/UserCountryMap/Controller.php
@@ -26,8 +26,8 @@ require_once PIWIK_INCLUDE_PATH . '/plugins/UserCountry/functions.php';
*/
class Controller extends \Piwik\Plugin\Controller
{
- // By default plot up to the last 30 days of visitors on the map, for low traffic sites
- const REAL_TIME_WINDOW = 'last30';
+ // By default plot up to the last 7 days of visitors on the map, for low traffic sites
+ const REAL_TIME_WINDOW = 'last7';
/**
* @var Translator
diff --git a/plugins/UserCountryMap/javascripts/realtime-map.js b/plugins/UserCountryMap/javascripts/realtime-map.js
index 8e1240228c..09396e9bba 100644
--- a/plugins/UserCountryMap/javascripts/realtime-map.js
+++ b/plugins/UserCountryMap/javascripts/realtime-map.js
@@ -1,10 +1,10 @@
/*!
- * Piwik - free/libre analytics platform
+ * Matomo - free/libre analytics platform
*
* Real time visitors map
* Using Kartograph.js http://kartograph.org/
*
- * @link http://piwik.org
+ * @link https://matomo.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
@@ -67,28 +67,23 @@
if (clickedMenuIsNotMap) {
$('#periodString').show();
initTopControls();
- };
+ }
});
$('.realTimeMap_overlay').css('top', '0px');
$('.realTimeMap_datetime').css('top', '20px');
},
run: function () {
- var debug = 0;
-
var self = this,
config = self.config,
_ = config._,
map = self.map,
- main = $('.RealTimeMap_container', this.$element),
- worldTotalVisits = 0,
maxVisits = config.maxVisits || 100,
changeVisitAlpha = typeof config.changeVisitAlpha === 'undefined' ? true : config.changeVisitAlpha,
removeOldVisits = typeof config.removeOldVisits === 'undefined' ? true : config.removeOldVisits,
doNotRefreshVisits = typeof config.doNotRefreshVisits === 'undefined' ? false : config.doNotRefreshVisits,
enableAnimation = typeof config.enableAnimation === 'undefined' ? true : config.enableAnimation,
forceNowValue = typeof config.forceNowValue === 'undefined' ? false : +config.forceNowValue,
- width = main.width(),
lastTimestamp = -1,
lastVisits = [],
visitSymbols,
@@ -148,7 +143,7 @@
'referrerTypeName', 'browserIcon', 'operatingSystemIcon',
'countryFlag', 'idVisit', 'actionDetails', 'continentCode',
'actions', 'searches', 'goalConversions', 'visitorId', 'userId'].join(','),
- minTimestamp: firstRun ? -1 : lastTimestamp
+ minTimestamp: firstRun ? 0 : lastTimestamp
});
}
@@ -347,7 +342,7 @@
/*
* this function requests new data from Live.getLastVisitsDetails
* and updates the symbols on the map. Then, it sets a timeout
- * to call itself after the refresh time set by Piwik
+ * to call itself after the refresh time set by Matomo
*
* If firstRun is true, the SymbolGroup is initialized
*/
@@ -527,8 +522,6 @@
}
});
}
- var lastVisitId = -1,
- lastReport = [];
refreshVisits(true);
}