Skip to content

Commit

Permalink
temporarily hide response time
Browse files Browse the repository at this point in the history
  • Loading branch information
SanderGi authored and devxpy committed Feb 14, 2024
1 parent 709331d commit 23f9e73
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 32 deletions.
7 changes: 2 additions & 5 deletions bots/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -950,7 +947,7 @@ def to_df_format(
"Sent",
"Feedback",
"Analysis JSON",
"Response Time",
"Run Time",
],
)
return df
Expand Down
27 changes: 0 additions & 27 deletions recipes/VideoBotsStats.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,18 +439,14 @@ 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",
"Messages_Sent",
"Convos",
"Senders",
"Unique_feedback_givers",
"Average_response_time",
"Average_runtime",
"Average_analysis_time",
)
)

Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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}<extra></extra>",
),
go.Scatter(
name="Average Run Time",
mode="lines+markers",
Expand All @@ -715,14 +696,6 @@ def plot_graphs(self, view, df):
text=list(df["Average_runtime"]),
hovertemplate="Average Runtime: %{y:.0f}<extra></extra>",
),
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}<extra></extra>",
),
],
layout=dict(
margin=dict(l=0, r=0, t=28, b=0),
Expand Down

0 comments on commit 23f9e73

Please sign in to comment.