=Paper=
{{Paper
|id=Vol-2286/paper_5
|storemode=property
|title=Towards green metrics integration in the MEASURE platform
|pdfUrl=https://ceur-ws.org/Vol-2286/paper_5.pdf
|volume=Vol-2286
|authors=Alessandra Bagnato,Rocheteau Jérôme
|dblpUrl=https://dblp.org/rec/conf/esem/BagnatoR18
}}
==Towards green metrics integration in the MEASURE platform==
Towards Green Metrics Integration in the MEASURE Platform Alessandra Bagnato Jérôme Rocheteau Softeam Research & Development Division Institut Catholique d’Arts et Métiers Paris, France 35 av. du champ de Manœuvres, Carquefou, France alessandra.bagnato@softeam.fr, jerome.rocheteau@icam.fr, Abstract—Current approaches to measure software energy processes during the whole software lifecycle by executing consumption rely on different measurement tools that are not measures defined in SMM standard and extracted from a integrated with the software development life-cycle phases. We catalogue of formal and platform-independent measurements. develop a model-based design methodology in order to cope with this problem. This methodology is tooled by a processing platform 1) Provide methodologies and tools which allow measure and a development environment based on OMG’s Structured tools provider to develop a catalogue of formal and Metrics Metamodel models. We apply the approach to three specific measures that correspond to green metrics and we explain platform-independent measure. how they fit with different software development phases. 2) Implement storage solution dedicated to measurements resulting of measure execution in big data context. I. I NTRODUCTION 3) Implement visualization tools to expose the extracted Measuring software engineering during the software de- results in an easy-readable fashion, so allowing a quick velopment life-cycle phases involves different tools that are understanding of the situation and the possible actions used by different teams within the same company or in that can be taken to improve the diverse stages of the different ones. It lacks of global view, unified collect platform software lifecycle. and deep analysis that could allow cross decision making in 4) Implement an extended API which allows external anal- software development that may engender costs loss due to a ysis tools to access to collected measurement and to management decision longer time. contextual data related the measurement collect process OMG’s Structured Metrics Metamodel (SMM) specification itself. [1] defines an extensible meta-model for representing and ex- The platform activity is organised around its ability to collect changing software-related measurement information concern- measurement by executing measures defined by the SMM ing software assets (designs, implementations, operations, etc). standard. SMM measures are auto-executable component, im- The MEASURE platform consists of a web application that plemented externally, which can be interrogated by the plat- allows to deploy, configure, collect, compute, store, combine form to collect measurements. The Measure platform provides and visualize measurements by execution of software measures services to host, configure and collect measures, storing mea- that may be defined according to the SMM specification. Such surement, present and analyse them. These measures are first a usage has been described in [2]. defined in SMM standard using the Modelio modelling tool [6] We apply the previous tooling to green computing through and its extension dedicated to SMM modelling [7]. They are out green metrics design and implementation based on the packaged under an executable format as Measure Definition. EMIT power measurement tool. Three SMM measures are Next, measures are registered and stored on Measure platform modelled and deployed onto the MEASURE platform. using the dedicated REST service or the Web user interface. This short paper is structured as follows: The section II In order to initiate the collect of measurement, the next step presents the MEASURE platform. The section III presents the consists on defining instance of measure based on measure deployed tooling for embedding and processing the previous definitions. A measure represents a generic data collection green metrics within the MEASURE platform. The section IV algorithm that has to be instantiated and configured to be illustrates the methodology for reusing green metrics across applied on a specific context. For example, a measure which software development projects that are drawn out from open collects data related to an SonarQube repository must be source project unit test suites. configured by the URL of this repository. Next the Measure Platform can start collecting measurement (data resulting of II. MEASURE PLATFORM the execution of an instantiated measure). Direct measures The MEASURE Platform [3], [4], [5] is a tool dedicated to collect data in physical world while the Derived Measures are measure, analyse, and visualise the metrics to extract and show calculated using previously collected measurement as input. information of the software engineering processes. Implement Collected measurements are stored on a No SQL designed to the tools for automatically measure software engineering be able to process a very large amount of data. To collect measurements, the direct measures can delegate the collect activities in different phases of software engineering. Within work to existing Measure tool. Finally, stored measurements the MEASURE project the metrics modelled are structured are presented directly to the end user following a business according to five software engineering phases: specification, structured way by the Decision-making platform, a web ap- design, implementation, testing and production. These metrics plication which allows organising measures based on projects define measures then deployed on the MEASURE platform for / software development phases and display its under various measurement collect and analysis. The figure 2 illustrates the forms of charts. The measurements can also be processed Modelio Environement and the MEASURE library covering by analysis tools to present consolidated results [3], [4], [5]. all the phases of the software development lifecycle used in The Measure platform [3], [4], [5] provides services to host, the MEASURE Project [3], [4]. We concentrate in this paper configure and collect measures, storing measurement, present on the software engineering production phase and in particular and analyse them. These measures are first defined in SMM on green metrics. standard using the Modelio modelling tool and its extension III. G REEN M ETRICS IN THE MEASURE P LATFORM dedicated to SMM modelling. They are packaged under an executable format as Measure Definition . Next, measures are Three metrics are integrated into the MEASURE platform registered and stored on Measure platform using the dedicated about software energy consumption. The first metrics corre- REST service or the Web user interface. In order to initiate sponds to the energy efficiency of a software artifact with the collect of measurement, the next step consists on defining respect to another one. It is defined as a SMM ratio measure [1, instance of measure based on measure definitions. A measure §11.8] between two other measures and consists of a positive represents a generic data collection algorithm that has to be version of the energy waste rate in [8]. This metrics is instantiated and configured to be applied on a specific context. defined on the top of the two other metrics. The second one For example, a measure which collects data related to an SVN corresponds to the energy consumption of a software artifact. repository must be configured by the URL of this repository. it is defined as a SMM collective measure [1, §11.2] with a Challenges for MEASURE: custom accumulator that corresponds to the trapezoidal rule. 1) Define green metrics and develop methods and tools for The figure 3 illustrates the Energy measure. In fact, energy is automated, precise, and unbiased measurement. computed from power measurements during a given time-span. 2) Deploy and evaluate a set of dedicated metrics, Indeed, energy measures are related to a list of power measures 3) Deploy an infrastructure able to processing a large which are defined as SMM direct measures [1, §11.5] i.e. volume of Measures provided by big models repository, whose measurements are directly provided by external tools. 4) Integrate the Measure platform with existing quality and Every SMM power measures are defined by a float value project management tools already deploied and used in that corresponds to the power. The figure 4 illustrates the existing development environment, Power and TimeStamp measure. Such measures are also time- 5) Integrating green metric tools into development environ- stamped such that it enables to compute the trapezoidal rule ments and processes. of an list of power measures ordered by their time-stamps. 6) Offer a synthetic view resulting of the analysis several The SMM specification makes possible to relate measures to measures allowing a manager to extract key information software artifact by the means of the measurand attribute of related to several development process. SMM measures [1, §7.4]. It corresponds to any element of a 7) Used advanced analysis techniques like forecasting and MOF model [9] and then allows a model-based approach for automated recommendation system to help us to exploit measuring software and software engineering features. the monitoring data and define mitigations actions to The tool chain that provides support to the previous SMM issues detected with the help of the Measure platform. measures consists in several collaborative tools around the MEASURE platform: A. Modelio 1) It starts with power-meters that broadcast measurements Modelio [6] is a Modeling Tool developed by Softeam for electric features – such as current (intensity), voltage since January 2009 supporting and integrating all the latest (tension), power, power factor, etc – to corresponding major modelling or methodology standards. Modelio is first topics on a messaging-queue broker. and foremost a UML modelling environment, supporting a 2) The broker forwards such messages to a data processing wide range of models and diagrams, and providing model system called EMIT that stores such messages and assistance and consistency checking features. BPMN support exposes them throughout HTTP web services. is integrated with UML with Modelio combining Business 3) The SMM power measure integrated in the MEASURE Process Modelling and Notation (BPMN) and UML support platform continuouslyretrieves and stores messages that in one tool, with dedicated diagrams to support business only corresponds to power measurements of a given process modelling. The Modelio SMM Module [4] is the power-meter thanks to the previous services. Instances first building block of the MEASURE project tool chain. of this SMM power measure can be configured in setting The Modelio modeling tool, enabled with the SMM Module EMIT server location and in selecting the corresponding is based on Modelio’s open source distribution to allow the topics. It retrieves all the messages from the last retrieval specification of all the MEASURE’s metrics for measuring time-stamp to the current time-stamp. Fig. 1. MEASURE Platform Measurements and Analysis Tools Fig. 2. Modelio SMM Modeling Environment case consists in comparing energy consumption of similar software components (same functionality same interface, same contract, etc) while testing i.e. in evaluating their energy effi- ciency one to each other during the validation phase. A third use case would consist in building a knowledge base about software energy consumption in order to help developers at earlier phases (design or implementation). Such a knowledge base would make possible to build static analysis methods on source code or models such that developers could improve their software without feedback from testing or monitoring. On the one hand, the last use case is the most difficult to realize according to the lack of knowledge in the domain of software energy consumption and the reliability of power mea- surements over programming language primitive statements. On the other hand, the first use case is the most easy to realize as many tools already provide measurements and analysis results that fulfill it. We are focusing on the second use case as it corresponds to the combination of the MEASURE platform Fig. 3. Modelio’s Measure Diagram Power TimeStamp and Energy Measure (model-based and metrics-oriented software engineering) and the set of EMIT tools (power measurements and energy analysis). In fact, it allows developers to improve their source code throughout their knowledge of the differences between two revisions of a same unit test. For example, if the same unit test consumes more (resp. less) energy from a revision r1 to a revision r2, this means that the source code involved in this unit test is responsible for this increase (resp. decrease) of energy consumption. In fact, we assume that the same unit test in different revisions assess the same functionality uniformly. Such an approach about unit test energy consumption and efficiency requires to deploy a twofold continuous integration server both on the system under test and on another computer. The system under test will compile the source code and Fig. 4. Diagram Power & TimeStamp Measure Diagram in SMM execute the unit tests whereas the other server will, on the one hand, command the system under test to execute a given unit test and, on the other hand, retrieve from the EMIT tool the 4) The SMM energy measure integrated in the MEASURE time-stamps of the unit test execution beginning and end. Then platform continuously computes the energy consumption energy efficiency can be computed by the means of the energy from power measurements during a given time-span. In- analysis tool and integrated backwards into the MEASURE stances of this SMM energy measure can be configured platform in order to provide reports. Such an architecture and in setting the duration in milliseconds for computing a process closely correspond to those presented in [10, §4]. the energy consumption and in selecting the underlying SMM power measure. V. C ONCLUSION AND F UTURE W ORK 5) The SMM energy-efficiency measure integrated in the Software energy consumption has in fact mainly been MEASURE platform continuously relates energy mea- studied with respect to factors such as execution duration, CPU sures whose measurands are the same MOF element. load, RAM usage, network bandwidth, disk access, etc. The Instances of this SMM energy-efficiency measure can be MEASURE platform makes possible to easily relate software configured in setting the qualified name of this element. energy consumption with other software metrics thanks to its The figure 5 illustrates the data-flow between all these instru- SMM measure integration support. However, the underlying ments, tools and platforms. tooling architecture that makes such an integration that easy are itself rather complex. In fact, this architecture relies on IV. M ODEL -BASED M ETHODOLOGY dispatched tools and services that provide, collect and analyze This set of tools around the MEASURE platform enables measurements. In the future months we plan to run exper- energy efficiency to be taken into account during several iments over software source code repositories. The planned software development phases. For instance, a basic use case experiments will aim at providing examples of the energy consists in monitoring energy consumption and/or power peaks efficiency measure between the same test units from different at run-time during software production phase. A second use source code revisions. MEASURE platform MQTT MQTT HTTP MQTT pub sub system under test power-meter MQTT broker EMIT tool energy analysis tool Fig. 5. Tooling based on the MEASURE Platform from Power Measurements to Energy Analysis [7] Object Management Group, “The Software Metrics Meta-Model Spec- ification 1.1.1,” http://www.omg.org/spec/SMM/1.1.1/, Apr. 2016, last accessed on 2018-11-01. [8] J. Rocheteau, “Energy Wasting Rate as a Metrics for Green Computing and Static Analysis,” in MeGSuS 2015 - Proceedings of the 2nd International Workshop on Measurement and Metrics for Green and Sustainable Software Systems, Krakow, Poland, 5 October, 2015, 2015. [9] Meta Object Facility, Object Management Group, nov 2016. [Online]. Available: https://www.omg.org/spec/MOF/2.5.1/PDF [10] E. Kern, L. M. Hilty, A. Guldner, Y. V. Maksimov, A. Filler, J. Gröger, and S. Naumann, “Sustainable software products—towards assessment criteria for resource and energy efficiency,” Future Generation Computer Fig. 6. Power Measure XML Declaration Systems, vol. 86, pp. 199–210, 2018. [11] J. Carver, B. Penzenstadler, and A. Serebrenik, “Software Analysis, Evolution, and Reengineering, and ICT Sustainability,” IEEE Software, vol. 35, no. 4, 2018. [12] M. Rodriguez-Cancio, B. Combemale, and B. Baudry, “Automatic Microbenchmark Generation to Prevent Dead Code Elimination and Constant Folding,” in Proceedings of the 31st IEEE/ACM International Conference on Automated Software Engineering, 2016, pp. 132–143. [13] M. Rodriguez-Cancio, B. Combemale, and B. Baudry, Eds., Proceedings of the 31st IEEE/ACM International Conference on Automated Software Engineering. ACM, 2016. [14] C. Thompson, D. C. Schmidt, H. A. Turner, and J. White, “Analyz- ing mobile application software power consumption via model-driven engineering,” in PECCS 2011 - Proceedings of the 1st International Conference on Pervasive and Embedded Computing and Communication Systems, Vilamoura, Algarve, Portugal, 5-7 March, 2011, 2011, pp. 101– 113. [15] C. Benavente-Peces and J. Filipe, Eds., PECCS 2011 - Proceedings of Fig. 7. Power Measure Java Implementation the 1st International Conference on Pervasive and Embedded Computing and Communication Systems, Vilamoura, Algarve, Portugal, 5-7 March, 2011. SciTePress, 2011. VI. ACKNOWLEDGMENT [16] J. Rocheteau, V. Gaillard, and L. Belhaj, “How Green Are Java Best Coding Practices?” in SMARTGREENS 2014 - Proceedings of the The research presented in this extended abstract is funded by 3rd International Conference on Smart Grids and Green IT Systems, the ITEA3 Project no. 14009 called MEASURE (1st December Barcelona, Spain, 3-4 April, 2014, 2014, pp. 235–246. 2015 and running till 31st August 2019). R EFERENCES [1] Structured Metrics Metamodel, Object Management Group, mar 2018. [Online]. Available: https://www.omg.org/spec/SMM/1.2/PDF [2] A. Bagnato, M. A. Almeida Da Silva, A. Abhervé, J. Rocheteau, C.-L. Pihery, and P. Mabit, “Measuring Green Software Engineering in the MEASURE ITEA3 Project,” in MeGSuS 2016 - Proceedings of the 3rd International Workshop on Measurement and Metrics for Green and Sustainable Software Systems, Ciudad Real, Spain, 7 September, 2016, 2016, pp. 33–42. [3] Softeam R&D, “MEASURE project website,” http://measure.softeam-rd. eu/, Oct. 2017, last accessed on 2018-11-01. [4] A. Abherve, A. Bagnato, A. Stefanescu, and A. Baars, “Github project for the MEASURE platform,” https://github.com/ITEA3-Measure/ MeasurePlatform/graphs/contributors, Sep. 2017, last accessed on 2018- 11-01. [5] A. Abherve, “Github project for the SMM Measure API library,” https://github.com/ITEA3-Measure/SMMMeasureApi, Aug. 2017, last accessed on 2018-11-01. [6] Softeam , “Modelio project website,” https://www.modelio.org/, Mar. 2017, last accessed on 2018-11-01.