SlideShare a Scribd company logo
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

More Related Content

What's hot

What's hot (20)

Gain Better Observability with OpenTelemetry and InfluxDB
Gain Better Observability with OpenTelemetry and InfluxDB Gain Better Observability with OpenTelemetry and InfluxDB
Gain Better Observability with OpenTelemetry and InfluxDB
 
Kubernetes networking
Kubernetes networkingKubernetes networking
Kubernetes networking
 
Introduction to SDN
Introduction to SDNIntroduction to SDN
Introduction to SDN
 
Introduction to SDN: Software Defined Networking
Introduction to SDN: Software Defined NetworkingIntroduction to SDN: Software Defined Networking
Introduction to SDN: Software Defined Networking
 
Introductionto SDN
Introductionto SDN Introductionto SDN
Introductionto SDN
 
Understanding F# Workflows
Understanding F# WorkflowsUnderstanding F# Workflows
Understanding F# Workflows
 
OpenStack Neutron's Distributed Virtual Router
OpenStack Neutron's Distributed Virtual RouterOpenStack Neutron's Distributed Virtual Router
OpenStack Neutron's Distributed Virtual Router
 
DevOps Taiwan Monitor Tools 大亂鬥 - Prometheus
DevOps Taiwan Monitor Tools 大亂鬥 - PrometheusDevOps Taiwan Monitor Tools 大亂鬥 - Prometheus
DevOps Taiwan Monitor Tools 大亂鬥 - Prometheus
 
OpenStack Neutron Tutorial
OpenStack Neutron TutorialOpenStack Neutron Tutorial
OpenStack Neutron Tutorial
 
Http request and http response
Http request and http responseHttp request and http response
Http request and http response
 
Ruby & Rails Error Handling
Ruby & Rails Error HandlingRuby & Rails Error Handling
Ruby & Rails Error Handling
 
Prometheus with Grafana - AddWeb Solution
Prometheus with Grafana - AddWeb SolutionPrometheus with Grafana - AddWeb Solution
Prometheus with Grafana - AddWeb Solution
 
Building Event-Driven Systems with Apache Kafka
Building Event-Driven Systems with Apache KafkaBuilding Event-Driven Systems with Apache Kafka
Building Event-Driven Systems with Apache Kafka
 
Proxy Servers & Firewalls
Proxy Servers & FirewallsProxy Servers & Firewalls
Proxy Servers & Firewalls
 
JHipster on AWS
JHipster on AWSJHipster on AWS
JHipster on AWS
 
Mikrotik pcq
Mikrotik   pcqMikrotik   pcq
Mikrotik pcq
 
Building a Distributed Build System at Google Scale
Building a Distributed Build System at Google ScaleBuilding a Distributed Build System at Google Scale
Building a Distributed Build System at Google Scale
 
Neutron qos overview
Neutron qos overviewNeutron qos overview
Neutron qos overview
 
Openstack zun,virtual kubelet
Openstack zun,virtual kubeletOpenstack zun,virtual kubelet
Openstack zun,virtual kubelet
 
Getting Started Monitoring with Prometheus and Grafana
Getting Started Monitoring with Prometheus and GrafanaGetting Started Monitoring with Prometheus and Grafana
Getting Started Monitoring with Prometheus and Grafana
 

Similar to Gerrit Analytics applied to Android source code

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...
Assign, commit, and review - A developer’s guide to OpenStack contribution-20...
OpenCity Community
 
gitopsthekubernetesway-201026090439.pdf
gitopsthekubernetesway-201026090439.pdfgitopsthekubernetesway-201026090439.pdf
gitopsthekubernetesway-201026090439.pdf
saraichiba2
 

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

What's new in Gerrit Code Review v3.1 and beyond
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
 
Speeding up your team with GitOps
Speeding up your team with GitOpsSpeeding up your team with GitOps
Speeding up your team with GitOps
 
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...
Assign, commit, and review - A developer’s guide to OpenStack contribution-20...
 
CIP Developing Curator Tool Wizards
CIP Developing Curator Tool WizardsCIP Developing Curator Tool Wizards
CIP Developing Curator Tool Wizards
 
Ultimate Git Workflow - Seoul 2015
Ultimate Git Workflow - Seoul 2015Ultimate Git Workflow - Seoul 2015
Ultimate Git Workflow - Seoul 2015
 
gitopsthekubernetesway-201026090439.pdf
gitopsthekubernetesway-201026090439.pdfgitopsthekubernetesway-201026090439.pdf
gitopsthekubernetesway-201026090439.pdf
 
Gitops: the kubernetes way
Gitops: the kubernetes wayGitops: the kubernetes way
Gitops: the kubernetes way
 
Gimel at Dataworks Summit San Jose 2018
Gimel at Dataworks Summit San Jose 2018Gimel at Dataworks Summit San Jose 2018
Gimel at Dataworks Summit San Jose 2018
 
Dataworks | 2018-06-20 | Gimel data platform
Dataworks | 2018-06-20 | Gimel data platformDataworks | 2018-06-20 | Gimel data platform
Dataworks | 2018-06-20 | Gimel data platform
 
Delivering Quality at Speed with GitOps
Delivering Quality at Speed with GitOpsDelivering Quality at Speed with GitOps
Delivering Quality at Speed with GitOps
 
Ship code like a keptn
Ship code like a keptnShip code like a keptn
Ship code like a keptn
 
Assign, Commit, and Review
Assign, Commit, and ReviewAssign, Commit, and Review
Assign, Commit, and Review
 
GitOps: Git come unica fonte di verità per applicazioni e infrastruttura
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
 
CodeCamp Iasi - Creating serverless data analytics system on GCP using BigQuery
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
 
Primers or Reminders? The Effects of Existing Review Comments on Code Review
Primers or Reminders? The Effects of Existing Review Comments on Code ReviewPrimers or Reminders? The Effects of Existing Review Comments on Code Review
Primers or Reminders? The Effects of Existing Review Comments on Code Review
 
A Love Story with Kubevirt and Backstage from Cloud Native NoVA meetup Feb 2024
A Love Story with Kubevirt and Backstage from Cloud Native NoVA meetup Feb 2024A Love Story with Kubevirt and Backstage from Cloud Native NoVA meetup Feb 2024
A Love Story with Kubevirt and Backstage from Cloud Native NoVA meetup Feb 2024
 
DevOps with OpenShift - Fabien Dupont - ManageIQ Design Summit 2016
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
 
Gerrit Code Review migrations step-by-step
Gerrit Code Review migrations step-by-stepGerrit Code Review migrations step-by-step
Gerrit Code Review migrations step-by-step
 
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)
API Governance and GitOps in Hybrid Integration Platform (MuleSoft)
 
Git/Gerrit with TeamForge
Git/Gerrit with TeamForgeGit/Gerrit with TeamForge
Git/Gerrit with TeamForge
 

More from Luca Milanesio

More from Luca Milanesio (20)

Cloud-native Gerrit Code Review
Cloud-native Gerrit Code ReviewCloud-native Gerrit Code Review
Cloud-native Gerrit Code Review
 
Gerrit Code Review v3.2 and v3.3
Gerrit Code Review v3.2 and v3.3Gerrit Code Review v3.2 and v3.3
Gerrit Code Review v3.2 and v3.3
 
ChronicleMap non-blocking cache for Gerrit v3.3
ChronicleMap non-blocking cache for Gerrit v3.3ChronicleMap non-blocking cache for Gerrit v3.3
ChronicleMap non-blocking cache for Gerrit v3.3
 
Gerrit Code Review multi-site
Gerrit Code Review multi-siteGerrit Code Review multi-site
Gerrit Code Review multi-site
 
What's new in Gerrit Code Review 3.0
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
 
Gerrit User Summit 2019 Keynote
Gerrit User Summit 2019 KeynoteGerrit User Summit 2019 Keynote
Gerrit User Summit 2019 Keynote
 
Gerrit multi-master / multi-site at GerritHub
Gerrit multi-master / multi-site at GerritHubGerrit multi-master / multi-site at GerritHub
Gerrit multi-master / multi-site at GerritHub
 
GerritHub a true Gerrit migration story to v2.15
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
 
Gerrit User Summit 2018 - Keynote
Gerrit User Summit 2018 - Keynote Gerrit User Summit 2018 - Keynote
Gerrit User Summit 2018 - Keynote
 
Jenkins plugin for Gerrit Code Review pipelines
Jenkins plugin for Gerrit Code Review pipelinesJenkins plugin for Gerrit Code Review pipelines
Jenkins plugin for Gerrit Code Review pipelines
 
Gerrit User Summit 2017 Keynote
Gerrit User Summit 2017 KeynoteGerrit User Summit 2017 Keynote
Gerrit User Summit 2017 Keynote
 
How to keep Jenkins logs forever without performance issues
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
 
Jenkins Pipeline on your Local Box to Reduce Cycle Time
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
 
Jenkins world 2017 - Data-Driven CI Pipeline with Gerrit Code Review
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
 
Stable master workflow with Gerrit Code Review
Stable master workflow with Gerrit Code ReviewStable master workflow with Gerrit Code Review
Stable master workflow with Gerrit Code Review
 
Gerrit Code Review Analytics
Gerrit Code Review AnalyticsGerrit Code Review Analytics
Gerrit Code Review Analytics
 
Zero-Downtime Gerrit Code Review Upgrade
Zero-Downtime Gerrit Code Review UpgradeZero-Downtime Gerrit Code Review Upgrade
Zero-Downtime Gerrit Code Review Upgrade
 
Speed up Continuous Delivery with BigData Analytics
Speed up Continuous Delivery with BigData AnalyticsSpeed up Continuous Delivery with BigData Analytics
Speed up Continuous Delivery with BigData Analytics
 
Devoxx 2016 Using Jenkins, Gerrit and Spark for Continuous Delivery Analytics
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
 
Gerrit is Getting Native with RPM, Deb and Docker
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
 

Recently uploaded

Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 

Recently uploaded (20)

10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
AI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekAI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří Karpíšek
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
Powerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara LaskowskaPowerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara Laskowska
 
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
Agentic RAG What it is its types applications and implementation.pdf
Agentic RAG What it is its types applications and implementation.pdfAgentic RAG What it is its types applications and implementation.pdf
Agentic RAG What it is its types applications and implementation.pdf
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
In-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT ProfessionalsIn-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT Professionals
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024
 
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeFree and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
 

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