remote-activity: Display latest audit log update for remote server.

Since the latest end time for reported active users on a remote
server is not used to determine if a remote server has current
data for billing purposes, we instead display the last audit log
update datetime for the remote server object.

Removes the note in the remote activity key about the Zulip
version.

Also adds a sum in the total row for mobile push notifications
sent.
This commit is contained in:
Lauryn Menard
2024-01-03 19:32:04 +01:00
committed by Tim Abbott
parent 2e7715e522
commit 4143101637
2 changed files with 5 additions and 7 deletions

View File

@@ -36,8 +36,7 @@ def get_remote_server_activity(request: HttpRequest) -> HttpResponse:
icount as ( icount as (
select select
icount_id.server_id, icount_id.server_id,
value as latest_value, value as latest_value
end_time as latest_end_time
from icount_id from icount_id
join zilencer_remoteinstallationcount join zilencer_remoteinstallationcount
on max_count_id = zilencer_remoteinstallationcount.id on max_count_id = zilencer_remoteinstallationcount.id
@@ -64,9 +63,9 @@ def get_remote_server_activity(request: HttpRequest) -> HttpResponse:
rserver.hostname, rserver.hostname,
rserver.contact_email, rserver.contact_email,
rserver.last_version, rserver.last_version,
rserver.last_audit_log_update,
latest_value, latest_value,
push_user_count, push_user_count,
latest_end_time,
push_forwarded_count push_forwarded_count
from zilencer_remotezulipserver rserver from zilencer_remotezulipserver rserver
left join icount on icount.server_id = rserver.id left join icount on icount.server_id = rserver.id
@@ -82,9 +81,9 @@ def get_remote_server_activity(request: HttpRequest) -> HttpResponse:
"Hostname", "Hostname",
"Contact email", "Contact email",
"Zulip version", "Zulip version",
"Last audit log update",
"Analytics users", "Analytics users",
"Mobile users", "Mobile users",
"Last update time",
"Mobile pushes forwarded", "Mobile pushes forwarded",
"Plan name", "Plan name",
"Plan status", "Plan status",
@@ -96,7 +95,7 @@ def get_remote_server_activity(request: HttpRequest) -> HttpResponse:
rows = get_query_data(query) rows = get_query_data(query)
total_row = [] total_row = []
totals_columns = [4, 5] totals_columns = [5, 6, 7]
plan_data_by_remote_server = get_plan_data_by_remote_server() plan_data_by_remote_server = get_plan_data_by_remote_server()
for row in rows: for row in rows:
@@ -121,7 +120,7 @@ def get_remote_server_activity(request: HttpRequest) -> HttpResponse:
links = stats + " " + support links = stats + " " + support
row.append(links) row.append(links)
for i, col in enumerate(cols): for i, col in enumerate(cols):
if col == "Last update time": if col == "Last audit log update":
fix_rows(rows, i, format_date_for_activity_reports) fix_rows(rows, i, format_date_for_activity_reports)
if col in ["Mobile users", "Mobile pushes forwarded"]: if col in ["Mobile users", "Mobile pushes forwarded"]:
fix_rows(rows, i, format_none_as_zero) fix_rows(rows, i, format_none_as_zero)

View File

@@ -1,6 +1,5 @@
<h4>Chart key:</h4> <h4>Chart key:</h4>
<ul> <ul>
<li><strong>Zulip version</strong> - as of last update time</li>
<li><strong>Mobile pushes forwarded</strong> - last 7 days, including today's current count</li> <li><strong>Mobile pushes forwarded</strong> - last 7 days, including today's current count</li>
<li><strong>ARR</strong> (annual recurring revenue) - the number of users they are paying for * annual price/user</li> <li><strong>ARR</strong> (annual recurring revenue) - the number of users they are paying for * annual price/user</li>
<li><strong>Links</strong> <li><strong>Links</strong>