Gerrit Analytics applied to Android source code

Luca Milanesio
Luca MilanesioDirector at GerritForge Ltd
0
Gerrit User Summit 2019 – GerritForge Inc. – Sunnyvale CA GerritForge.com 0
Gerrit Code Analytics
for the Android OpenSource Project
Luca Milanesio
Gerrit Code Review Maintainer
GerritForge
1
Gerrit User Summit 2019 – GerritForge Inc. – Sunnyvale CA GerritForge.com 1
About GerritForge
Founded in
the UK
HQ in
London
Committed to
OpenSource
+ Sunnyvale
CA
2
Gerrit User Summit 2019 – GerritForge Inc. – Sunnyvale CA GerritForge.com 2
Gerrit DevOps Analytics
§ There’s a lot value in your DevOps
pipeline
§ Information collected from Git, Jenkins,
Jira, you name it
§ Discover and publish meaningful KPI to
make intelligent decisions about
§ People
§ Projects
§ Infrastructure
§ Lower the Risk of a software release
leveraging insights on historical data
3
Gerrit User Summit 2019 – GerritForge Inc. – Sunnyvale CA GerritForge.com 3
Continuous Delivery
Analytics Dimensions
People Reviews Projects Commits System Metrics
4
Gerrit User Summit 2019 – GerritForge Inc. – Sunnyvale CA GerritForge.com 4
BigData to the rescue
§ Collect all review events
§ Collect all logs
§ Channel them to a central store
§ Crunch and Crunch continuously
§ Never delete
§ Process, inspect and learn
5
Gerrit User Summit 2019 – GerritForge Inc. – Sunnyvale CA GerritForge.com 5
GDA Components
The main components of GDA are:
§ GDA Event Collector (Plugin)
This allows for data to be extracted, anonymized
and sent over to the next phase.
§ GDA ELT Engine
This is hosted in the cloud by GerritForge or on-
premises and functions as data mart and
processing for all development related data
§ GDA Dashboard(s)
These are provided by GF according to the
customer needs. Some dashboards are already
available (for people and projects). Others will
be built on purpose.
6
Gerrit User Summit 2019 – GerritForge Inc. – Sunnyvale CA GerritForge.com 6
Android OpenSource Project use-case
Issue 10597: AOSP Gerrit stats page
Reported by zoran.jovanovic@sony.com on Wed, Mar 13, 2019,
9:02 AM PDT
AOSP repository and its Gerrit Code Review are a treasure trove of
data.
There are some very interesting and useful stats that could be
presented
to the users. The stats would help in giving recognition for the
contributors and reviewers alike, thus raising the motiviation of
contributors, it would provide an easy access to the long and rich
history of AOSP project etc.
7
Gerrit User Summit 2019 – GerritForge Inc. – Sunnyvale CA GerritForge.com 7
The problems to be resolved
P1: How to mirror the AOSP repositories in a
systematic way?
P2: How to scale up the current Gerrit analytics
plugin + ETL?
P3: How to parse foreign Gerrit note-db data?
8
Gerrit User Summit 2019 – GerritForge Inc. – Sunnyvale CA GerritForge.com 8
Problem 1: AOSP repositories replication
Gerrit has a replication plugin:
• Define replication remotes
• Define push ref-spec
How to pull instead?
Do you replicate the AOSP repos on your
Gerrit?
How do you automate the process?
9
Gerrit User Summit 2019 – GerritForge Inc. – Sunnyvale CA GerritForge.com 9
Problem 1 solved: pull-replication plugin
10
Gerrit User Summit 2019 – GerritForge Inc. – Sunnyvale CA GerritForge.com 10
Challenges with pull-replication plugin
1. Why not extending the replication plugin?
• replication.config already defines replication remotes
• Can the push logic be extended?
2. Why not developing a brand-new plugin?
• Copy & paste existing code, keeping the essential?
… or a mix of 1. and 2. ?
11
Gerrit User Summit 2019 – GerritForge Inc. – Sunnyvale CA GerritForge.com 11
Design decisions
Refactoring of replication plugin
• Decouple configuration from remote destination
• Started in April, merged in October (6 months!)
• Introduced unit and integration tests (the firsts in 7 years !)
Reuse of the replication plugin logic in the pull-replication
plugin
• Use replication-plugin as a dependency
• Complete reuse of the configuration and logic associated
12
Gerrit User Summit 2019 – GerritForge Inc. – Sunnyvale CA GerritForge.com 12
pull-replication demo
$GERRIT_SITE/etc/replication.config
[remote "aosp"]
url = https://android.googlesource.com/${name}
fetch = +refs/heads/*:refs/heads/*
fetch = +refs/tags/*:refs/tags/*
projects = platform/system/core
13
Gerrit User Summit 2019 – GerritForge Inc. – Sunnyvale CA GerritForge.com 13
pull-replication demo
ssh localhost pull-replication start --all
==> logs/pull_replication_log <==
[2019-11-16 23:59:22,712] [49829e49] Replication from
https://android.googlesource.com/platform/system/core started...
[2019-11-16 23:59:22,753] [49829e49] Fetch references
[+refs/heads/*:refs/heads/*, +refs/tags/*:refs/tags/*] from
https://android.googlesource.com/platform/system/core
[2019-11-16 23:59:25,243] [49829e49] Replication from
https://android.googlesource.com/platform/system/core completed in 2530ms,
15012ms delay, 0 retries
14
Gerrit User Summit 2019 – GerritForge Inc. – Sunnyvale CA GerritForge.com 14
Problem 2: AOSP repositories are BIG
Gerrit analytics plugin slowest
points:
• Processing of branches
• Binary files
• Commits diffs and stats
computation
15
Gerrit User Summit 2019 – GerritForge Inc. – Sunnyvale CA GerritForge.com 15
Problem 2: solved
Gerrit analytics plugin performance
improvements:
• Pre-computation of branches
• Reuse of the Gerrit diff-cache for analytics
• Introduction of the analytics-
commits_statistics_cache
16
Gerrit User Summit 2019 – GerritForge Inc. – Sunnyvale CA GerritForge.com 16
Analytics performance demo
Gerrit cold start (no cache):
$ time curl -v
'http://localhost:8080/projects/platform%2Fsystem%2Fcore/analyt
ics~contributors' | wc –l
1732
curl -v 0.02s user 0.03s system 0% cpu 1:30.60 total
17
Gerrit User Summit 2019 – GerritForge Inc. – Sunnyvale CA GerritForge.com 17
Analytics added cache and performance
$ ssh localhost gerrit show-caches | grep analytics
analytics-commits_statistics_cache| 54011 | 1.6ms | 0% |
$ time curl -v
'http://localhost:8080/projects/platform%2Fsystem%2Fcore/analytics~contributors
' | wc –l
1732
curl -v 0.01s user 0.02s system 2% cpu 1.045 total
90x times faster with commits-stats cache
18
Gerrit User Summit 2019 – GerritForge Inc. – Sunnyvale CA GerritForge.com 18
Analytics bot detection
People or BOTs can be recognized by patter of
commits:
• Detect file type by reg-ex
• Identify commits with BOT-like files only
$GERRIT_SITE/etc/analytics.config:
[contributors]
botlike-filename-regexp = OWNERS
19
Gerrit User Summit 2019 – GerritForge Inc. – Sunnyvale CA GerritForge.com 19
Problem 3: foreign changes processing
Gerrit changes in NoteDb have a Server-ID baked-in
Example:
$ git show refs/changes/00/100000/meta
commit 0014ca6443ac0af338e2677b45e538782bb7a12e (origin/00/100000/meta,
refs/changes/00/100000/meta)
Author: beckysiegel <1030207@173816e5-2b9a-37c3-8a2e-48639d4f1153>
Date: Sat Mar 3 18:38:17 2018 +0000
Update patch set 1
Hashtag added: enhancement
Patch-set: 1
Hashtags: enhancement
Tag: autogenerated:gerrit:setHashtag
20
Gerrit User Summit 2019 – GerritForge Inc. – Sunnyvale CA GerritForge.com 20
Solution: allow parsing of foreign NoteDb
Dec 2018: proposed - 9 months later, rejected and
abandoned
21
Gerrit User Summit 2019 – GerritForge Inc. – Sunnyvale CA GerritForge.com 21
Solution revamped: Dave shows another way
Aug 2019: proposed - 1 month later, merged! (thanks, DavidO)
22
Gerrit User Summit 2019 – GerritForge Inc. – Sunnyvale CA GerritForge.com 22
Analytics deployment on GerritHub
Gerrit master
(review-3)
World
Traffic (R/W)
Gerrit master
(review-4)
HAproxy HAproxy
Gerrit master
(review-1)
Gerrit master
(review-2)
HAproxy HAproxy
Analytics Traffic (R/W)
Multi-site plugin
Multi-site plugin
Multi-site plugin
Multi-site plugin
23
Gerrit User Summit 2019 – GerritForge Inc. – Sunnyvale CA GerritForge.com 23
Analytics next steps
1. Enable pull-replication on review-
{3,4}.gerrithub.io
2. Process AOSP repos contributors analytics
once-a-day
3. Publish commits stats to
analytics.gerrithub.io
4. Enrich with hashtags change data
24
Gerrit User Summit 2019 – GerritForge Inc. – Sunnyvale CA GerritForge.com 24
Poll: have you implemented multi-master/HA?
Image from: http://cypp.rutgers.edu/ru-voting/political-information/public-opinion-polls/
25
Gerrit User Summit 2019 – GerritForge Inc. – Sunnyvale CA GerritForge.com 25
Wants to know more?
GerritForge.com/contact
1 of 26

Recommended

Git flow Introduction by
Git flow IntroductionGit flow Introduction
Git flow IntroductionDavid Paluy
9.4K views15 slides
Git flow for daily use by
Git flow for daily useGit flow for daily use
Git flow for daily useMediacurrent
8K views23 slides
CI-CD Jenkins, GitHub Actions, Tekton by
CI-CD Jenkins, GitHub Actions, Tekton CI-CD Jenkins, GitHub Actions, Tekton
CI-CD Jenkins, GitHub Actions, Tekton Araf Karsh Hamid
1.2K views63 slides
GitHub Actions - using Free Oracle Cloud Infrastructure (OCI) by
GitHub Actions - using Free Oracle Cloud Infrastructure (OCI)GitHub Actions - using Free Oracle Cloud Infrastructure (OCI)
GitHub Actions - using Free Oracle Cloud Infrastructure (OCI)Phil Wilkins
2.2K views39 slides
Why Aren't You Using Git Flow? by
Why Aren't You Using Git Flow?Why Aren't You Using Git Flow?
Why Aren't You Using Git Flow?John Congdon
3.9K views14 slides
CI/CD with GitHub Actions by
CI/CD with GitHub ActionsCI/CD with GitHub Actions
CI/CD with GitHub ActionsSwaminathan Vetri
566 views10 slides

More Related Content

What's hot

Magento 2 Deploy Strategies by
Magento 2 Deploy StrategiesMagento 2 Deploy Strategies
Magento 2 Deploy StrategiesRafael Corrêa Gomes
265 views34 slides
Laravel Nova: czy to się w ogóle opłaca? by
Laravel Nova: czy to się w ogóle opłaca?Laravel Nova: czy to się w ogóle opłaca?
Laravel Nova: czy to się w ogóle opłaca?Laravel Poland MeetUp
526 views86 slides
Git Introduction Tutorial by
Git Introduction TutorialGit Introduction Tutorial
Git Introduction TutorialThomas Rausch
3.9K views148 slides
github-actions.pdf by
github-actions.pdfgithub-actions.pdf
github-actions.pdfAbhaymithraReddy1
127 views76 slides
Github - Git Training Slides: Foundations by
Github - Git Training Slides: FoundationsGithub - Git Training Slides: Foundations
Github - Git Training Slides: FoundationsLee Hanxue
3.1K views537 slides
Git Workflow With Gitflow by
Git Workflow With GitflowGit Workflow With Gitflow
Git Workflow With GitflowJosh Dvir
6.3K views15 slides

What's hot(20)

Git Introduction Tutorial by Thomas Rausch
Git Introduction TutorialGit Introduction Tutorial
Git Introduction Tutorial
Thomas Rausch3.9K views
Github - Git Training Slides: Foundations by Lee Hanxue
Github - Git Training Slides: FoundationsGithub - Git Training Slides: Foundations
Github - Git Training Slides: Foundations
Lee Hanxue3.1K views
Git Workflow With Gitflow by Josh Dvir
Git Workflow With GitflowGit Workflow With Gitflow
Git Workflow With Gitflow
Josh Dvir6.3K views
oVirt installation guide_v4.3 by CheolHee Han
oVirt installation guide_v4.3oVirt installation guide_v4.3
oVirt installation guide_v4.3
CheolHee Han1.4K views
Introduction to GitHub Actions by Bo-Yi Wu
Introduction to GitHub ActionsIntroduction to GitHub Actions
Introduction to GitHub Actions
Bo-Yi Wu19.3K views
Comparison of SVN and Git by Daniel Wieth
Comparison of SVN and GitComparison of SVN and Git
Comparison of SVN and Git
Daniel Wieth1.8K views
Git and GitHub for Documentation by Anne Gentle
Git and GitHub for DocumentationGit and GitHub for Documentation
Git and GitHub for Documentation
Anne Gentle57.5K views
Git Series. Episode 3. Git Flow and Github-Flow by Mikhail Melnik
Git Series. Episode 3. Git Flow and Github-FlowGit Series. Episode 3. Git Flow and Github-Flow
Git Series. Episode 3. Git Flow and Github-Flow
Mikhail Melnik3.5K views
코루틴(Coroutine) by QooJuice
코루틴(Coroutine)코루틴(Coroutine)
코루틴(Coroutine)
QooJuice2.6K views
CICD Pipeline Using Github Actions by Kumar Shìvam
CICD Pipeline Using Github ActionsCICD Pipeline Using Github Actions
CICD Pipeline Using Github Actions
Kumar Shìvam517 views
svn 능력자를 위한 git 개념 가이드 by Insub Lee
svn 능력자를 위한 git 개념 가이드svn 능력자를 위한 git 개념 가이드
svn 능력자를 위한 git 개념 가이드
Insub Lee239.5K views
Scaling Twitter by Blaine
Scaling TwitterScaling Twitter
Scaling Twitter
Blaine78.3K views
[KGC 2012]Boost.asio를 이용한 네트웍 프로그래밍 by 흥배 최
[KGC 2012]Boost.asio를 이용한 네트웍 프로그래밍[KGC 2012]Boost.asio를 이용한 네트웍 프로그래밍
[KGC 2012]Boost.asio를 이용한 네트웍 프로그래밍
흥배 최33.8K views
Running Kubernetes in Production: A Million Ways to Crash Your Cluster - DevO... by Henning Jacobs
Running Kubernetes in Production: A Million Ways to Crash Your Cluster - DevO...Running Kubernetes in Production: A Million Ways to Crash Your Cluster - DevO...
Running Kubernetes in Production: A Million Ways to Crash Your Cluster - DevO...
Henning Jacobs18.5K views

Similar to Gerrit Analytics applied to Android source code

What's new in Gerrit Code Review v3.1 and beyond by
What's new in Gerrit Code Review v3.1 and beyondWhat's new in Gerrit Code Review v3.1 and beyond
What's new in Gerrit Code Review v3.1 and beyondLuca Milanesio
231 views18 slides
Speeding up your team with GitOps by
Speeding up your team with GitOpsSpeeding up your team with GitOps
Speeding up your team with GitOpsBrice Fernandes
300 views88 slides
Assign, commit, and review - A developer’s guide to OpenStack contribution-20... by
Assign, commit, and review - A developer’s guide to OpenStack contribution-20...Assign, commit, and review - A developer’s guide to OpenStack contribution-20...
Assign, commit, and review - A developer’s guide to OpenStack contribution-20...OpenCity Community
956 views36 slides
CIP Developing Curator Tool Wizards by
CIP Developing Curator Tool WizardsCIP Developing Curator Tool Wizards
CIP Developing Curator Tool WizardsEdwin Rojas
174 views26 slides
Ultimate Git Workflow - Seoul 2015 by
Ultimate Git Workflow - Seoul 2015Ultimate Git Workflow - Seoul 2015
Ultimate Git Workflow - Seoul 2015Atlassian 대한민국
2.1K views141 slides
gitopsthekubernetesway-201026090439.pdf by
gitopsthekubernetesway-201026090439.pdfgitopsthekubernetesway-201026090439.pdf
gitopsthekubernetesway-201026090439.pdfsaraichiba2
3 views44 slides

Similar to Gerrit Analytics applied to Android source code(20)

What's new in Gerrit Code Review v3.1 and beyond by Luca Milanesio
What's new in Gerrit Code Review v3.1 and beyondWhat's new in Gerrit Code Review v3.1 and beyond
What's new in Gerrit Code Review v3.1 and beyond
Luca Milanesio231 views
Speeding up your team with GitOps by Brice Fernandes
Speeding up your team with GitOpsSpeeding up your team with GitOps
Speeding up your team with GitOps
Brice Fernandes300 views
Assign, commit, and review - A developer’s guide to OpenStack contribution-20... by OpenCity Community
Assign, commit, and review - A developer’s guide to OpenStack contribution-20...Assign, commit, and review - A developer’s guide to OpenStack contribution-20...
Assign, commit, and review - A developer’s guide to OpenStack contribution-20...
OpenCity Community956 views
CIP Developing Curator Tool Wizards by Edwin Rojas
CIP Developing Curator Tool WizardsCIP Developing Curator Tool Wizards
CIP Developing Curator Tool Wizards
Edwin Rojas174 views
gitopsthekubernetesway-201026090439.pdf by saraichiba2
gitopsthekubernetesway-201026090439.pdfgitopsthekubernetesway-201026090439.pdf
gitopsthekubernetesway-201026090439.pdf
saraichiba23 views
Gitops: the kubernetes way by sparkfabrik
Gitops: the kubernetes wayGitops: the kubernetes way
Gitops: the kubernetes way
sparkfabrik2.1K views
Gimel at Dataworks Summit San Jose 2018 by Romit Mehta
Gimel at Dataworks Summit San Jose 2018Gimel at Dataworks Summit San Jose 2018
Gimel at Dataworks Summit San Jose 2018
Romit Mehta180 views
Delivering Quality at Speed with GitOps by Weaveworks
Delivering Quality at Speed with GitOpsDelivering Quality at Speed with GitOps
Delivering Quality at Speed with GitOps
Weaveworks1.3K views
Ship code like a keptn by Rob Jahn
Ship code like a keptnShip code like a keptn
Ship code like a keptn
Rob Jahn432 views
Assign, Commit, and Review by Zhongyue Luo
Assign, Commit, and ReviewAssign, Commit, and Review
Assign, Commit, and Review
Zhongyue Luo2.1K views
GitOps: Git come unica fonte di verità per applicazioni e infrastruttura by sparkfabrik
GitOps: Git come unica fonte di verità per applicazioni e infrastrutturaGitOps: Git come unica fonte di verità per applicazioni e infrastruttura
GitOps: Git come unica fonte di verità per applicazioni e infrastruttura
sparkfabrik533 views
CodeCamp Iasi - Creating serverless data analytics system on GCP using BigQuery by Márton Kodok
CodeCamp Iasi - Creating serverless data analytics system on GCP using BigQueryCodeCamp Iasi - Creating serverless data analytics system on GCP using BigQuery
CodeCamp Iasi - Creating serverless data analytics system on GCP using BigQuery
Márton Kodok358 views
DevOps with OpenShift - Fabien Dupont - ManageIQ Design Summit 2016 by ManageIQ
DevOps with OpenShift - Fabien Dupont - ManageIQ Design Summit 2016DevOps with OpenShift - Fabien Dupont - ManageIQ Design Summit 2016
DevOps with OpenShift - Fabien Dupont - ManageIQ Design Summit 2016
ManageIQ1.9K views
Gerrit Code Review migrations step-by-step by Luca Milanesio
Gerrit Code Review migrations step-by-stepGerrit Code Review migrations step-by-step
Gerrit Code Review migrations step-by-step
Luca Milanesio311 views
API Governance and GitOps in Hybrid Integration Platform (MuleSoft) by Sumanth Donthi
API Governance and GitOps in Hybrid Integration Platform (MuleSoft)API Governance and GitOps in Hybrid Integration Platform (MuleSoft)
API Governance and GitOps in Hybrid Integration Platform (MuleSoft)
Sumanth Donthi214 views
Git/Gerrit with TeamForge by CollabNet
Git/Gerrit with TeamForgeGit/Gerrit with TeamForge
Git/Gerrit with TeamForge
CollabNet3.3K views
Gerrit Code Review v3.2 and v3.3 by Luca Milanesio
Gerrit Code Review v3.2 and v3.3Gerrit Code Review v3.2 and v3.3
Gerrit Code Review v3.2 and v3.3
Luca Milanesio142 views

More from Luca Milanesio

Cloud-native Gerrit Code Review by
Cloud-native Gerrit Code ReviewCloud-native Gerrit Code Review
Cloud-native Gerrit Code ReviewLuca Milanesio
229 views24 slides
ChronicleMap non-blocking cache for Gerrit v3.3 by
ChronicleMap non-blocking cache for Gerrit v3.3ChronicleMap non-blocking cache for Gerrit v3.3
ChronicleMap non-blocking cache for Gerrit v3.3Luca Milanesio
85 views17 slides
Gerrit Code Review multi-site by
Gerrit Code Review multi-siteGerrit Code Review multi-site
Gerrit Code Review multi-siteLuca Milanesio
1.1K views16 slides
What's new in Gerrit Code Review 3.0 by
What's new in Gerrit Code Review 3.0What's new in Gerrit Code Review 3.0
What's new in Gerrit Code Review 3.0Luca Milanesio
1.1K views31 slides
Gerrit User Summit 2019 Keynote by
Gerrit User Summit 2019 KeynoteGerrit User Summit 2019 Keynote
Gerrit User Summit 2019 KeynoteLuca Milanesio
296 views7 slides
Gerrit multi-master / multi-site at GerritHub by
Gerrit multi-master / multi-site at GerritHubGerrit multi-master / multi-site at GerritHub
Gerrit multi-master / multi-site at GerritHubLuca Milanesio
908 views17 slides

More from Luca Milanesio(20)

Cloud-native Gerrit Code Review by Luca Milanesio
Cloud-native Gerrit Code ReviewCloud-native Gerrit Code Review
Cloud-native Gerrit Code Review
Luca Milanesio229 views
ChronicleMap non-blocking cache for Gerrit v3.3 by Luca Milanesio
ChronicleMap non-blocking cache for Gerrit v3.3ChronicleMap non-blocking cache for Gerrit v3.3
ChronicleMap non-blocking cache for Gerrit v3.3
Luca Milanesio85 views
Gerrit Code Review multi-site by Luca Milanesio
Gerrit Code Review multi-siteGerrit Code Review multi-site
Gerrit Code Review multi-site
Luca Milanesio1.1K views
What's new in Gerrit Code Review 3.0 by Luca Milanesio
What's new in Gerrit Code Review 3.0What's new in Gerrit Code Review 3.0
What's new in Gerrit Code Review 3.0
Luca Milanesio1.1K views
Gerrit User Summit 2019 Keynote by Luca Milanesio
Gerrit User Summit 2019 KeynoteGerrit User Summit 2019 Keynote
Gerrit User Summit 2019 Keynote
Luca Milanesio296 views
Gerrit multi-master / multi-site at GerritHub by Luca Milanesio
Gerrit multi-master / multi-site at GerritHubGerrit multi-master / multi-site at GerritHub
Gerrit multi-master / multi-site at GerritHub
Luca Milanesio908 views
GerritHub a true Gerrit migration story to v2.15 by Luca Milanesio
GerritHub a true Gerrit migration story to v2.15GerritHub a true Gerrit migration story to v2.15
GerritHub a true Gerrit migration story to v2.15
Luca Milanesio438 views
Gerrit User Summit 2018 - Keynote by Luca Milanesio
Gerrit User Summit 2018 - Keynote Gerrit User Summit 2018 - Keynote
Gerrit User Summit 2018 - Keynote
Luca Milanesio588 views
Jenkins plugin for Gerrit Code Review pipelines by Luca Milanesio
Jenkins plugin for Gerrit Code Review pipelinesJenkins plugin for Gerrit Code Review pipelines
Jenkins plugin for Gerrit Code Review pipelines
Luca Milanesio1K views
Gerrit User Summit 2017 Keynote by Luca Milanesio
Gerrit User Summit 2017 KeynoteGerrit User Summit 2017 Keynote
Gerrit User Summit 2017 Keynote
Luca Milanesio495 views
How to keep Jenkins logs forever without performance issues by Luca Milanesio
How to keep Jenkins logs forever without performance issuesHow to keep Jenkins logs forever without performance issues
How to keep Jenkins logs forever without performance issues
Luca Milanesio1.1K views
Jenkins Pipeline on your Local Box to Reduce Cycle Time by Luca Milanesio
Jenkins Pipeline on your Local Box to Reduce Cycle TimeJenkins Pipeline on your Local Box to Reduce Cycle Time
Jenkins Pipeline on your Local Box to Reduce Cycle Time
Luca Milanesio498 views
Jenkins world 2017 - Data-Driven CI Pipeline with Gerrit Code Review by Luca Milanesio
Jenkins world 2017 - Data-Driven CI Pipeline with Gerrit Code ReviewJenkins world 2017 - Data-Driven CI Pipeline with Gerrit Code Review
Jenkins world 2017 - Data-Driven CI Pipeline with Gerrit Code Review
Luca Milanesio1.1K views
Stable master workflow with Gerrit Code Review by Luca Milanesio
Stable master workflow with Gerrit Code ReviewStable master workflow with Gerrit Code Review
Stable master workflow with Gerrit Code Review
Luca Milanesio1.9K views
Gerrit Code Review Analytics by Luca Milanesio
Gerrit Code Review AnalyticsGerrit Code Review Analytics
Gerrit Code Review Analytics
Luca Milanesio3.9K views
Zero-Downtime Gerrit Code Review Upgrade by Luca Milanesio
Zero-Downtime Gerrit Code Review UpgradeZero-Downtime Gerrit Code Review Upgrade
Zero-Downtime Gerrit Code Review Upgrade
Luca Milanesio3.4K views
Speed up Continuous Delivery with BigData Analytics by Luca Milanesio
Speed up Continuous Delivery with BigData AnalyticsSpeed up Continuous Delivery with BigData Analytics
Speed up Continuous Delivery with BigData Analytics
Luca Milanesio1.1K views
Devoxx 2016 Using Jenkins, Gerrit and Spark for Continuous Delivery Analytics by Luca Milanesio
Devoxx 2016 Using Jenkins, Gerrit and Spark for Continuous Delivery AnalyticsDevoxx 2016 Using Jenkins, Gerrit and Spark for Continuous Delivery Analytics
Devoxx 2016 Using Jenkins, Gerrit and Spark for Continuous Delivery Analytics
Luca Milanesio1.3K views
Gerrit is Getting Native with RPM, Deb and Docker by Luca Milanesio
Gerrit is Getting Native with RPM, Deb and DockerGerrit is Getting Native with RPM, Deb and Docker
Gerrit is Getting Native with RPM, Deb and Docker
Luca Milanesio3.2K views
GerritHub.io - present, past, future by Luca Milanesio
GerritHub.io - present, past, futureGerritHub.io - present, past, future
GerritHub.io - present, past, future
Luca Milanesio8.2K views

Recently uploaded

Special_edition_innovator_2023.pdf by
Special_edition_innovator_2023.pdfSpecial_edition_innovator_2023.pdf
Special_edition_innovator_2023.pdfWillDavies22
18 views6 slides
PRODUCT LISTING.pptx by
PRODUCT LISTING.pptxPRODUCT LISTING.pptx
PRODUCT LISTING.pptxangelicacueva6
14 views1 slide
Uni Systems for Power Platform.pptx by
Uni Systems for Power Platform.pptxUni Systems for Power Platform.pptx
Uni Systems for Power Platform.pptxUni Systems S.M.S.A.
56 views21 slides
Melek BEN MAHMOUD.pdf by
Melek BEN MAHMOUD.pdfMelek BEN MAHMOUD.pdf
Melek BEN MAHMOUD.pdfMelekBenMahmoud
14 views1 slide
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLive by
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLiveAutomating a World-Class Technology Conference; Behind the Scenes of CiscoLive
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLiveNetwork Automation Forum
34 views35 slides
TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f... by
TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f...TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f...
TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f...TrustArc
11 views29 slides

Recently uploaded(20)

Special_edition_innovator_2023.pdf by WillDavies22
Special_edition_innovator_2023.pdfSpecial_edition_innovator_2023.pdf
Special_edition_innovator_2023.pdf
WillDavies2218 views
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLive by Network Automation Forum
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLiveAutomating a World-Class Technology Conference; Behind the Scenes of CiscoLive
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLive
TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f... by TrustArc
TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f...TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f...
TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f...
TrustArc11 views
SAP Automation Using Bar Code and FIORI.pdf by Virendra Rai, PMP
SAP Automation Using Bar Code and FIORI.pdfSAP Automation Using Bar Code and FIORI.pdf
SAP Automation Using Bar Code and FIORI.pdf
"Running students' code in isolation. The hard way", Yurii Holiuk by Fwdays
"Running students' code in isolation. The hard way", Yurii Holiuk "Running students' code in isolation. The hard way", Yurii Holiuk
"Running students' code in isolation. The hard way", Yurii Holiuk
Fwdays17 views
Future of AR - Facebook Presentation by ssuserb54b561
Future of AR - Facebook PresentationFuture of AR - Facebook Presentation
Future of AR - Facebook Presentation
ssuserb54b56115 views
Piloting & Scaling Successfully With Microsoft Viva by Richard Harbridge
Piloting & Scaling Successfully With Microsoft VivaPiloting & Scaling Successfully With Microsoft Viva
Piloting & Scaling Successfully With Microsoft Viva
6g - REPORT.pdf by Liveplex
6g - REPORT.pdf6g - REPORT.pdf
6g - REPORT.pdf
Liveplex10 views
ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ... by Jasper Oosterveld
ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ...ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ...
ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ...

Gerrit Analytics applied to Android source code

  • 1. 0 Gerrit User Summit 2019 – GerritForge Inc. – Sunnyvale CA GerritForge.com 0 Gerrit Code Analytics for the Android OpenSource Project Luca Milanesio Gerrit Code Review Maintainer GerritForge
  • 2. 1 Gerrit User Summit 2019 – GerritForge Inc. – Sunnyvale CA GerritForge.com 1 About GerritForge Founded in the UK HQ in London Committed to OpenSource + Sunnyvale CA
  • 3. 2 Gerrit User Summit 2019 – GerritForge Inc. – Sunnyvale CA GerritForge.com 2 Gerrit DevOps Analytics § There’s a lot value in your DevOps pipeline § Information collected from Git, Jenkins, Jira, you name it § Discover and publish meaningful KPI to make intelligent decisions about § People § Projects § Infrastructure § Lower the Risk of a software release leveraging insights on historical data
  • 4. 3 Gerrit User Summit 2019 – GerritForge Inc. – Sunnyvale CA GerritForge.com 3 Continuous Delivery Analytics Dimensions People Reviews Projects Commits System Metrics
  • 5. 4 Gerrit User Summit 2019 – GerritForge Inc. – Sunnyvale CA GerritForge.com 4 BigData to the rescue § Collect all review events § Collect all logs § Channel them to a central store § Crunch and Crunch continuously § Never delete § Process, inspect and learn
  • 6. 5 Gerrit User Summit 2019 – GerritForge Inc. – Sunnyvale CA GerritForge.com 5 GDA Components The main components of GDA are: § GDA Event Collector (Plugin) This allows for data to be extracted, anonymized and sent over to the next phase. § GDA ELT Engine This is hosted in the cloud by GerritForge or on- premises and functions as data mart and processing for all development related data § GDA Dashboard(s) These are provided by GF according to the customer needs. Some dashboards are already available (for people and projects). Others will be built on purpose.
  • 7. 6 Gerrit User Summit 2019 – GerritForge Inc. – Sunnyvale CA GerritForge.com 6 Android OpenSource Project use-case Issue 10597: AOSP Gerrit stats page Reported by zoran.jovanovic@sony.com on Wed, Mar 13, 2019, 9:02 AM PDT AOSP repository and its Gerrit Code Review are a treasure trove of data. There are some very interesting and useful stats that could be presented to the users. The stats would help in giving recognition for the contributors and reviewers alike, thus raising the motiviation of contributors, it would provide an easy access to the long and rich history of AOSP project etc.
  • 8. 7 Gerrit User Summit 2019 – GerritForge Inc. – Sunnyvale CA GerritForge.com 7 The problems to be resolved P1: How to mirror the AOSP repositories in a systematic way? P2: How to scale up the current Gerrit analytics plugin + ETL? P3: How to parse foreign Gerrit note-db data?
  • 9. 8 Gerrit User Summit 2019 – GerritForge Inc. – Sunnyvale CA GerritForge.com 8 Problem 1: AOSP repositories replication Gerrit has a replication plugin: • Define replication remotes • Define push ref-spec How to pull instead? Do you replicate the AOSP repos on your Gerrit? How do you automate the process?
  • 10. 9 Gerrit User Summit 2019 – GerritForge Inc. – Sunnyvale CA GerritForge.com 9 Problem 1 solved: pull-replication plugin
  • 11. 10 Gerrit User Summit 2019 – GerritForge Inc. – Sunnyvale CA GerritForge.com 10 Challenges with pull-replication plugin 1. Why not extending the replication plugin? • replication.config already defines replication remotes • Can the push logic be extended? 2. Why not developing a brand-new plugin? • Copy & paste existing code, keeping the essential? … or a mix of 1. and 2. ?
  • 12. 11 Gerrit User Summit 2019 – GerritForge Inc. – Sunnyvale CA GerritForge.com 11 Design decisions Refactoring of replication plugin • Decouple configuration from remote destination • Started in April, merged in October (6 months!) • Introduced unit and integration tests (the firsts in 7 years !) Reuse of the replication plugin logic in the pull-replication plugin • Use replication-plugin as a dependency • Complete reuse of the configuration and logic associated
  • 13. 12 Gerrit User Summit 2019 – GerritForge Inc. – Sunnyvale CA GerritForge.com 12 pull-replication demo $GERRIT_SITE/etc/replication.config [remote "aosp"] url = https://android.googlesource.com/${name} fetch = +refs/heads/*:refs/heads/* fetch = +refs/tags/*:refs/tags/* projects = platform/system/core
  • 14. 13 Gerrit User Summit 2019 – GerritForge Inc. – Sunnyvale CA GerritForge.com 13 pull-replication demo ssh localhost pull-replication start --all ==> logs/pull_replication_log <== [2019-11-16 23:59:22,712] [49829e49] Replication from https://android.googlesource.com/platform/system/core started... [2019-11-16 23:59:22,753] [49829e49] Fetch references [+refs/heads/*:refs/heads/*, +refs/tags/*:refs/tags/*] from https://android.googlesource.com/platform/system/core [2019-11-16 23:59:25,243] [49829e49] Replication from https://android.googlesource.com/platform/system/core completed in 2530ms, 15012ms delay, 0 retries
  • 15. 14 Gerrit User Summit 2019 – GerritForge Inc. – Sunnyvale CA GerritForge.com 14 Problem 2: AOSP repositories are BIG Gerrit analytics plugin slowest points: • Processing of branches • Binary files • Commits diffs and stats computation
  • 16. 15 Gerrit User Summit 2019 – GerritForge Inc. – Sunnyvale CA GerritForge.com 15 Problem 2: solved Gerrit analytics plugin performance improvements: • Pre-computation of branches • Reuse of the Gerrit diff-cache for analytics • Introduction of the analytics- commits_statistics_cache
  • 17. 16 Gerrit User Summit 2019 – GerritForge Inc. – Sunnyvale CA GerritForge.com 16 Analytics performance demo Gerrit cold start (no cache): $ time curl -v 'http://localhost:8080/projects/platform%2Fsystem%2Fcore/analyt ics~contributors' | wc –l 1732 curl -v 0.02s user 0.03s system 0% cpu 1:30.60 total
  • 18. 17 Gerrit User Summit 2019 – GerritForge Inc. – Sunnyvale CA GerritForge.com 17 Analytics added cache and performance $ ssh localhost gerrit show-caches | grep analytics analytics-commits_statistics_cache| 54011 | 1.6ms | 0% | $ time curl -v 'http://localhost:8080/projects/platform%2Fsystem%2Fcore/analytics~contributors ' | wc –l 1732 curl -v 0.01s user 0.02s system 2% cpu 1.045 total 90x times faster with commits-stats cache
  • 19. 18 Gerrit User Summit 2019 – GerritForge Inc. – Sunnyvale CA GerritForge.com 18 Analytics bot detection People or BOTs can be recognized by patter of commits: • Detect file type by reg-ex • Identify commits with BOT-like files only $GERRIT_SITE/etc/analytics.config: [contributors] botlike-filename-regexp = OWNERS
  • 20. 19 Gerrit User Summit 2019 – GerritForge Inc. – Sunnyvale CA GerritForge.com 19 Problem 3: foreign changes processing Gerrit changes in NoteDb have a Server-ID baked-in Example: $ git show refs/changes/00/100000/meta commit 0014ca6443ac0af338e2677b45e538782bb7a12e (origin/00/100000/meta, refs/changes/00/100000/meta) Author: beckysiegel <1030207@173816e5-2b9a-37c3-8a2e-48639d4f1153> Date: Sat Mar 3 18:38:17 2018 +0000 Update patch set 1 Hashtag added: enhancement Patch-set: 1 Hashtags: enhancement Tag: autogenerated:gerrit:setHashtag
  • 21. 20 Gerrit User Summit 2019 – GerritForge Inc. – Sunnyvale CA GerritForge.com 20 Solution: allow parsing of foreign NoteDb Dec 2018: proposed - 9 months later, rejected and abandoned
  • 22. 21 Gerrit User Summit 2019 – GerritForge Inc. – Sunnyvale CA GerritForge.com 21 Solution revamped: Dave shows another way Aug 2019: proposed - 1 month later, merged! (thanks, DavidO)
  • 23. 22 Gerrit User Summit 2019 – GerritForge Inc. – Sunnyvale CA GerritForge.com 22 Analytics deployment on GerritHub Gerrit master (review-3) World Traffic (R/W) Gerrit master (review-4) HAproxy HAproxy Gerrit master (review-1) Gerrit master (review-2) HAproxy HAproxy Analytics Traffic (R/W) Multi-site plugin Multi-site plugin Multi-site plugin Multi-site plugin
  • 24. 23 Gerrit User Summit 2019 – GerritForge Inc. – Sunnyvale CA GerritForge.com 23 Analytics next steps 1. Enable pull-replication on review- {3,4}.gerrithub.io 2. Process AOSP repos contributors analytics once-a-day 3. Publish commits stats to analytics.gerrithub.io 4. Enrich with hashtags change data
  • 25. 24 Gerrit User Summit 2019 – GerritForge Inc. – Sunnyvale CA GerritForge.com 24 Poll: have you implemented multi-master/HA? Image from: http://cypp.rutgers.edu/ru-voting/political-information/public-opinion-polls/
  • 26. 25 Gerrit User Summit 2019 – GerritForge Inc. – Sunnyvale CA GerritForge.com 25 Wants to know more? GerritForge.com/contact