analytics: Update "Messages sent by client" chart for Flutter app.

Updates the labels in the "Messages sent by client" analytics chart
for the user-agent/client names for the Flutter mobile app, which
can be "ZulipFlutter" or "ZulipMobile/flutter".

Fixes #28220.
This commit is contained in:
Lauryn Menard 2024-05-23 16:06:02 +02:00 committed by Tim Abbott
parent aa84080ad6
commit 5892e48ba4
3 changed files with 11 additions and 3 deletions

View File

@ -285,6 +285,7 @@ class Command(ZulipBaseCommand):
android, created = Client.objects.get_or_create(name="ZulipAndroid") android, created = Client.objects.get_or_create(name="ZulipAndroid")
iOS, created = Client.objects.get_or_create(name="ZulipiOS") iOS, created = Client.objects.get_or_create(name="ZulipiOS")
react_native, created = Client.objects.get_or_create(name="ZulipMobile") react_native, created = Client.objects.get_or_create(name="ZulipMobile")
flutter, created = Client.objects.get_or_create(name="ZulipFlutter")
API, created = Client.objects.get_or_create(name="API: Python") API, created = Client.objects.get_or_create(name="API: Python")
zephyr_mirror, created = Client.objects.get_or_create(name="zephyr_mirror") zephyr_mirror, created = Client.objects.get_or_create(name="zephyr_mirror")
unused, created = Client.objects.get_or_create(name="unused") unused, created = Client.objects.get_or_create(name="unused")
@ -302,6 +303,7 @@ class Command(ZulipBaseCommand):
android.id: self.generate_fixture_data(stat, 5, 5, 2, 0.6, 3), android.id: self.generate_fixture_data(stat, 5, 5, 2, 0.6, 3),
iOS.id: self.generate_fixture_data(stat, 5, 5, 2, 0.6, 3), iOS.id: self.generate_fixture_data(stat, 5, 5, 2, 0.6, 3),
react_native.id: self.generate_fixture_data(stat, 5, 5, 10, 0.6, 3), react_native.id: self.generate_fixture_data(stat, 5, 5, 10, 0.6, 3),
flutter.id: self.generate_fixture_data(stat, 5, 5, 10, 0.6, 3),
API.id: self.generate_fixture_data(stat, 5, 5, 5, 0.6, 3), API.id: self.generate_fixture_data(stat, 5, 5, 5, 0.6, 3),
zephyr_mirror.id: self.generate_fixture_data(stat, 1, 1, 3, 0.6, 3), zephyr_mirror.id: self.generate_fixture_data(stat, 1, 1, 3, 0.6, 3),
unused.id: self.generate_fixture_data(stat, 0, 0, 0, 0, 0), unused.id: self.generate_fixture_data(stat, 0, 0, 0, 0, 0),
@ -313,6 +315,7 @@ class Command(ZulipBaseCommand):
old_desktop.id: self.generate_fixture_data(stat, 50, 30, 8, 0.6, 3), old_desktop.id: self.generate_fixture_data(stat, 50, 30, 8, 0.6, 3),
android.id: self.generate_fixture_data(stat, 50, 50, 2, 0.6, 3), android.id: self.generate_fixture_data(stat, 50, 50, 2, 0.6, 3),
iOS.id: self.generate_fixture_data(stat, 50, 50, 2, 0.6, 3), iOS.id: self.generate_fixture_data(stat, 50, 50, 2, 0.6, 3),
flutter.id: self.generate_fixture_data(stat, 5, 5, 10, 0.6, 3),
react_native.id: self.generate_fixture_data(stat, 5, 5, 10, 0.6, 3), react_native.id: self.generate_fixture_data(stat, 5, 5, 10, 0.6, 3),
API.id: self.generate_fixture_data(stat, 50, 50, 5, 0.6, 3), API.id: self.generate_fixture_data(stat, 50, 50, 5, 0.6, 3),
zephyr_mirror.id: self.generate_fixture_data(stat, 10, 10, 3, 0.6, 3), zephyr_mirror.id: self.generate_fixture_data(stat, 10, 10, 3, 0.6, 3),

View File

@ -661,7 +661,9 @@ class TestMapArrays(ZulipTestCase):
"website": [1, 2, 3], "website": [1, 2, 3],
"ZulipiOS": [1, 2, 3], "ZulipiOS": [1, 2, 3],
"ZulipElectron": [2, 5, 7], "ZulipElectron": [2, 5, 7],
"ZulipMobile": [1, 5, 7], "ZulipMobile": [1, 2, 3],
"ZulipMobile/flutter": [1, 1, 1],
"ZulipFlutter": [1, 1, 1],
"ZulipPython": [1, 2, 3], "ZulipPython": [1, 2, 3],
"API: Python": [1, 2, 3], "API: Python": [1, 2, 3],
"SomethingRandom": [4, 5, 6], "SomethingRandom": [4, 5, 6],
@ -676,7 +678,8 @@ class TestMapArrays(ZulipTestCase):
"Old desktop app": [32, 36, 39], "Old desktop app": [32, 36, 39],
"Old iOS app": [1, 2, 3], "Old iOS app": [1, 2, 3],
"Desktop app": [2, 5, 7], "Desktop app": [2, 5, 7],
"Mobile app": [1, 5, 7], "Mobile app (React Native)": [1, 2, 3],
"Mobile app beta (Flutter)": [2, 2, 2],
"Web app": [1, 2, 3], "Web app": [1, 2, 3],
"Python API": [2, 4, 6], "Python API": [2, 4, 6],
"SomethingRandom": [4, 5, 6], "SomethingRandom": [4, 5, 6],

View File

@ -525,7 +525,9 @@ def client_label_map(name: str) -> str:
if name == "ZulipiOS": if name == "ZulipiOS":
return "Old iOS app" return "Old iOS app"
if name == "ZulipMobile": if name == "ZulipMobile":
return "Mobile app" return "Mobile app (React Native)"
if name in ["ZulipFlutter", "ZulipMobile/flutter"]:
return "Mobile app beta (Flutter)"
if name in ["ZulipPython", "API: Python"]: if name in ["ZulipPython", "API: Python"]:
return "Python API" return "Python API"
if name.startswith("Zulip") and name.endswith("Webhook"): if name.startswith("Zulip") and name.endswith("Webhook"):