From 23f9e73f19af1dbd582c69739b1495adb5f2b63f Mon Sep 17 00:00:00 2001 From: Alexander Metzger Date: Tue, 6 Feb 2024 21:41:34 -0800 Subject: [PATCH] temporarily hide response time --- bots/models.py | 7 ++----- recipes/VideoBotsStats.py | 27 --------------------------- 2 files changed, 2 insertions(+), 32 deletions(-) diff --git a/bots/models.py b/bots/models.py index e2c66148a..3a440ab73 100644 --- a/bots/models.py +++ b/bots/models.py @@ -935,10 +935,7 @@ def to_df_format( else None ), # only show first feedback as per Sean's request "Analysis JSON": message.analysis_result, - "Response Time": ( - message.response_time - and round(message.response_time.total_seconds(), 1) - ), + "Run Time": message.saved_run.run_time if message.saved_run else 0, # user messages have no run/run_time } rows.append(row) df = pd.DataFrame.from_records( @@ -950,7 +947,7 @@ def to_df_format( "Sent", "Feedback", "Analysis JSON", - "Response Time", + "Run Time", ], ) return df diff --git a/recipes/VideoBotsStats.py b/recipes/VideoBotsStats.py index 00c7f07dd..e7fea6c12 100644 --- a/recipes/VideoBotsStats.py +++ b/recipes/VideoBotsStats.py @@ -439,8 +439,6 @@ def calculate_stats_binned_by_time( ) ) .annotate(Average_runtime=Avg("saved_run__run_time")) - .annotate(Average_response_time=Avg("response_time")) - .annotate(Average_analysis_time=Avg("analysis_run__run_time")) .annotate(Unique_feedback_givers=Count("feedbacks", distinct=True)) .values( "date", @@ -448,9 +446,7 @@ def calculate_stats_binned_by_time( "Convos", "Senders", "Unique_feedback_givers", - "Average_response_time", "Average_runtime", - "Average_analysis_time", ) ) @@ -504,9 +500,7 @@ def calculate_stats_binned_by_time( "Convos", "Senders", "Unique_feedback_givers", - "Average_response_time", "Average_runtime", - "Average_analysis_time", ], ) df = df.merge( @@ -546,11 +540,6 @@ def calculate_stats_binned_by_time( ) * 100 df["Msgs_per_convo"] = df["Messages_Sent"] / df["Convos"] df["Msgs_per_user"] = df["Messages_Sent"] / df["Senders"] - try: - df["Average_response_time"] = df["Average_response_time"].dt.total_seconds() - except AttributeError: - pass - df["Average_response_time"] = df["Average_response_time"] * factor df.fillna(0, inplace=True) df = df.round(0).astype("int32", errors="ignore") return df @@ -699,14 +688,6 @@ def plot_graphs(self, view, df): st.write("---") fig = go.Figure( data=[ - go.Scatter( - name="Average Response Time", - mode="lines+markers", - x=list(df["date"]), - y=list(df["Average_response_time"]), - text=list(df["Average_response_time"]), - hovertemplate="Average Response Time: %{y:.0f}", - ), go.Scatter( name="Average Run Time", mode="lines+markers", @@ -715,14 +696,6 @@ def plot_graphs(self, view, df): text=list(df["Average_runtime"]), hovertemplate="Average Runtime: %{y:.0f}", ), - go.Scatter( - name="Average Analysis Time", - mode="lines+markers", - x=list(df["date"]), - y=list(df["Average_analysis_time"]), - text=list(df["Average_analysis_time"]), - hovertemplate="Average Analysis Time: %{y:.0f}", - ), ], layout=dict( margin=dict(l=0, r=0, t=28, b=0),