commit | 146985106891ed76fce533d3233547df43a8ede9 | [log] [tgz] |
---|---|---|
author | Fabio Ponciroli <ponch78@gmail.com> | Sat Dec 30 00:31:37 2017 +0000 |
committer | Luca Milanesio <luca.milanesio@gmail.com> | Fri Jan 05 08:42:54 2018 +0000 |
tree | 608989ecf207794e81d3c9fafb65c45a26a6e442 | |
parent | 0e3c15d649b005aa818b21c8321c1b54189a8d2f [diff] |
Remove TLD from organisation extracted from email Keeping the Top-Level domain in the organisation might lead to a wrong organisation aggregation. For example both smith@company.com and smith@company.co.uk should have 'company' as organisation. Change-Id: Icb9c0bfe928dfcbf02d79d30fd9e2fbd54975159
Spark ETL to extra analytics data from Gerrit Projects.
Job can be launched with the following parameters:
bin/spark-submit \ --conf spark.es.nodes=es.mycompany.com \ $JARS/SparkAnalytics-assembly-1.0.jar \ --since 2000-06-01 \ --aggregate email_hour \ --url http://gerrit.mycompany.com \ -e gerrit/analytics
Should ElasticSearch need authentication (i.e.: if X-Pack is enabled), credentials can be passed through the spark.es.net.http.auth.pass and spark.es.net.http.auth.user parameters.
since, until, aggregate are the same defined in Gerrit Analytics plugin see: https://gerrit.googlesource.com/plugins/analytics/+/master/README.md
-u --url Gerrit server URL with the analytics plugins installed
-p --prefix (optional) Projects prefix. Limit the results to those projects that start with the specified prefix.
-e --elasticIndex specify as / to be loaded in Elastic Search if not provided no ES export will be performed
-o --out folder location for storing the output as JSON files if not provided data is saved to /analytics- where is the system temporary directory
-a --email-aliases (optional) “emails to author alias” input data path.
CSVs with 3 columns are expected in input.
Here an example of the required files structure:
author,email,organization John Smith,john@email.com,John's Company John Smith,john@anotheremail.com,John's Company David Smith,david.smith@email.com,Indipendent David Smith,david@myemail.com,Indipendent
You can use the following command to quickly extract the list of authors and emails to create part of an input CSV file:
echo -e "author,email\n$(git log --pretty="%an,%ae%n%cn,%ce"|sort |uniq )" > /tmp/my_aliases.csv
Once you have it, you just have to add the organization column.
NOTE:
A docker compose file is provided to spin up an instance of Elastisearch with Kibana locally. Just run docker-compose up
.
Kibana will run on port 5601
and Elastisearch on port 9200
If Elastisearch dies with exit code 137
you might have to give Docker more memory (check this article for more details)