Regenerate historical data, add auto generated data config
Change-Id: I04a2d7117338dad49e84b7d7d91c81ed405e6674
This commit is contained in:
parent
81ebd10bdf
commit
690db7e166
@ -0,0 +1,12 @@
|
||||
{
|
||||
"database": "nova_dataset_131007_devstack",
|
||||
"db_pass": "tester",
|
||||
"db_user": "nova",
|
||||
"logging_conf": "logging.conf",
|
||||
"maximum_migration_times": {
|
||||
"default": 30
|
||||
},
|
||||
"project": "openstack/nova",
|
||||
"seed_data": "nova.sql",
|
||||
"type": "mysql"
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
{
|
||||
"project": "openstack/nova",
|
||||
"type": "mysql",
|
||||
"db_user": "nova",
|
||||
"db_pass": "tester",
|
||||
"database": "nova_dataset_131007_devstack",
|
||||
"seed_data": "nova.sql",
|
||||
"logging_conf": "logging.conf",
|
||||
"maximum_migration_times": {
|
||||
"default": 30
|
||||
}
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
{
|
||||
"database": "datasets_devstack_150",
|
||||
"db_pass": "tester",
|
||||
"db_user": "nova",
|
||||
"logging_conf": "logging.conf",
|
||||
"maximum_migration_times": {
|
||||
"default": 30
|
||||
},
|
||||
"project": "openstack/nova",
|
||||
"seed_data": "nova.sql",
|
||||
"type": "mysql"
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
{
|
||||
"project": "openstack/nova",
|
||||
"type": "mysql",
|
||||
"db_user": "nova",
|
||||
"db_pass": "tester",
|
||||
"database": "datasets_devstack_150",
|
||||
"seed_data": "nova.sql",
|
||||
"logging_conf": "logging.conf",
|
||||
"maximum_migration_times": {
|
||||
"default": 30
|
||||
}
|
||||
}
|
||||
|
13
datasets/datasets_trivial_500/nova_trivial_500/config.json
Normal file
13
datasets/datasets_trivial_500/nova_trivial_500/config.json
Normal file
@ -0,0 +1,13 @@
|
||||
{
|
||||
"database": "nova_dataset_trivial_500",
|
||||
"db_pass": "tester",
|
||||
"db_user": "nova",
|
||||
"logging_conf": "logging.conf",
|
||||
"maximum_migration_times": {
|
||||
"138": 42.0,
|
||||
"default": 30
|
||||
},
|
||||
"project": "openstack/nova",
|
||||
"seed_data": "nova_trivial_500.sql",
|
||||
"type": "mysql"
|
||||
}
|
13
datasets/datasets_trivial_500/nova_trivial_500/input.json
Normal file
13
datasets/datasets_trivial_500/nova_trivial_500/input.json
Normal file
@ -0,0 +1,13 @@
|
||||
{
|
||||
"project": "openstack/nova",
|
||||
"type": "mysql",
|
||||
"db_user": "nova",
|
||||
"db_pass": "tester",
|
||||
"database": "nova_dataset_trivial_500",
|
||||
"seed_data": "nova_trivial_500.sql",
|
||||
"logging_conf": "logging.conf",
|
||||
"maximum_migration_times": {
|
||||
"default": 30
|
||||
}
|
||||
}
|
||||
|
13
datasets/datasets_trivial_6000/nova_trivial_6000/config.json
Normal file
13
datasets/datasets_trivial_6000/nova_trivial_6000/config.json
Normal file
@ -0,0 +1,13 @@
|
||||
{
|
||||
"database": "nova_dataset_trivial_6000",
|
||||
"db_pass": "tester",
|
||||
"db_user": "nova",
|
||||
"logging_conf": "logging.conf",
|
||||
"maximum_migration_times": {
|
||||
"152": 74.0,
|
||||
"default": 30
|
||||
},
|
||||
"project": "openstack/nova",
|
||||
"seed_data": "nova_trivial_6000.sql",
|
||||
"type": "mysql"
|
||||
}
|
13
datasets/datasets_trivial_6000/nova_trivial_6000/input.json
Normal file
13
datasets/datasets_trivial_6000/nova_trivial_6000/input.json
Normal file
@ -0,0 +1,13 @@
|
||||
{
|
||||
"project": "openstack/nova",
|
||||
"type": "mysql",
|
||||
"db_user": "nova",
|
||||
"db_pass": "tester",
|
||||
"database": "nova_dataset_trivial_6000",
|
||||
"seed_data": "nova_trivial_6000.sql",
|
||||
"logging_conf": "logging.conf",
|
||||
"maximum_migration_times": {
|
||||
"default": 30
|
||||
}
|
||||
}
|
||||
|
30
datasets/datasets_user_001/user_001/config.json
Normal file
30
datasets/datasets_user_001/user_001/config.json
Normal file
@ -0,0 +1,30 @@
|
||||
{
|
||||
"database": "nova_datasets_user_001",
|
||||
"db_pass": "tester",
|
||||
"db_user": "nova",
|
||||
"logging_conf": "logging.conf",
|
||||
"maximum_migration_times": {
|
||||
"135": 62.0,
|
||||
"138": 44.0,
|
||||
"149": 87.0,
|
||||
"152": 241.0,
|
||||
"159": 86.0,
|
||||
"205": 51.0,
|
||||
"206": 63.0,
|
||||
"216": 102.0,
|
||||
"230": 53.0,
|
||||
"_138_bugs": [
|
||||
1263835
|
||||
],
|
||||
"_149_bugs": [
|
||||
1263836
|
||||
],
|
||||
"_205_bugs": [
|
||||
1263868
|
||||
],
|
||||
"default": 30
|
||||
},
|
||||
"project": "openstack/nova",
|
||||
"seed_data": "nova_user_001.sql",
|
||||
"type": "mysql"
|
||||
}
|
23
datasets/datasets_user_001/user_001/input.json
Normal file
23
datasets/datasets_user_001/user_001/input.json
Normal file
@ -0,0 +1,23 @@
|
||||
{
|
||||
"project": "openstack/nova",
|
||||
"type": "mysql",
|
||||
"db_user": "nova",
|
||||
"db_pass": "tester",
|
||||
"database": "nova_datasets_user_001",
|
||||
"seed_data": "nova_user_001.sql",
|
||||
"logging_conf": "logging.conf",
|
||||
"maximum_migration_times": {
|
||||
"default": 30,
|
||||
"135": 120,
|
||||
"138": 180,
|
||||
"_138_bugs": [1263835],
|
||||
"149": 240,
|
||||
"_149_bugs": [1263836],
|
||||
"152": 300,
|
||||
"159": 120,
|
||||
"205": 120,
|
||||
"_205_bugs": [1263868],
|
||||
"216": 180
|
||||
}
|
||||
}
|
||||
|
12
datasets/datasets_user_002/user_002/config.json
Normal file
12
datasets/datasets_user_002/user_002/config.json
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"database": "nova_dataset_user_002",
|
||||
"db_pass": "tester",
|
||||
"db_user": "nova",
|
||||
"logging_conf": "logging.conf",
|
||||
"maximum_migration_times": {
|
||||
"default": 30
|
||||
},
|
||||
"project": "openstack/nova",
|
||||
"seed_data": "nova_user_002.sql",
|
||||
"type": "mysql"
|
||||
}
|
13
datasets/datasets_user_002/user_002/input.json
Normal file
13
datasets/datasets_user_002/user_002/input.json
Normal file
@ -0,0 +1,13 @@
|
||||
{
|
||||
"project": "openstack/nova",
|
||||
"type": "mysql",
|
||||
"db_user": "nova",
|
||||
"db_pass": "tester",
|
||||
"database": "nova_dataset_user_002",
|
||||
"seed_data": "nova_user_002.sql",
|
||||
"logging_conf": "logging.conf",
|
||||
"maximum_migration_times": {
|
||||
"default": 30
|
||||
}
|
||||
}
|
||||
|
1949
results.json
1949
results.json
File diff suppressed because it is too large
Load Diff
@ -16,61 +16,118 @@
|
||||
|
||||
|
||||
import json
|
||||
import math
|
||||
import numpy
|
||||
import os
|
||||
import sys
|
||||
|
||||
|
||||
def main():
|
||||
for dataset in ['devstack_131007', 'devstack_150', 'trivial_500',
|
||||
'trivial_6000', 'user_001', 'user_002']:
|
||||
process_dataset(dataset)
|
||||
|
||||
|
||||
def process_dataset(dataset):
|
||||
with open('results.json') as f:
|
||||
results = json.loads(f.read())
|
||||
|
||||
migrations = {}
|
||||
all_times = {}
|
||||
|
||||
for engine in ['mysql', 'percona']:
|
||||
print
|
||||
print 'Dataset: %s' % dataset
|
||||
print 'Engine: %s' % engine
|
||||
print
|
||||
|
||||
for migration in sorted(results[engine]['user_001']):
|
||||
for migration in sorted(results[engine][dataset]):
|
||||
times = []
|
||||
for time in results[engine]['user_001'][migration]:
|
||||
for i in range(results[engine]['user_001'][migration][time]):
|
||||
all_times.setdefault(migration, [])
|
||||
for time in results[engine][dataset][migration]:
|
||||
for i in range(results[engine][dataset][migration][time]):
|
||||
times.append(int(time))
|
||||
all_times[migration].append(int(time))
|
||||
|
||||
times = sorted(times)
|
||||
emit_summary(engine, times, migrations, migration)
|
||||
|
||||
np_times = numpy.array(times)
|
||||
mean = np_times.mean()
|
||||
stddev = np_times.std()
|
||||
failed_threshold = int(max(30.0, mean + stddev * 2))
|
||||
|
||||
failed = 0
|
||||
for time in times:
|
||||
if time > failed_threshold:
|
||||
failed += 1
|
||||
|
||||
migrations.setdefault(migration, {})
|
||||
migrations[migration][engine] = ('%.02f;%0.2f;%.02f'
|
||||
% (mean - 2 * stddev,
|
||||
mean,
|
||||
mean + 2 * stddev))
|
||||
|
||||
if failed_threshold != 30 or failed > 0:
|
||||
print ('%s: Values range from %s to %s seconds. %d values. '
|
||||
'Mean is %.02f, stddev is %.02f.\n '
|
||||
'Recommend max of %d. With this value %.02f%% of tests '
|
||||
'would have failed.'
|
||||
% (migration, np_times.min(), np_times.max(),
|
||||
len(times), mean, stddev, failed_threshold,
|
||||
failed * 100.0 / len(times)))
|
||||
print
|
||||
print 'Dataset: %s' % dataset
|
||||
print 'Engine: combined'
|
||||
print
|
||||
for migration in sorted(all_times.keys()):
|
||||
emit_summary('combined', all_times[migration], migrations, migration)
|
||||
|
||||
with open('results.txt', 'w') as f:
|
||||
f.write('Migration,mysql,percona\n')
|
||||
for migration in sorted(migrations.keys()):
|
||||
f.write('%s' % migration)
|
||||
for engine in ['mysql', 'percona']:
|
||||
f.write(',%s' % migrations[migration][engine])
|
||||
f.write(',%s' % migrations[migration].get(engine, ''))
|
||||
f.write('\n')
|
||||
|
||||
# Write out the dataset config as a json blob
|
||||
config_path = os.path.join('datasets',
|
||||
'datasets_%s' % dataset,
|
||||
omg_hard_to_predict_names(dataset))
|
||||
with open(os.path.join(config_path, 'input.json')) as f:
|
||||
config = json.loads(f.read())
|
||||
|
||||
for migration in sorted(all_times.keys()):
|
||||
minimum, mean, maximum, stddev = analyse(all_times[migration])
|
||||
recommend = mean + 2 * stddev
|
||||
if recommend > 30.0:
|
||||
config['maximum_migration_times'][migration] = math.ceil(recommend)
|
||||
|
||||
with open(os.path.join(config_path, 'config.json'), 'w') as f:
|
||||
f.write(json.dumps(config, indent=4, sort_keys=True))
|
||||
|
||||
|
||||
def omg_hard_to_predict_names(dataset):
|
||||
if dataset.startswith('trivial'):
|
||||
return 'nova_%s' % dataset
|
||||
if dataset == 'devstack_150':
|
||||
return 'datasets_devstack_150'
|
||||
if dataset == 'devstack_131007':
|
||||
return '131007_devstack_export'
|
||||
return dataset
|
||||
|
||||
|
||||
def analyse(times):
|
||||
np_times = numpy.array(times)
|
||||
minimum = np_times.min()
|
||||
mean = np_times.mean()
|
||||
maximum = np_times.max()
|
||||
stddev = np_times.std()
|
||||
return minimum, mean, maximum, stddev
|
||||
|
||||
|
||||
def emit_summary(engine, times, migrations, migration):
|
||||
minimum, mean, maximum, stddev = analyse(times)
|
||||
failed_threshold = int(max(30.0, mean + stddev * 2))
|
||||
|
||||
failed = 0
|
||||
for time in times:
|
||||
if time > failed_threshold:
|
||||
failed += 1
|
||||
|
||||
migrations.setdefault(migration, {})
|
||||
migrations[migration][engine] = ('%.02f;%0.2f;%.02f'
|
||||
% (mean - 2 * stddev,
|
||||
mean,
|
||||
mean + 2 * stddev))
|
||||
|
||||
if failed_threshold != 30 or failed > 0:
|
||||
print ('%s: Values range from %s to %s seconds. %d values. '
|
||||
'Mean is %.02f, stddev is %.02f.\n '
|
||||
'Recommend max of %d. With this value %.02f%% of tests '
|
||||
'would have failed.'
|
||||
% (migration, minimum, maximum,
|
||||
len(times), mean, stddev, failed_threshold,
|
||||
failed * 100.0 / len(times)))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
sys.path.insert(0, os.path.abspath(
|
||||
os.path.join(os.path.dirname(__file__), '../')))
|
||||
|
Loading…
x
Reference in New Issue
Block a user