Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compare la peformance d'un commit à celle de master #1012

Merged
merged 6 commits into from
Jun 13, 2018
Merged

Conversation

Anna-Livia
Copy link
Contributor

@Anna-Livia Anna-Livia commented Jun 11, 2018

⚠️ Attention : cette branch est pour le moment comparée à test_perf

Connected to #1002
Connected to #1010

  • Changement mineur.
  • Détails :
    • Ajoute un test de performance sur les tests de CircleCI
    • Ce test peut être lancé avec la commande:
      python performance_tests/test_perf_circleci.py 1717 1716

Ces changements :

  • Modifient des éléments non fonctionnels de ce dépôt.

@bonjourmauko
Copy link
Member

Hi @Anna-Livia, test_perf a déjà été mergé.

"""
This script takes in two CircleCI build numbers
(usually the `build_python2` and `build_python2` of the same workflow)
and outputs if their runtime in in the same ball park as the master branche's
Copy link
Member

@bonjourmauko bonjourmauko Jun 12, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and outputs if their runtime is in the same ball park as the master branche's

def get_master_branch_performance():
"""
Accesses the CircleCI API and gets the info for all available master branch builds.
:return: an Dict with the master branch build time statistics
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a Dict

builds.append(response['build_time_millis'])

if len(builds) < 5:
logging.warning('two few master branch builds')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

two few => too few => not enough ?

@bonjourmauko
Copy link
Member

Autre question, quelle est la relation entre cette implementation et celle proposée dans #1010 ?

@Anna-Livia
Copy link
Contributor Author

@maukoquiroga ce sont deux façons d'estimer la performance des tests :

@@ -0,0 +1,98 @@
"""
This script takes in two CircleCI build numbers
(usually the `build_python2` and `build_python2` of the same workflow)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'build_python2' and 'build_python3'?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Déplacer ce fichier dans openfisca_france/scripts/ ?
Et supprimer test_perf_tests.py qui a été traité par #1010 ?

@bonjourmauko bonjourmauko changed the base branch from test_perf to master June 12, 2018 18:51
@bonjourmauko
Copy link
Member

@Anna-Livia Je faisais référence au fait qu'il fallait pointer la PR à master.

Copy link
Contributor

@sandcha sandcha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

En l'état, le point bloquant est l'emplacement du script (et test_perf_tests.py qui devient obsolète).

@@ -0,0 +1,98 @@
"""
This script takes in two CircleCI build numbers
(usually the `build_python2` and `build_python2` of the same workflow)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Déplacer ce fichier dans openfisca_france/scripts/ ?
Et supprimer test_perf_tests.py qui a été traité par #1010 ?

def mean(numbers):
return sum(numbers, 0.0) / len(numbers)

def standard_deviation(numbers):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

builds.append(response['build_time_millis'])

if len(builds) < 5:
logging.warning('too few master branch builds')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'Too few circle builds on master branch'?

current_build = get_current_build_performance(python2_build_number, python3_build_number)


if current_build > master_branch['mean'] * 1.10:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixer à 20% comme pour le test de tests ?

sys.exit('This build may be making the test performance worst')

elif current_build < master_branch['mean'] + master_branch['standard_deviation']:
print('Performances are good')
Copy link
Contributor

@sandcha sandcha Jun 12, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indiquer l'écart (valeur de standard_deviation) avec master ?

import json
import logging

python2_build_number = sys.argv[1]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

En l'absence de deux arguments, ajouter une trace indiquant ce qu'attend le script ?

Copy link
Member

@bonjourmauko bonjourmauko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super boulot, je suis super content de #1010 et ce cette pull request. Parce que :

Nous ne savons pas encore quelle est la meilleure façon de tester la performance, et on va le découvrir en l'améliorant 😃.

À mon avis cela closes #1001 et #1002, et on peut passer à #1005.

Attention, pourtant, à prendre en compte l'impact des refactorings dans la performance des tests (il faire attention à diminuer l'impact d'un changement de la méthode pour observer sur la performance de l'observation elle-même).

@bonjourmauko
Copy link
Member

En l'état, le point bloquant est l'emplacement du script (et test_perf_tests.py qui devient obsolète).

Mais on veut utiliser les deux non ?

@sandcha sandcha merged commit 1885f2a into master Jun 13, 2018
@sandcha sandcha deleted the perf_circle_ci branch June 13, 2018 18:31
@bonjourmauko bonjourmauko changed the title Compare les peformances d'un commit à celles de la branch Master Compare la peformance d'un commit à celle de master Jul 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants