Bug 1670936 - Remove deprecated columns from performance_datum table

This commit is contained in:
beatrice-acasandrei 2020-11-03 10:28:00 +02:00 коммит произвёл GitHub
Родитель ab48a51a44
Коммит fc08ce1ebd
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
9 изменённых файлов: 25 добавлений и 22 удалений

Просмотреть файл

@ -788,11 +788,9 @@ def generate_enough_perf_datum(test_repository, test_perf_signature):
# to generate the actual alert)
for (push_id, value) in zip([1] * 30 + [2] * 30, [1] * 30 + [2] * 30):
# push_id == result_set_id == timestamp for purposes of this test
push = Push.objects.get(id=push_id)
PerformanceDatum.objects.create(
repository=test_repository,
result_set_id=push_id,
push_id=push_id,
signature=test_perf_signature,
value=value,

Просмотреть файл

@ -169,7 +169,6 @@ def test_cycle_job_with_performance_data(
PerformanceDatum.objects.create(
repository=test_repository,
result_set_id=1,
push=test_job.push,
job=test_job,
signature=test_perf_signature,

Просмотреть файл

@ -64,7 +64,6 @@ def _generate_performance_data(
)
PerformanceDatum.objects.create(
repository=test_repository,
result_set_id=t,
push=push,
signature=test_perf_signature,
push_timestamp=datetime.datetime.utcfromtimestamp(base_timestamp + t),

Просмотреть файл

@ -220,7 +220,6 @@ def test_filter_data_by_framework(
PerformanceDatum.objects.create(
repository=signature.repository,
push=push,
result_set_id=1,
signature=signature,
value=0.0,
push_timestamp=push.time,
@ -317,7 +316,6 @@ def test_filter_data_by_interval(
)
PerformanceDatum.objects.create(
repository=test_perf_signature.repository,
result_set_id=push.id,
push=push,
signature=test_perf_signature,
value=i,
@ -356,7 +354,6 @@ def test_filter_data_by_range(
)
PerformanceDatum.objects.create(
repository=test_perf_signature.repository,
result_set_id=push.id,
push=push,
signature=test_perf_signature,
value=i,
@ -398,7 +395,6 @@ def test_filter_data_by_signature(
for (i, signature) in enumerate([test_perf_signature, summary_perf_signature]):
PerformanceDatum.objects.create(
repository=signature.repository,
result_set_id=push.id,
push=push,
signature=signature,
value=i,

Просмотреть файл

@ -92,14 +92,13 @@ class PerformanceSeries(list):
Represents a series of performance observations
You can access the individual elements of the series by using the []
syntax. For example, to get the result set ids and geometric means
in a summary series:
syntax. For example, to get the geometric means in a summary series:
::
pc = PerfherderClient()
signature = '9cfc271dab9b7fc2c1229736fecfbbc6e7c5fac9'
series = pc.get_performance_data('mozilla-central', signature=signature)[signature]
(result_set_ids, geomeans) = (series['result_set_id'], series['geomean'])
geomeans = series['geomean']
"""
def __getitem__(self, key):

Просмотреть файл

@ -46,8 +46,6 @@ Type 'yes' to continue, or 'no' to cancel: """
):
PerformanceDatum.objects.create(
repository=s.repository,
result_set_id=t,
ds_job_id=t,
signature=s,
push_timestamp=datetime.datetime.utcfromtimestamp(now + (t * 60 * 60)),
push_id=1,

Просмотреть файл

@ -103,10 +103,8 @@ class Command(BaseCommand):
data = []
for (push_id, timestamp, value) in zip(
series['result_set_id'], series['push_timestamp'], series['value']
):
data.append(RevisionDatum(timestamp, value, testrun_id=push_id))
for (timestamp, value) in zip(series['push_timestamp'], series['value']):
data.append(RevisionDatum(timestamp, value))
for r in detect_changes(data):
if r.state == 'regression':

Просмотреть файл

@ -0,0 +1,21 @@
# Generated by Django 3.0.8 on 2020-10-14 07:47
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('perf', '0033_permit_multi_data_per_job'),
]
operations = [
migrations.RemoveField(
model_name='performancedatum',
name='ds_job_id',
),
migrations.RemoveField(
model_name='performancedatum',
name='result_set_id',
),
]

Просмотреть файл

@ -147,11 +147,6 @@ class PerformanceDatum(models.Model):
job = models.ForeignKey(Job, null=True, default=None, on_delete=models.SET_NULL)
push = models.ForeignKey(Push, on_delete=models.CASCADE)
# the following properties are obsolete and should be removed at some
# point
ds_job_id = models.PositiveIntegerField(db_column="ds_job_id", null=True)
result_set_id = models.PositiveIntegerField(null=True)
class Meta:
db_table = 'performance_datum'
index_together = [