Analysis total time info [SonnarScanner for Maven / API]

I need to get the “Analysis total time” trough the API, but i can’t find it.
I’m using Sonarqube 8.9 CE with SonarScanner for Maven.

I have this output with the maven plugin:

[INFO] CPD Executor CPD calculation finished (done) | time=3287ms
[INFO] Analysis report generated in 2397ms, dir size=64 MB
[INFO] Analysis report compressed in 25206ms, zip size=24 MB
[INFO] Analysis report uploaded in 1866ms
[INFO] ANALYSIS SUCCESSFUL, you can browse http://127.0.0.1:9000/dashboard?id=project_id
[INFO] Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
[INFO] More about the report processing at http://127.0.0.1:9000/api/ce/task?id=task_id
[INFO] Analysis total time: 18:30.103 s
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  19:37 min
[INFO] Finished at: 2021-10-22T02:23:22Z
[INFO] ------------------------------------------------------------------------

But i can’t locate the “Analysis total time” or “Total time” anywhere with the web API.

Hi,

You won’t find this stored on the server; it’s not sent to the server and is only available where you see it: in the client-side analysis logs. Would you mind sharing why you want it?

 
Ann

I was trying to find a easy way to measure the overall duration of the scan of all our projects.
This will impact in our decision to run the scan before or after the deploy pipeline.

Well, looks like i will need to do it the hard way.

Thanks anyway.

Hi,

Thanks for sharing your use case. I would urge you to run analysis before deployment. Why? Because what you find in analysis may have an impact in whether you want to deploy. Some people even conditionally break the build depending on what’s found in analysis.

 
HTH,
Ann

Hi,

you may use a monitoring tool like Splunk or one of the free alternative tools like Grafana, Graylog, Logstash, Fluentd … etc. to keep track of all your tools (i.e. Jenkins …)
instead of doing it the hard way.
And yes, as Ann said, a deployment before the Sonarqube analysis doesn’t make any sense.

Gilbert

1 Like

We have some old monolith projects that we maintain which takes almost a hour to run a single analysis.
There are situations were we can’t wait that much to deploy a change. It’s not in our power to decide.

Anyway, thanks for pointing this tools.

Hi,

Just FYI, we’re planning to make PR analysis faster “soon” (i.e. in the 9-series).

 
Ann

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.