stgleb | 75c7041 | 2015-02-17 02:52:00 +0200 | [diff] [blame] | 1 | import datetime |
gstepanov | 501151a | 2015-03-06 17:22:28 +0200 | [diff] [blame] | 2 | from data_processing import Measurement, create_measurement, process_build_data |
stgleb | 75c7041 | 2015-02-17 02:52:00 +0200 | [diff] [blame] | 3 | from flask import json |
gstepanov | e6ad1f0 | 2015-03-02 19:58:00 +0200 | [diff] [blame] | 4 | from meta_info import collect_lab_data, total_lab_info |
stgleb | 75c7041 | 2015-02-17 02:52:00 +0200 | [diff] [blame] | 5 | from sqlalchemy import sql |
| 6 | from persistance.models import * |
| 7 | |
| 8 | |
gstepanov | 15681d6 | 2015-02-23 17:17:50 +0200 | [diff] [blame] | 9 | def get_build_info(build_name): |
| 10 | session = db.session() |
gstepanov | e6ad1f0 | 2015-03-02 19:58:00 +0200 | [diff] [blame] | 11 | result = session.query(Result, Build).join(Build).\ |
| 12 | filter(Build.name == build_name).first() |
gstepanov | 15681d6 | 2015-02-23 17:17:50 +0200 | [diff] [blame] | 13 | lab = session.query(Lab).filter(Lab.id == result[0].lab_id).first() |
| 14 | return eval(lab.lab_general_info) |
| 15 | |
| 16 | |
| 17 | def get_build_detailed_info(build_name): |
| 18 | data = get_build_info(build_name) |
| 19 | return total_lab_info(data) |
| 20 | |
| 21 | |
stgleb | 75c7041 | 2015-02-17 02:52:00 +0200 | [diff] [blame] | 22 | def add_io_params(session): |
gstepanov | 501151a | 2015-03-06 17:22:28 +0200 | [diff] [blame] | 23 | """Filling Param table with initial parameters. """ |
| 24 | |
gstepanov | e6ad1f0 | 2015-03-02 19:58:00 +0200 | [diff] [blame] | 25 | param1 = Param(name="operation", type='{"write", "randwrite", ' |
| 26 | '"read", "randread"}', |
| 27 | descr="type of write operation") |
| 28 | param2 = Param(name="sync", type='{"a", "s"}', |
| 29 | descr="Write mode synchronous/asynchronous") |
| 30 | param3 = Param(name="block size", |
| 31 | type='{"1k", "2k", "4k", "8k", "16k", ' |
| 32 | '"32k", "64k", "128k", "256k"}') |
stgleb | 75c7041 | 2015-02-17 02:52:00 +0200 | [diff] [blame] | 33 | |
| 34 | session.add(param1) |
| 35 | session.add(param2) |
| 36 | session.add(param3) |
| 37 | |
| 38 | session.commit() |
| 39 | |
| 40 | |
stgleb | 75c7041 | 2015-02-17 02:52:00 +0200 | [diff] [blame] | 41 | def add_build(session, build_id, build_name, build_type, md5): |
gstepanov | 501151a | 2015-03-06 17:22:28 +0200 | [diff] [blame] | 42 | """Function which adds particular build to database.""" |
| 43 | |
gstepanov | e6ad1f0 | 2015-03-02 19:58:00 +0200 | [diff] [blame] | 44 | build = Build(type=build_type, build_id=build_id, |
| 45 | name=build_name, md5=md5) |
stgleb | 75c7041 | 2015-02-17 02:52:00 +0200 | [diff] [blame] | 46 | session.add(build) |
| 47 | session.commit() |
| 48 | |
| 49 | return build.id |
| 50 | |
| 51 | |
stgleb | 75c7041 | 2015-02-17 02:52:00 +0200 | [diff] [blame] | 52 | def insert_results(session, build_id, lab_id, params_combination_id, |
| 53 | time=None, bandwith=0.0, meta=""): |
gstepanov | 501151a | 2015-03-06 17:22:28 +0200 | [diff] [blame] | 54 | """Function insert particular result. """ |
| 55 | |
gstepanov | e6ad1f0 | 2015-03-02 19:58:00 +0200 | [diff] [blame] | 56 | result = Result(build_id=build_id, lab_id=lab_id, |
| 57 | params_combination_id=params_combination_id, time=time, |
stgleb | 75c7041 | 2015-02-17 02:52:00 +0200 | [diff] [blame] | 58 | bandwith=bandwith, meta=meta) |
| 59 | session.add(result) |
| 60 | session.commit() |
| 61 | |
| 62 | |
stgleb | 75c7041 | 2015-02-17 02:52:00 +0200 | [diff] [blame] | 63 | def add_param_comb(session, *params): |
gstepanov | 501151a | 2015-03-06 17:22:28 +0200 | [diff] [blame] | 64 | """function responsible for adding particular params |
| 65 | combination to database""" |
| 66 | |
gstepanov | e6ad1f0 | 2015-03-02 19:58:00 +0200 | [diff] [blame] | 67 | params_names = sorted([s for s in dir(ParamCombination) |
| 68 | if s.startswith('param_')]) |
stgleb | 75c7041 | 2015-02-17 02:52:00 +0200 | [diff] [blame] | 69 | d = zip(params_names, params) |
| 70 | where = "" |
| 71 | |
| 72 | for item in d: |
| 73 | where = sql.and_(where, getattr(ParamCombination, item[0]) == item[1]) |
| 74 | |
| 75 | query = session.query(ParamCombination).filter(where) |
| 76 | rs = session.execute(query).fetchall() |
| 77 | |
stgleb | 75c7041 | 2015-02-17 02:52:00 +0200 | [diff] [blame] | 78 | if len(rs) == 0: |
| 79 | param_comb = ParamCombination() |
| 80 | |
| 81 | for p in params_names: |
| 82 | i = int(p.split('_')[1]) |
stgleb | 75c7041 | 2015-02-17 02:52:00 +0200 | [diff] [blame] | 83 | |
gstepanov | e6ad1f0 | 2015-03-02 19:58:00 +0200 | [diff] [blame] | 84 | if i - 1 < len(params): |
| 85 | param_comb.__setattr__('param_' + str(i), params[i - 1]) |
| 86 | param = session.query(Param).filter(Param.id == i).one() |
| 87 | values = eval(param.type) |
stgleb | 75c7041 | 2015-02-17 02:52:00 +0200 | [diff] [blame] | 88 | |
gstepanov | e6ad1f0 | 2015-03-02 19:58:00 +0200 | [diff] [blame] | 89 | if params[i - 1] not in values: |
| 90 | values.add(params[i - 1]) |
| 91 | param.type = str(values) |
stgleb | 75c7041 | 2015-02-17 02:52:00 +0200 | [diff] [blame] | 92 | |
| 93 | session.add(param_comb) |
| 94 | session.commit() |
| 95 | return param_comb.id |
| 96 | else: |
| 97 | return rs[0][0] |
| 98 | |
| 99 | |
gstepanov | e6ad1f0 | 2015-03-02 19:58:00 +0200 | [diff] [blame] | 100 | def add_lab(session, lab_url, lab_name, ceph_version, |
| 101 | fuel_version, data, info): |
gstepanov | 501151a | 2015-03-06 17:22:28 +0200 | [diff] [blame] | 102 | """ Function add data about particular lab""" |
gstepanov | 15681d6 | 2015-02-23 17:17:50 +0200 | [diff] [blame] | 103 | result = session.query(Lab).filter(Lab.name == lab_name).all() |
stgleb | 75c7041 | 2015-02-17 02:52:00 +0200 | [diff] [blame] | 104 | |
gstepanov | 15681d6 | 2015-02-23 17:17:50 +0200 | [diff] [blame] | 105 | if len(result) != 0: |
| 106 | return result[0].id |
| 107 | else: |
| 108 | lab = Lab(name=lab_name, url=lab_url, ceph_version=ceph_version, |
gstepanov | e6ad1f0 | 2015-03-02 19:58:00 +0200 | [diff] [blame] | 109 | fuel_version=fuel_version, lab_general_info=str(data), |
| 110 | lab_meta=str(info)) |
gstepanov | 15681d6 | 2015-02-23 17:17:50 +0200 | [diff] [blame] | 111 | session.add(lab) |
| 112 | session.commit() |
| 113 | return lab.id |
stgleb | 75c7041 | 2015-02-17 02:52:00 +0200 | [diff] [blame] | 114 | |
gstepanov | e6ad1f0 | 2015-03-02 19:58:00 +0200 | [diff] [blame] | 115 | |
stgleb | 75c7041 | 2015-02-17 02:52:00 +0200 | [diff] [blame] | 116 | def add_data(data): |
gstepanov | 501151a | 2015-03-06 17:22:28 +0200 | [diff] [blame] | 117 | """Function store list of builds in database""" |
| 118 | |
stgleb | 75c7041 | 2015-02-17 02:52:00 +0200 | [diff] [blame] | 119 | data = json.loads(data) |
| 120 | session = db.session() |
| 121 | add_io_params(session) |
| 122 | |
| 123 | for build_data in data: |
| 124 | build_id = add_build(session, |
| 125 | build_data.pop("build_id"), |
| 126 | build_data.pop("name"), |
| 127 | build_data.pop("type"), |
| 128 | build_data.pop("iso_md5"), |
| 129 | ) |
gstepanov | e6ad1f0 | 2015-03-02 19:58:00 +0200 | [diff] [blame] | 130 | |
gstepanov | 15681d6 | 2015-02-23 17:17:50 +0200 | [diff] [blame] | 131 | creds = {"username": build_data.pop("username"), |
| 132 | "password": build_data.pop("password"), |
gstepanov | e6ad1f0 | 2015-03-02 19:58:00 +0200 | [diff] [blame] | 133 | "tenant_name": build_data.pop("tenant_name")} |
| 134 | |
gstepanov | 15681d6 | 2015-02-23 17:17:50 +0200 | [diff] [blame] | 135 | lab_url = build_data.pop("lab_url") |
| 136 | lab_name = build_data.pop("lab_name") |
| 137 | ceph_version = build_data.pop("ceph_version") |
| 138 | data = collect_lab_data(lab_url, creds) |
| 139 | data['name'] = lab_name |
| 140 | info = total_lab_info(data) |
| 141 | lab_id = add_lab(session, lab_url=lab_name, lab_name=lab_url, |
gstepanov | e6ad1f0 | 2015-03-02 19:58:00 +0200 | [diff] [blame] | 142 | ceph_version=ceph_version, |
| 143 | fuel_version=data['fuel_version'], |
| 144 | data=data, info=info) |
gstepanov | 15681d6 | 2015-02-23 17:17:50 +0200 | [diff] [blame] | 145 | |
stgleb | 75c7041 | 2015-02-17 02:52:00 +0200 | [diff] [blame] | 146 | date = build_data.pop("date") |
| 147 | date = datetime.datetime.strptime(date, "%a %b %d %H:%M:%S %Y") |
| 148 | |
| 149 | for params, [bw, dev] in build_data.items(): |
| 150 | param_comb_id = add_param_comb(session, *params.split(" ")) |
gstepanov | e6ad1f0 | 2015-03-02 19:58:00 +0200 | [diff] [blame] | 151 | result = Result(param_combination_id=param_comb_id, |
| 152 | build_id=build_id, bandwith=bw, |
| 153 | date=date, lab_id=lab_id) |
stgleb | 75c7041 | 2015-02-17 02:52:00 +0200 | [diff] [blame] | 154 | session.add(result) |
| 155 | session.commit() |
| 156 | |
| 157 | |
gstepanov | e6ad1f0 | 2015-03-02 19:58:00 +0200 | [diff] [blame] | 158 | def load_data(lab_id=None, build_id=None, *params): |
gstepanov | 501151a | 2015-03-06 17:22:28 +0200 | [diff] [blame] | 159 | """ Function loads data by parameters described in *params tuple.""" |
| 160 | |
stgleb | 75c7041 | 2015-02-17 02:52:00 +0200 | [diff] [blame] | 161 | session = db.session() |
gstepanov | e6ad1f0 | 2015-03-02 19:58:00 +0200 | [diff] [blame] | 162 | params_names = sorted([s for s in dir(ParamCombination) |
| 163 | if s.startswith('param_')]) |
stgleb | 75c7041 | 2015-02-17 02:52:00 +0200 | [diff] [blame] | 164 | d = zip(params_names, params) |
| 165 | where = "" |
| 166 | |
| 167 | for item in d: |
| 168 | where = sql.and_(where, getattr(ParamCombination, item[0]) == item[1]) |
| 169 | |
| 170 | query = session.query(ParamCombination).filter(where) |
| 171 | rs = session.execute(query).fetchall() |
| 172 | |
| 173 | ids = [r[0] for r in rs] |
| 174 | |
gstepanov | e6ad1f0 | 2015-03-02 19:58:00 +0200 | [diff] [blame] | 175 | rs = session.query(Result).\ |
| 176 | filter(Result.param_combination_id.in_(ids)).all() |
stgleb | 75c7041 | 2015-02-17 02:52:00 +0200 | [diff] [blame] | 177 | |
gstepanov | e6ad1f0 | 2015-03-02 19:58:00 +0200 | [diff] [blame] | 178 | if lab_id is not None: |
| 179 | rs = [r for r in rs if r.lab_id == lab_id] |
| 180 | |
| 181 | if build_id is not None: |
| 182 | rs = [r for r in rs if r.build_id == build_id] |
| 183 | |
| 184 | return rs |
stgleb | 75c7041 | 2015-02-17 02:52:00 +0200 | [diff] [blame] | 185 | |
| 186 | |
stgleb | 75c7041 | 2015-02-17 02:52:00 +0200 | [diff] [blame] | 187 | def load_all(): |
gstepanov | 501151a | 2015-03-06 17:22:28 +0200 | [diff] [blame] | 188 | """Load all builds from database""" |
| 189 | |
stgleb | 75c7041 | 2015-02-17 02:52:00 +0200 | [diff] [blame] | 190 | session = db.session() |
gstepanov | e6ad1f0 | 2015-03-02 19:58:00 +0200 | [diff] [blame] | 191 | results = session.query(Result, Build, ParamCombination).\ |
| 192 | join(Build).join(ParamCombination).all() |
stgleb | 75c7041 | 2015-02-17 02:52:00 +0200 | [diff] [blame] | 193 | |
| 194 | return results |
| 195 | |
| 196 | |
stgleb | 75c7041 | 2015-02-17 02:52:00 +0200 | [diff] [blame] | 197 | def collect_builds_from_db(*names): |
gstepanov | 501151a | 2015-03-06 17:22:28 +0200 | [diff] [blame] | 198 | """ Function collecting all builds from database and filter it by names""" |
| 199 | |
stgleb | 75c7041 | 2015-02-17 02:52:00 +0200 | [diff] [blame] | 200 | results = load_all() |
| 201 | d = {} |
| 202 | |
| 203 | for item in results: |
| 204 | result_data = item[0] |
| 205 | build_data = item[1] |
| 206 | param_combination_data = item[2] |
| 207 | |
| 208 | if build_data.name not in d: |
gstepanov | e6ad1f0 | 2015-03-02 19:58:00 +0200 | [diff] [blame] | 209 | d[build_data.name] = \ |
| 210 | [build_data, result_data, param_combination_data] |
stgleb | 75c7041 | 2015-02-17 02:52:00 +0200 | [diff] [blame] | 211 | else: |
| 212 | d[build_data.name].append(result_data) |
| 213 | d[build_data.name].append(param_combination_data) |
| 214 | |
| 215 | if len(names) == 0: |
| 216 | return {k: v for k, v in d.items()} |
| 217 | |
| 218 | return {k: v for k, v in d.items() if k in names} |
| 219 | |
| 220 | |
stgleb | 75c7041 | 2015-02-17 02:52:00 +0200 | [diff] [blame] | 221 | def prepare_build_data(build_name): |
gstepanov | 501151a | 2015-03-06 17:22:28 +0200 | [diff] [blame] | 222 | """ |
| 223 | #function preparing data for display plots. |
| 224 | #Format {build_name : Measurement} |
| 225 | """ |
| 226 | |
stgleb | 75c7041 | 2015-02-17 02:52:00 +0200 | [diff] [blame] | 227 | session = db.session() |
| 228 | build = session.query(Build).filter(Build.name == build_name).first() |
| 229 | names = [] |
| 230 | |
| 231 | if build.type == 'GA': |
| 232 | names = [build_name] |
| 233 | else: |
gstepanov | e6ad1f0 | 2015-03-02 19:58:00 +0200 | [diff] [blame] | 234 | res = session.query(Build).\ |
| 235 | filter(Build.type.in_(['GA', 'master', build.type])).all() |
stgleb | 75c7041 | 2015-02-17 02:52:00 +0200 | [diff] [blame] | 236 | for r in res: |
| 237 | names.append(r.name) |
| 238 | |
stgleb | 75c7041 | 2015-02-17 02:52:00 +0200 | [diff] [blame] | 239 | d = collect_builds_from_db() |
| 240 | d = {k: v for k, v in d.items() if k in names} |
| 241 | results = {} |
| 242 | |
| 243 | for data in d.keys(): |
| 244 | m = create_measurement(d[data]) |
| 245 | results[m.build_type] = m |
| 246 | |
| 247 | return results |
| 248 | |
| 249 | |
stgleb | 75c7041 | 2015-02-17 02:52:00 +0200 | [diff] [blame] | 250 | def builds_list(): |
gstepanov | 501151a | 2015-03-06 17:22:28 +0200 | [diff] [blame] | 251 | """ |
| 252 | Function getting list of all builds available to index page |
| 253 | returns list of dicts which contains data to display on index page. |
| 254 | """ |
| 255 | |
stgleb | 75c7041 | 2015-02-17 02:52:00 +0200 | [diff] [blame] | 256 | res = [] |
| 257 | builds = set() |
| 258 | data = load_all() |
| 259 | |
| 260 | for item in data: |
| 261 | build = item[1] |
| 262 | result = item[0] |
| 263 | |
| 264 | if not build.name in builds: |
| 265 | builds.add(build.name) |
| 266 | d = {} |
| 267 | d["type"] = build.type |
| 268 | d["url"] = build.name |
| 269 | d["date"] = result.date |
| 270 | d["name"] = build.name |
| 271 | res.append(d) |
| 272 | |
| 273 | return res |
| 274 | |
| 275 | |
stgleb | 75c7041 | 2015-02-17 02:52:00 +0200 | [diff] [blame] | 276 | def get_builds_data(names=None): |
gstepanov | 501151a | 2015-03-06 17:22:28 +0200 | [diff] [blame] | 277 | """ |
| 278 | Processing data from database. |
| 279 | List of dicts, where each dict contains build meta |
| 280 | info and kev-value measurements. |
| 281 | key - param combination. |
| 282 | value - [mean, deviation] |
| 283 | """ |
| 284 | |
stgleb | 75c7041 | 2015-02-17 02:52:00 +0200 | [diff] [blame] | 285 | d = collect_builds_from_db() |
| 286 | |
| 287 | if not names is None: |
| 288 | d = {k: v for k, v in d.items() if k in names} |
| 289 | else: |
| 290 | d = {k: v for k, v in d.items()} |
| 291 | output = [] |
| 292 | |
| 293 | for key, value in d.items(): |
| 294 | result = {} |
| 295 | build = value[0] |
| 296 | result["build_id"] = build.build_id |
| 297 | result["iso_md5"] = build.md5 |
| 298 | result["type"] = build.type |
| 299 | result["date"] = "Date must be here" |
| 300 | |
| 301 | for i in range(1, len(value), 2): |
| 302 | r = value[i] |
| 303 | param_combination = value[i + 1] |
| 304 | |
| 305 | if not str(param_combination) in result: |
| 306 | result[str(param_combination)] = [r.bandwith] |
| 307 | else: |
| 308 | result[str(param_combination)].append(r.bandwith) |
| 309 | |
| 310 | output.append(result) |
| 311 | |
| 312 | for build in output: |
| 313 | process_build_data(build) |
| 314 | |
| 315 | return output |
| 316 | |
| 317 | |
stgleb | 75c7041 | 2015-02-17 02:52:00 +0200 | [diff] [blame] | 318 | def get_data_for_table(build_name=""): |
gstepanov | 501151a | 2015-03-06 17:22:28 +0200 | [diff] [blame] | 319 | """ Function for getting result to display table """ |
| 320 | |
stgleb | 75c7041 | 2015-02-17 02:52:00 +0200 | [diff] [blame] | 321 | session = db.session() |
| 322 | build = session.query(Build).filter(Build.name == build_name).one() |
| 323 | names = [] |
| 324 | |
gstepanov | e6ad1f0 | 2015-03-02 19:58:00 +0200 | [diff] [blame] | 325 | # Get names of build that we need. |
stgleb | 75c7041 | 2015-02-17 02:52:00 +0200 | [diff] [blame] | 326 | if build.type == 'GA': |
| 327 | names = [build_name] |
| 328 | else: |
gstepanov | e6ad1f0 | 2015-03-02 19:58:00 +0200 | [diff] [blame] | 329 | res = session.query(Build).filter( |
| 330 | Build.type.in_(['GA', 'master', build.type])).all() |
stgleb | 75c7041 | 2015-02-17 02:52:00 +0200 | [diff] [blame] | 331 | for r in res: |
| 332 | names.append(r.name) |
gstepanov | e6ad1f0 | 2015-03-02 19:58:00 +0200 | [diff] [blame] | 333 | # get data for particular builds. |
stgleb | 75c7041 | 2015-02-17 02:52:00 +0200 | [diff] [blame] | 334 | return get_builds_data(names) |
| 335 | |
| 336 | |
| 337 | if __name__ == '__main__': |
| 338 | # add_build("Some build", "GA", "bla bla") |
gstepanov | 15681d6 | 2015-02-23 17:17:50 +0200 | [diff] [blame] | 339 | cred = {"username": "admin", "password": "admin", "tenant_name": "admin"} |
stgleb | 75c7041 | 2015-02-17 02:52:00 +0200 | [diff] [blame] | 340 | json_data = '[{\ |
gstepanov | 15681d6 | 2015-02-23 17:17:50 +0200 | [diff] [blame] | 341 | "username": "admin",\ |
| 342 | "password": "admin", \ |
| 343 | "tenant_name": "admin",\ |
| 344 | "lab_url": "http://172.16.52.112:8000",\ |
| 345 | "lab_name": "Perf-1-Env",\ |
| 346 | "ceph_version": "v0.80 Firefly",\ |
stgleb | 75c7041 | 2015-02-17 02:52:00 +0200 | [diff] [blame] | 347 | "randwrite a 256k": [16885, 1869],\ |
| 348 | "randwrite s 4k": [79, 2],\ |
| 349 | "read a 64k": [74398, 11618],\ |
| 350 | "write s 1024k": [7490, 193],\ |
| 351 | "randwrite a 64k": [14167, 4665],\ |
| 352 | "build_id": "1",\ |
| 353 | "randread a 1024k": [68683, 8604],\ |
| 354 | "randwrite s 256k": [3277, 146],\ |
| 355 | "write a 1024k": [24069, 660],\ |
| 356 | "type": "GA",\ |
| 357 | "write a 64k": [24555, 1006],\ |
| 358 | "write s 64k": [1285, 57],\ |
| 359 | "write a 256k": [24928, 503],\ |
| 360 | "write s 256k": [4029, 192],\ |
| 361 | "randwrite a 1024k": [23980, 1897],\ |
| 362 | "randread a 64k": [27257, 17268],\ |
| 363 | "randwrite s 1024k": [8504, 238],\ |
| 364 | "randread a 256k": [60868, 2637],\ |
| 365 | "randread a 4k": [3612, 1355],\ |
| 366 | "read a 1024k": [71122, 9217],\ |
| 367 | "date": "Thu Feb 12 19:11:56 2015",\ |
| 368 | "write s 4k": [87, 3],\ |
| 369 | "read a 4k": [88367, 6471],\ |
| 370 | "read a 256k": [80904, 8930],\ |
| 371 | "name": "GA - 6.0 GA",\ |
| 372 | "randwrite s 1k": [20, 0],\ |
| 373 | "randwrite s 64k": [1029, 34],\ |
| 374 | "write s 1k": [21, 0],\ |
| 375 | "iso_md5": "bla bla"\ |
| 376 | },\ |
| 377 | {\ |
gstepanov | 15681d6 | 2015-02-23 17:17:50 +0200 | [diff] [blame] | 378 | "username": "admin",\ |
| 379 | "password": "admin", \ |
| 380 | "tenant_name": "admin",\ |
| 381 | "lab_url": "http://172.16.52.112:8000",\ |
| 382 | "ceph_version": "v0.80 Firefly",\ |
| 383 | "lab_name": "Perf-1-Env",\ |
stgleb | 75c7041 | 2015-02-17 02:52:00 +0200 | [diff] [blame] | 384 | "randwrite a 256k": [20212, 5690],\ |
| 385 | "randwrite s 4k": [83, 6],\ |
| 386 | "read a 64k": [89394, 3912],\ |
| 387 | "write s 1024k": [8054, 280],\ |
| 388 | "randwrite a 64k": [14595, 3245],\ |
| 389 | "build_id": "2",\ |
| 390 | "randread a 1024k": [83277, 9310],\ |
| 391 | "randwrite s 256k": [3628, 433],\ |
| 392 | "write a 1024k": [29226, 8624],\ |
| 393 | "type": "master",\ |
| 394 | "write a 64k": [25089, 790],\ |
| 395 | "write s 64k": [1236, 30],\ |
| 396 | "write a 256k": [30327, 9799],\ |
| 397 | "write s 256k": [4049, 172],\ |
| 398 | "randwrite a 1024k": [29000, 9302],\ |
| 399 | "randread a 64k": [26775, 16319],\ |
| 400 | "randwrite s 1024k": [8665, 1457],\ |
| 401 | "randread a 256k": [63608, 16126],\ |
| 402 | "randread a 4k": [3212, 1620],\ |
| 403 | "read a 1024k": [89676, 4401],\ |
| 404 | "date": "Thu Feb 12 19:11:56 2015",\ |
| 405 | "write s 4k": [88, 3],\ |
| 406 | "read a 4k": [92263, 5186],\ |
| 407 | "read a 256k": [94505, 6868],\ |
| 408 | "name": "6.1 Dev",\ |
| 409 | "randwrite s 1k": [22, 3],\ |
| 410 | "randwrite s 64k": [1105, 46],\ |
| 411 | "write s 1k": [22, 0],\ |
| 412 | "iso_md5": "bla bla"\ |
| 413 | },\ |
| 414 | {\ |
gstepanov | 15681d6 | 2015-02-23 17:17:50 +0200 | [diff] [blame] | 415 | "username": "admin",\ |
| 416 | "password": "admin", \ |
| 417 | "tenant_name": "admin",\ |
| 418 | "lab_url": "http://172.16.52.112:8000",\ |
| 419 | "ceph_version": "v0.80 Firefly",\ |
| 420 | "lab_name": "Perf-1-Env",\ |
stgleb | 75c7041 | 2015-02-17 02:52:00 +0200 | [diff] [blame] | 421 | "randwrite a 256k": [16885, 1869],\ |
| 422 | "randwrite s 4k": [79, 2],\ |
| 423 | "read a 64k": [74398, 11618],\ |
| 424 | "write s 1024k": [7490, 193],\ |
| 425 | "randwrite a 64k": [14167, 4665],\ |
| 426 | "build_id": "1",\ |
| 427 | "randread a 1024k": [68683, 8604],\ |
| 428 | "randwrite s 256k": [3277, 146],\ |
| 429 | "write a 1024k": [24069, 660],\ |
| 430 | "type": "sometype",\ |
| 431 | "write a 64k": [24555, 1006],\ |
| 432 | "write s 64k": [1285, 57],\ |
| 433 | "write a 256k": [24928, 503],\ |
| 434 | "write s 256k": [4029, 192],\ |
| 435 | "randwrite a 1024k": [23980, 1897],\ |
| 436 | "randread a 64k": [27257, 17268],\ |
| 437 | "randwrite s 1024k": [8504, 238],\ |
| 438 | "randread a 256k": [60868, 2637],\ |
| 439 | "randread a 4k": [3612, 1355],\ |
| 440 | "read a 1024k": [71122, 9217],\ |
| 441 | "date": "Thu Feb 12 19:11:56 2015",\ |
| 442 | "write s 4k": [87, 3],\ |
| 443 | "read a 4k": [88367, 6471],\ |
| 444 | "read a 256k": [80904, 8930],\ |
| 445 | "name": "somedev",\ |
| 446 | "randwrite s 1k": [20, 0],\ |
| 447 | "randwrite s 64k": [1029, 34],\ |
| 448 | "write s 1k": [21, 0],\ |
| 449 | "iso_md5": "bla bla"\ |
| 450 | }]' |
| 451 | |
| 452 | # json_to_db(json_data) |
gstepanov | e6ad1f0 | 2015-03-02 19:58:00 +0200 | [diff] [blame] | 453 | print load_data(1, 2) |
| 454 | # add_data(json_data) |