Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

log-search: Show duration.

Alex Vandiver65b99377d2d1
diff --git a/scripts/log-search b/scripts/log-search
index b85b2dbdc80..92379129fa0 100755
--- a/scripts/log-search
+++ b/scripts/log-search
@@ -281,6 +281,12 @@ def print_line(
ts = match["date"] + ":" + match["time"]
else:
ts = match["time"]
+
+ if match["duration"].endswith("ms"):
+ duration = match["duration"][:-2]
+ else:
+ duration = str(int(float(match["duration"][:-1]) * 1000))
+
code = int(match["code"])
indicator = " "
color = ""
@@ -312,6 +318,7 @@ def print_line(
parts = [
ts,
+ f"{duration:>5}ms",
f"{user_id:7}" if not args.nginx and filter_type != FilterType.USER_ID else None,
f"{match['ip']:39}" if filter_type != FilterType.CLIENT_IP else None,
indicator + match["code"],