Skip to content

Commit

Permalink
fixed fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
fcostaoliveira committed Jan 29, 2025
1 parent 7e8b5ff commit 57fcb06
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions redis_benchmarks_specification/__cli__/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from redis_benchmarks_specification.__common__.runner import get_benchmark_specs



# logging settings
logging.basicConfig(
format="%(asctime)s %(levelname)-4s %(message)s",
Expand All @@ -19,7 +18,7 @@


def clean_number(value):
""" Cleans and converts numeric values from CSV, handling B (billion), M (million), K (thousand). """
"""Cleans and converts numeric values from CSV, handling B (billion), M (million), K (thousand)."""
try:
value = value.replace(",", "").strip() # Remove commas and spaces

Expand All @@ -40,6 +39,7 @@ def clean_number(value):
logging.error(f"Skipping invalid count value: {value}")
return 0 # Default to 0 if invalid


def get_arg_value(args, flag, default):
"""Extract integer values safely from CLI arguments"""
if flag in args:
Expand Down Expand Up @@ -207,12 +207,12 @@ def generate_stats_cli_command_logic(args, project_name, project_version):

group = command_json["group"]
if group not in tested_groups:

tested_groups.append(group)
if group not in tracked_groups:
tracked_groups.append(group)
tracked_groups_hist[group]=0
tracked_groups_hist[group]=tracked_groups_hist[group]+1
tracked_groups_hist[group] = 0
tracked_groups_hist[group] = tracked_groups_hist[group] + 1

# Calculate total connections
total_connections = clients * threads
Expand Down Expand Up @@ -562,11 +562,15 @@ def generate_stats_cli_command_logic(args, project_name, project_version):
logging.info("Top 10 fully tracked?: {}".format(len(top_10_missing) == 0))
logging.info("Top 30 fully tracked?: {}".format(len(top_30_missing) == 0))
if len(top_30_missing) > 0:
logging.info(f"\t\tTotal missing for Top 30: {len(top_30_missing)}. {top_30_missing}")
logging.info(
f"\t\tTotal missing for Top 30: {len(top_30_missing)}. {top_30_missing}"
)

logging.info("Top 50 fully tracked?: {}".format(len(top_50_missing) == 0))
if len(top_50_missing) > 0:
logging.info(f"\t\tTotal missing for Top 50: {len(top_50_missing)}. {top_50_missing}")
logging.info(
f"\t\tTotal missing for Top 50: {len(top_50_missing)}. {top_50_missing}"
)

if overall_result is False and fail_on_required_diff:
logging.error(
Expand Down

0 comments on commit 57fcb06

Please sign in to comment.