diff --git a/es_stream_logs.py b/es_stream_logs.py index 6eb05be..2a6ff3b 100644 --- a/es_stream_logs.py +++ b/es_stream_logs.py @@ -399,7 +399,7 @@ async def aggregation_svg(es, request: Request, query: Query): bucket_data['sub_buckets'].insert(0, { 'key': f"no value for {query.aggregation_terms}", 'count': amount, - 'percentage': f"{(amount/max_count) * 100:.2f}%", + 'percentage': f"{(amount / max_count) * 100:.2f}%", 'height': int((amount / max_count) * 100), 'offset_y': offset_y - int((amount / max_count) * 100), 'color': '#dddddd', @@ -418,7 +418,7 @@ async def aggregation_svg(es, request: Request, query: Query): continue pos_y = 100 - scale_percentile.map(value) if width_scale: - percentile_lines[percentile] += f" {width_scale.map(bucket_data['pos_x']+bucket_width/2)},{pos_y/100 * height}" + percentile_lines[percentile] += f" {width_scale.map(bucket_data['pos_x'] + bucket_width / 2)},{pos_y / 100 * height}" percentile = float(percentile) pretty_percentile = int(percentile) if percentile.is_integer() else percentile diff --git a/tinygraph.py b/tinygraph.py index 858810f..9a893d4 100644 --- a/tinygraph.py +++ b/tinygraph.py @@ -91,5 +91,5 @@ def pretty_duration(duration_s: int): elif duration_s < 24 * HOUR: fmt = f"{duration_s // HOUR}h" else: - fmt = f"{duration_s // (24*HOUR)}d" + fmt = f"{duration_s // (24 * HOUR)}d" return fmt