Skip to content

Commit 833d793

Browse files
author
admin
committed
fix comments
1 parent f26cd61 commit 833d793

File tree

4 files changed

+20
-4
lines changed

4 files changed

+20
-4
lines changed

app/util/analytics/analytics.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ def __init__(self, application: BaseApplication):
5454
self.dataset_information = application.dataset_information
5555
self.apps_count = application.apps_count
5656
self.custom_apps_count = application.custom_app_count
57+
self.custom_apps_count_enabled = application.custom_app_count_enabled
5758
if self.app_type != CROWD:
5859
self.processors = application.processors
5960
self.deployment = application.deployment

app/util/analytics/analytics_utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ def generate_report_summary(collector):
108108
summary_report.append(f'Has app-specific actions|{bool(collector.app_specific_rates)}')
109109
summary_report.append(f'Applications count|{collector.apps_count}')
110110
summary_report.append(f'Custom applications count|{collector.custom_apps_count}')
111+
summary_report.append(f'Custom applications count enabled|{collector.custom_apps_count_enabled}')
111112

112113
if collector.app_type == JSM:
113114
insight = collector.insight

app/util/analytics/application_info.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ class BaseApplication:
3434
dataset_information = None
3535
apps_count = None
3636
custom_app_count = None
37+
custom_app_count_enabled = None
3738

3839
def __init__(self, api_client, config_yml):
3940
self.client = api_client(host=config_yml.server_url,
@@ -110,13 +111,23 @@ def apps_count(self):
110111
def __get_apps(self):
111112
return self.client.get_installed_apps()
112113

113-
@property
114-
def custom_app_count(self):
114+
@cached_property
115+
def __get_custom_apps(self):
115116
all_apps = self.__get_apps
116117
apps_with_vendor_defined = [app for app in all_apps if 'vendor' in app]
117118
non_atlassian_apps = [app for app in apps_with_vendor_defined if 'Atlassian' not in
118119
app['vendor']['name'] and app['userInstalled'] == True]
119-
return len(non_atlassian_apps)
120+
return non_atlassian_apps
121+
122+
@property
123+
def custom_app_count(self):
124+
return len(self.__get_custom_apps)
125+
126+
@property
127+
def custom_app_count_enabled(self):
128+
non_atlassian_apps = self.__get_custom_apps
129+
non_atlassian_apps_enabled = [app for app in non_atlassian_apps if app['enabled'] == True]
130+
return len(non_atlassian_apps_enabled)
120131

121132

122133
class Confluence(BaseApplication):

app/util/data_preparation/jira_prepare_data.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,10 @@ def __check_number_of_custom_app(client):
182182
apps_with_vendor_defined = [app for app in all_apps if 'vendor' in app]
183183
non_atlassian_apps = [app for app in apps_with_vendor_defined if 'Atlassian' not in
184184
app['vendor']['name'] and app['userInstalled'] == True]
185-
print(len(non_atlassian_apps))
185+
non_atlassian_apps_names = [app['name'] for app in non_atlassian_apps]
186+
print(f"Custom application count: {len(non_atlassian_apps)}")
187+
print(f'Custom app names:')
188+
print(*non_atlassian_apps_names, sep='\n')
186189

187190

188191

0 commit comments

Comments
 (0)