-
Notifications
You must be signed in to change notification settings - Fork 101
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
Conversation
Hi @Anna-Livia, |
""" | ||
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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') |
There was a problem hiding this comment.
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 ?
Autre question, quelle est la relation entre cette implementation et celle proposée dans #1010 ? |
@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) |
There was a problem hiding this comment.
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'?
There was a problem hiding this comment.
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 ?
@Anna-Livia Je faisais référence au fait qu'il fallait pointer la PR à |
There was a problem hiding this 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) |
There was a problem hiding this comment.
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): |
There was a problem hiding this comment.
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') |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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') |
There was a problem hiding this comment.
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] |
There was a problem hiding this comment.
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 ?
There was a problem hiding this 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 :
- cela montre que le problème est complexe et inconnu, donc on ne connait pas encore la meilleure métrique
- nous avons besoin de plusieurs options pour voir quelles sont les plus adaptées pour résoudre Rendre les tests plus performants #926
- les deux peuvent être encore refactored, et cela est parfait, car il s'agit de trouver le chemin le plus court pour implémenter Rendre les tests plus performants #926
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).
Mais on veut utiliser les deux non ? |
7ed276e
to
ab37d07
Compare
test_perf
Connected to #1002
Connected to #1010
python performance_tests/test_perf_circleci.py 1717 1716
Ces changements :