|
22 | 22 | ) |
23 | 23 | from redisbench_admin.run.git import git_vars_crosscheck |
24 | 24 | from redisbench_admin.run.grafana import generate_artifacts_table_grafana_redis |
| 25 | +from redisbench_admin.run.metrics import collect_redis_metrics |
25 | 26 | from redisbench_admin.run.modules import redis_modules_check |
26 | 27 | from redisbench_admin.run.redistimeseries import ( |
27 | 28 | timeseries_test_sucess_flow, |
|
46 | 47 | get_run_full_filename, |
47 | 48 | get_overall_dashboard_keynames, |
48 | 49 | check_ec2_env, |
| 50 | + get_project_ts_tags, |
| 51 | + push_data_to_redistimeseries, |
49 | 52 | ) |
50 | 53 |
|
51 | 54 | from redisbench_admin.utils.utils import ( |
@@ -373,6 +376,12 @@ def run_remote_command_logic(args, project_name, project_version): |
373 | 376 | db_ssh_port, |
374 | 377 | ) |
375 | 378 |
|
| 379 | + ( |
| 380 | + _, |
| 381 | + _, |
| 382 | + overall_start_time_metrics, |
| 383 | + ) = collect_redis_metrics(redis_conns) |
| 384 | + |
376 | 385 | ( |
377 | 386 | start_time, |
378 | 387 | start_time_ms, |
@@ -497,6 +506,78 @@ def run_remote_command_logic(args, project_name, project_version): |
497 | 506 | ) |
498 | 507 | ) |
499 | 508 |
|
| 509 | + ( |
| 510 | + end_time_ms, |
| 511 | + _, |
| 512 | + overall_end_time_metrics, |
| 513 | + ) = collect_redis_metrics(redis_conns) |
| 514 | + |
| 515 | + sprefix = "ci.benchmarks.redislabs/" + "{triggering_env}/{github_org}/{github_repo}".format( |
| 516 | + triggering_env=tf_triggering_env, |
| 517 | + github_org=tf_github_org, |
| 518 | + github_repo=tf_github_repo, |
| 519 | + ) |
| 520 | + logging.info( |
| 521 | + "Adding a total of {} server side metrics collected at the end of benchmark".format( |
| 522 | + len(list(overall_end_time_metrics.items())) |
| 523 | + ) |
| 524 | + ) |
| 525 | + timeseries_dict = {} |
| 526 | + by_variants = {} |
| 527 | + if tf_github_branch is not None: |
| 528 | + by_variants[ |
| 529 | + "by.branch/{}".format(tf_github_branch) |
| 530 | + ] = {"branch": tf_github_branch} |
| 531 | + if artifact_version is not None: |
| 532 | + by_variants[ |
| 533 | + "by.version/{}".format(artifact_version) |
| 534 | + ] = {"version": artifact_version} |
| 535 | + for ( |
| 536 | + by_variant, |
| 537 | + variant_labels_dict, |
| 538 | + ) in by_variants.items(): |
| 539 | + for ( |
| 540 | + metric_name, |
| 541 | + metric_value, |
| 542 | + ) in overall_end_time_metrics.items(): |
| 543 | + tsname_metric = ( |
| 544 | + "{}/{}/{}/benchmark_end/{}".format( |
| 545 | + sprefix, |
| 546 | + test_name, |
| 547 | + by_variant, |
| 548 | + metric_name, |
| 549 | + ) |
| 550 | + ) |
| 551 | + |
| 552 | + logging.debug( |
| 553 | + "Adding a redis server side metric collected at the end of benchmark." |
| 554 | + + " metric_name={} metric_value={} time-series name: {}".format( |
| 555 | + metric_name, |
| 556 | + metric_value, |
| 557 | + tsname_metric, |
| 558 | + ) |
| 559 | + ) |
| 560 | + variant_labels_dict["test_name"] = test_name |
| 561 | + variant_labels_dict["metric"] = metric_name |
| 562 | + |
| 563 | + timeseries_dict[tsname_metric] = { |
| 564 | + "labels": get_project_ts_tags( |
| 565 | + tf_github_org, |
| 566 | + tf_github_repo, |
| 567 | + setup_name, |
| 568 | + setup_type, |
| 569 | + tf_triggering_env, |
| 570 | + variant_labels_dict, |
| 571 | + None, |
| 572 | + None, |
| 573 | + ), |
| 574 | + "data": {end_time_ms: metric_value}, |
| 575 | + } |
| 576 | + if args.push_results_redistimeseries: |
| 577 | + push_data_to_redistimeseries( |
| 578 | + rts, timeseries_dict |
| 579 | + ) |
| 580 | + |
500 | 581 | if setup_details["env"] is None: |
501 | 582 | if args.keep_env_and_topo is False: |
502 | 583 | shutdown_remote_redis( |
@@ -573,6 +654,11 @@ def run_remote_command_logic(args, project_name, project_version): |
573 | 654 | branch_tt_keyname, |
574 | 655 | branch_target_table, |
575 | 656 | ) in branch_target_tables.items(): |
| 657 | + if ( |
| 658 | + "contains-target" |
| 659 | + not in branch_target_table |
| 660 | + ): |
| 661 | + continue |
576 | 662 | if ( |
577 | 663 | branch_target_table["contains-target"] |
578 | 664 | is True |
|
0 commit comments