Skip to content
This repository was archived by the owner on Nov 15, 2019. It is now read-only.

Analysis Tool Integration

Antonin Abherve edited this page Apr 17, 2018 · 14 revisions

Analysis Service Integration Overview

The Measure Platform allow to Deploy, Configure, Collect, Store, Combine, and Display measures and metrics in relation with software developement process.

Services provided by the metric platform are completed by the Analysis Tools, a set of external services which work on the historized measures values in order to provide advance and valuable analysis function to the platform.

In order to support a large set of analyses services and do not limite to it a specific technology,the Analysis Tools are extrenal process. Although external, we wanted a deep integration between the platform and the analysis tools.We solved this issue in the following way :

  • The Measure platform provide a REST API which allow analysis tool to register it on the platform, to recivde notification from the platform and access to informations related to project defined and measure collected by the platform.
  • On her side , the analysis tool provide some web pages which will be embedded into the platform web application.

This Measure platform is organised by Projects. It must be the same for analysis tools that can be deployed or not in each projects. When a project decide to activate an analysis tool, the tools have to provide specific analysis services to the project scoped by the project configuration.

Embedded View

In order to integrate deeply the analysis tool to the Measure Platform, the analysis tools has to provide some web pages which will be embedded to the platform web application.

Each of this view are defined on platform side by a specific url. For project specific views, this url are different for each projects.

Global Configuraiton Page (optional)

If the analysis tool require a way to provide some configuration interface which will be shared by all project, it can provide a globalconfiguration web page.

Project Specific Configuraiton Page

Consfiguration page which are specific for each project.

Project Specific Main View

Main view of the analysis tool which are specific for each project.

Dashboard Card

Optional small view which can be integrated to projects dashboards in order to provide some key informations to project manages relate to the service provided by the analysis tool.

Integration Life Cycle

  • Registration: At startup of the Analysis Tool, it must register itself to the platform using the Registration service.This would allow the project to activate the analysis tools.

  • Wait for Notifications: the Analysis Tool must listen to notifications from the plateform in order to know when a project request the usage of the analysis tool. The notification (Alert) system is based on pooling system. The Analysys tool pool the platform periodicly usign the alert service to recived notifications.

  • Configure Analysis: When a project activate an analysis tool, the analysis tool must configure it for the project and provide URLS for the Project Specific Configuration Page, the Project Main View a optionaly the dashboard cards.

  • Analyse the Project : When configured, the analysis tool can start is analysis work for the specific project. In order to perform this work, the analysis tool can explore the project configuration using the various services provided by the Measure platform. It can also configure new Alerts to recived notification when the project configuration changed

Registration Service

Register Analysis Tool PUT /api/analysis/register
Register an analysis tool to the measure platform.

Input Data:

{
  "configurationURL": "string",
  "description": "string",
  "name": "string"
}

Java Client Implementation :

public class AnalysisService {
        private String name;
	private String description;
	private String configurationURL;

	public AnalysisService(){
	}
	... get and set
}
....
public void registerAnalysisTool(AnalysisService service){
	RestTemplate restTemplate = new RestTemplate();	
	try {
		restTemplate.put(serverURL +"/api/analysis/register",service);
	} catch (Exception e) {
		e.printStackTrace();
		return;
	}
}

Alert Service

The Measure Platform alert System is based on an pooling system. The analysis tool must pull periodicly the Measure platform to recived all new notification arrvived between the last pool and now.

Notification related to analysis tool activation and deactivation are automatically configure by the platform when a new Analysis tool register itself to the platform.The analysis tool cans sucribe to others kind of notification usign the Alert REST API.

List of Alert Type :

DescriptionA Project send an activation request for the Analysis Tool. It's not required for analysis tool to suscribe to this alert, the suscribtion is automatique.A Project indicate that the analysys service is not required anymore. It's not required for analysis tool to suscribe to this alert, the suscribtion is automatique.
Alert Type Properties
ANALYSIS_ENABLE ANALYSISID : Id which allo to identify the instance of analysis associated with this request on platform side
ANALYSIS_DESABLE Properties
MEASURE_ADDED A new Measure is added the the project MEASUREID : Id of the Measure
MEASURE_REMOVED A Measure is removed form the project MEASUREID : Id of the Measure
MEASURE_SCHEDULED A Measure is not collected periodicly for the project MEASUREID : Id of the Measure
MEASURE_UNSCHEDULED A Measure is not collected anymore by the project MEASUREID : Id of the Measure

Retrive Platform Alerts

Pool Platform for Notification GET /api/analysis/alert/list/{AnalysisToolName}
AnalysisToolName Name of the analysis tool
Retrive Alerts form the platform for a specific analysis tool

Output Data :

{
  "alerts": [
    {
      "alertType": "string",
      "projectId": 0,
      "properties": [
        {
          "property": "string",
          "value": "string"
        }
      ]
    }
  ],
  "from": "2018-03-13T12:16:33.164Z"
}

**Java Client Implementation : **

public class AlertReport {
	private Date from;
	private List<AlertData> alerts = new ArrayList<>();
	
	public AlertReport(){
	}
      ... get and set
}

public class AlertData {
	private String alertType;
	private Long projectId;
	private List<AlertProperty> properties = new ArrayList<>();

	public AlertData() {
	}
      ... get and set
}

public class AlertProperty {

	private String property;
	private String value;

	public AlertProperty(){
	}
      ... get and set
}

public AlertReport getAlerts(String analysisTool){
	RestTemplate restTemplate = new RestTemplate();	
	try {
		return restTemplate.getForObject(serverURL +"api/analysis/alert/list/?id="+analysisTool,AlertReport.class);
	} catch (Exception e) {
		e.printStackTrace();
	}		
	return null;
}
	

Configuration Service

Configure the Platform Analysis PUT /api/analysis/configure
Configure the Analysis Tool ot Platform level for a specific project. This configuration consists to define URL of ebedev visulation provided by the analysis tool for the project?

NB : The Analysis COnfiguration input data required an projectAnalysisId. This id is provided by the platform as properties of the ANALYSIS_ENABLE and ANALYSIS_DESABLE notification message.

Input Data :

{
  "cards": [
    {
      "cardUrl": "string",
      "label": "string",
      "preferedHeight": 0,
      "preferedWidth": 0
    }
  ],
  "configurationUrl": "string",
  "projectAnalysisId": 0,
  "viewUrl": "string"
}

**Java Client Implementation : **

public class AnalysisConfiguration {
	private Long projectAnalysisId;
	private String viewUrl;
	private String configurationUrl;
	private List<CardConfiguration> cards = new ArrayList<>();

	public AnalysisConfiguration() {
	}
	... get and set
}	

public class CardConfiguration {

	private String cardUrl;
	private String label;

	private Integer preferedWidth;	
	private Integer preferedHeight;
	
	public CardConfiguration(){
		
	}
... get and set
}	

public void configureAnalysisTool(AnalysisConfiguration service){
	RestTemplate restTemplate = new RestTemplate();
	try {
		restTemplate.put(serverURL +"/api/analysis/configure", service);
	} catch (Exception e) {
		e.printStackTrace();
		return;
	}
}
	

Suscribe to Alerts

Alert Suscribtion PUT /api/analysis/alert/subscribe
Allow an analysis tool to suscribe to a new alert related to a specific project

Input Data :

{
  "analysisTool": "string",
  "eventType": "ANALYSIS_ENABLE",
  "projectId": 0,
  "properties": [
    {
      "property": "string",
      "value": "string"
    }
  ]
}

Unsuscribe to Alerts

Alert Unsuscribe PUT /api/analysis/alert/unsubscribe
Alow the analysis tool to unsuscribe to an alerte

Input Data :

{
  "analysisTool": "string",
  "eventType": "ANALYSIS_ENABLE",
  "projectId": 0,
  "properties": [
    {
      "property": "string",
      "value": "string"
    }
  ]
}

Platform Querying Services

The platform provide several others services which can be used by the analysis tool to retive platform and project configurations data, informations related to measures and measurements and more...

The list of available services can be consulted via swagger directly on deployed measure platform. To access to this specification :

  • You must be connected as Administrator tho the platform
  • The complete API specification is available on Administration > API menu

Some example of available services :

  • GET /api/measure/findall : List all measures
  • GET /api/measure/{id} : information related to a specific measure
  • GET /api/measure-properties/{id} : List of scope properties associated with one measure
  • GET /api/projects : List all projects all projects
  • GET /api/projects/{id} : Information related to a specific project
  • GET /api/phases/byproject/{id} : Get phases of a specific project
  • GET /api/phases/{id} : Information of a specific phase
  • GET /api/measure-instances : List of all measure instances
  • GET /api/measure-instances/{id} : Information of a specific measure instance
  • GET /api/project-measure-instances/{id} : List of measure instances of a specified project
  • GET /api/measure-instance/scheduling/execute/{id} : Execute a specific measure
  • GET /api/measure-instance/scheduling/start/{id} : Activate scheduling of a specific measure
  • GET /api/measure-instance/scheduling/stop/{id} : Deactivate scheduling of a specific measure

Clone this wiki locally