use of com.intellij.internal.statistic.connect.StatisticsService in project intellij-community by JetBrains.
the class SendStatisticsAction method actionPerformed.
@Override
public void actionPerformed(@NotNull AnActionEvent e) {
final Project project = e.getProject();
if (project == null) {
return;
}
ProgressManager.getInstance().run(new Task.Backgroundable(project, "Sending Statistics", false) {
@Override
public void run(@NotNull ProgressIndicator indicator) {
StatisticsService service = StatisticsUploadAssistant.getStatisticsService();
final StatisticsResult result = service.send();
ApplicationManager.getApplication().invokeLater(() -> Messages.showMultilineInputDialog(project, "Result: " + result.getCode(), "Statistics Result", StringUtil.replace(result.getDescription(), ";", "\n"), null, null), ModalityState.NON_MODAL, project.getDisposed());
}
});
}
use of com.intellij.internal.statistic.connect.StatisticsService in project intellij-community by JetBrains.
the class StatisticsUploadAssistant method getStatisticsService.
public static StatisticsService getStatisticsService() {
String key = ((ApplicationInfoImpl) ApplicationInfoImpl.getShadowInstance()).getStatisticsServiceKey();
StatisticsService service = key == null ? null : COLLECTOR.findSingle(key);
if (service != null) {
return service;
}
return new RemotelyConfigurableStatisticsService(new StatisticsConnectionService(), new StatisticsHttpClientSender(), new StatisticsUploadAssistant());
}
Aggregations