Skip to content
GitLab
Explorer
Connexion
S'inscrire
Navigation principale
Rechercher ou aller à…
Projet
S
stats-facil
Gestion
Activité
Membres
Labels
Programmation
Tickets
Tableaux des tickets
Jalons
Wiki
Code
Requêtes de fusion
Dépôt
Branches
Validations
Étiquettes
Graphe du dépôt
Comparer les révisions
Extraits de code
Compilation
Pipelines
Jobs
Planifications de pipeline
Artéfacts
Déploiement
Releases
Registre de paquets
Registre de conteneurs
Registre de modèles
Opération
Environnements
Modules Terraform
Surveillance
Incidents
Analyse
Données d'analyse des chaînes de valeur
Analyse des contributeurs
Données d'analyse CI/CD
Données d'analyse du dépôt
Expériences du modèle
Aide
Aide
Support
Documentation de GitLab
Comparer les forfaits GitLab
Forum de la communauté
Contribuer à GitLab
Donner votre avis
Raccourcis clavier
?
Extraits de code
Groupes
Projets
Afficher davantage de fils d'Ariane
facil
stats-facil
Validations
0cb0472b
Valider
0cb0472b
rédigé
11 years ago
par
diosmosis
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
Refs #4200 started documenting LogAggregator and documented Plugin/API.
parent
fdb2cbaa
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Modifications
2
Masquer les modifications d'espaces
En ligne
Côte à côte
Affichage de
2 fichiers modifiés
core/DataAccess/LogAggregator.php
+37
-18
37 ajouts, 18 suppressions
core/DataAccess/LogAggregator.php
core/Plugin/API.php
+21
-1
21 ajouts, 1 suppression
core/Plugin/API.php
avec
58 ajouts
et
19 suppressions
core/DataAccess/LogAggregator.php
+
37
−
18
Voir le fichier @
0cb0472b
...
@@ -21,8 +21,14 @@ use Piwik\Site;
...
@@ -21,8 +21,14 @@ use Piwik\Site;
use
Piwik\Tracker\GoalManager
;
use
Piwik\Tracker\GoalManager
;
/**
/**
* This class queries the Visitor logs tables (visits, actions, conversions, ecommerce)
* Contains methods that aggregates log data (visits, actions, conversions, ecommerce).
* and returns aggregate data.
*
* Plugin [Archiver](#) descendants can use the methods in this class to aggregate data
* in the log tables without creating their own SQL queries.
*
* ### Examples
*
* ** TODO **
*/
*/
class
LogAggregator
class
LogAggregator
{
{
...
@@ -126,22 +132,36 @@ class LogAggregator
...
@@ -126,22 +132,36 @@ class LogAggregator
}
}
/**
/**
* Quer
y
visit
s
logs by dimension
,
and return the aggregate data.
* Quer
ies
visit logs by dimension and return
s
the aggregate data.
*
*
* @param array|string $dimensions Can be a string, eg. "referrer_name", will be aliased as 'label' in the returned rows
* @param array|string $dimensions SELECT fields (or just one field) that will be grouped by,
* Can also be an array of strings, when the dimension spans multiple fields,
* eg, `'referrer_name'` or `array('referrer_name', 'referrer_keyword')`.
* eg. array("referrer_name", "referrer_keyword")
* The metrics retrieved from the query will be specific to combinations
* @param bool|string $where Additional condition for WHERE clause
* of these fields. So if `array('referrer_name', 'referrer_keyword')`
* @param array $additionalSelects Additional SELECT clause
* is supplied, the query will select the visits for each referrer/keyword
* @param bool|array $metrics Set this if you want to limit the columns that are returned.
* combination.
* The possible values in the array are Metrics::INDEX_*.
* @param bool|string $where Additional condition for the WHERE clause. Can be used to filter
* the set of visits that are looked at.
* @param array $additionalSelects Additional SELECT fields that are not included in the group by
* clause. These can be aggregate expressions, eg, `SUM(somecol)`.
* @param bool|array $metrics The set of metrics to return. If false, the query will select all of them.
* The following values can be used:
* - Metrics::INDEX_NB_UNIQ_VISITORS
* - Metrics::INDEX_NB_VISITS
* - Metrics::INDEX_NB_ACTIONS
* - Metrics::INDEX_MAX_ACTIONS
* - Metrics::INDEX_SUM_VISIT_LENGTH
* - Metrics::INDEX_BOUNCE_COUNT
* - Metrics::INDEX_NB_VISITS_CONVERTED
* @param bool|\Piwik\RankingQuery $rankingQuery
* @param bool|\Piwik\RankingQuery $rankingQuery
* A pre-configured ranking query instance that is used to limit the result.
* A pre-configured ranking query instance that will be used to limit the result.
* If set, the return value is the array returned by RankingQuery::execute().
* If set, the return value is the array returned by [RankingQuery::execute()](#).
*
* @return mixed A Zend_Db_Statement if `$rankingQuery` isn't supplied, otherwise the result of
* @return mixed
* [RankingQuery::execute()](#).
* @api
*/
*/
public
function
queryVisitsByDimension
(
array
$dimensions
=
array
(),
$where
=
false
,
array
$additionalSelects
=
array
(),
$metrics
=
false
,
$rankingQuery
=
false
)
public
function
queryVisitsByDimension
(
array
$dimensions
=
array
(),
$where
=
false
,
array
$additionalSelects
=
array
(),
$metrics
=
false
,
$rankingQuery
=
false
)
{
{
$tableName
=
self
::
LOG_VISIT_TABLE
;
$tableName
=
self
::
LOG_VISIT_TABLE
;
$availableMetrics
=
$this
->
getVisitsMetricFields
();
$availableMetrics
=
$this
->
getVisitsMetricFields
();
...
@@ -314,7 +334,7 @@ class LogAggregator
...
@@ -314,7 +334,7 @@ class LogAggregator
}
}
/**
/**
*
Returns the
ecommerce items
*
Queries all
ecommerce items
.
*
*
* @param string $field
* @param string $field
* @return string
* @return string
...
@@ -342,8 +362,7 @@ class LogAggregator
...
@@ -342,8 +362,7 @@ class LogAggregator
// $query = $this->query($select, $from, $where, $groupBy, $orderBy);
// $query = $this->query($select, $from, $where, $groupBy, $orderBy);
$bind
=
$this
->
getBindDatetimeSite
();
$bind
=
$this
->
getBindDatetimeSite
();
$query
=
$this
->
getDb
()
->
query
(
$query
,
$bind
);
return
$this
->
getDb
()
->
query
(
$query
,
$bind
);
return
$query
;
}
}
/**
/**
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
core/Plugin/API.php
+
21
−
1
Voir le fichier @
0cb0472b
...
@@ -13,7 +13,27 @@ namespace Piwik\Plugin;
...
@@ -13,7 +13,27 @@ namespace Piwik\Plugin;
use
Piwik\Singleton
;
use
Piwik\Singleton
;
/**
* The base class of all API singletons.
*
* Plugins that want to expose functionality through an API should create a class
* that derives from this one. Every public method in that class will be callable
* through Piwik's API.
*
* ### Example
*
* class MyAPI extends API
* {
* public function myMethod($idSite, $period, $date, $segment = false)
* {
* $dataTable = // ... get some data ...
* return $dataTable;
* }
* }
*
* @api
*/
abstract
class
API
extends
Singleton
abstract
class
API
extends
Singleton
{
{
}
}
\ No newline at end of file
Ce diff est replié.
Cliquez pour l'agrandir.
Aperçu
0%
Chargement en cours
Veuillez réessayer
ou
joindre un nouveau fichier
.
Annuler
You are about to add
0
people
to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Enregistrer le commentaire
Annuler
Veuillez vous
inscrire
ou vous
se connecter
pour commenter