Quantcast

[sonar-dev] Sonar plugin to access and publish key project metrics

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[sonar-dev] Sonar plugin to access and publish key project metrics

Thomas Züblin
Sonar plugin to access and publish key project metrics

Hi all,

I’m trying to write a sonar plugin that collects key metrics (coverage, rules compliance, test success etc.) at the end of a maven (multimodule) build, and publishes them to a remote datastore via http. I’m interested in the aggregated top-level results, basically what you can see on the dashboard of a multimodule project. Not so much interested in the metrics of all individual modules.

However I’m struggling to get access to this data:

-       as far as I read in a previous post about the same topic, PostJob seems not to offer access to the metrics. If I misunderstood this, I’d very much appreciate an example or any pointers on how to access the metrics (using the Project or SensorContext)

-       Is PostJob the wrong extension for this task?

-       I was thinking about accessing the data via REST API in my PostJob as a workaround. Any better ideas?

Any help is much appreciated, if anyone can point me to other plugins that do something similar, that would help a lot.

Regards,

Thomas

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: [sonar-dev] Sonar plugin to access and publish key project metrics

Thomas Züblin
Sonar plugin to access and publish key project metrics

Hi all,

 

To answer my own question, I was able to access all project measures in my PostJob using the SensorContext.getMeasure method.

 

Regards,

 

Thomas

 

From: Thomas Züblin [mailto:[hidden email]]
Sent: Donnerstag, 14. Juni 2012 12:39
To: [hidden email]
Subject: [sonar-dev] Sonar plugin to access and publish key project metrics

 

Hi all,

I’m trying to write a sonar plugin that collects key metrics (coverage, rules compliance, test success etc.) at the end of a maven (multimodule) build, and publishes them to a remote datastore via http. I’m interested in the aggregated top-level results, basically what you can see on the dashboard of a multimodule project. Not so much interested in the metrics of all individual modules.

However I’m struggling to get access to this data:

-       as far as I read in a previous post about the same topic, PostJob seems not to offer access to the metrics. If I misunderstood this, I’d very much appreciate an example or any pointers on how to access the metrics (using the Project or SensorContext)

-       Is PostJob the wrong extension for this task?

-       I was thinking about accessing the data via REST API in my PostJob as a workaround. Any better ideas?

Any help is much appreciated, if anyone can point me to other plugins that do something similar, that would help a lot.

Regards,

Thomas

Loading...