Sonar analysis takes long time

ⅰ亾dé卋堺 提交于 2019-12-10 10:09:42

问题


My sonar analysis takes a long time to complete. Initially it took around 20-30 mins. Later it increased to 1hr+. Now after 5 months it takes whole 5 hours. Can someone suggest the reason and how to rectify the same.

I use sonarqube 4.4 with postgresql 9.3 db. The sonar db takes up almost 40G of space.

If you check my log below you will notice that most of the time is spent on IndexProjectPostJob.

08:53:47.437 INFO  - Executing post-job class org.sonar.plugins.core.issue.notification.SendIssueNotificationsPostJob
08:53:48.687 INFO  - Executing post-job class org.sonar.plugins.core.batch.IndexProjectPostJob
12:56:24.924 INFO  - Executing post-job class org.sonar.plugins.dbcleaner.ProjectPurgePostJob
12:56:26.601 INFO  - -> Keep one snapshot per day between 2015-06-10 and 2015-07-07

回答1:


If you have lots of Junit/Integration tests that run each time sonar is analyzing your code it can take a long time before it is finished.

If this is the case , maybe you should move (part) of your tests (for example the once that use the db) to a separate sonar project, which you'll only run once in a while. And run only your small and real unit tests.




回答2:


You probably have a lot of snapshots. Would it be possible to delete some. Which version of SonarQube do you use ?

Regards.



来源:https://stackoverflow.com/questions/31290413/sonar-analysis-takes-long-time

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!