aqa-test-tools icon indicating copy to clipboard operation
aqa-test-tools copied to clipboard

Move Duplicate Code for Perf Graphs to Common Utils Library

Open piyush286 opened this issue 6 years ago • 3 comments

Problem Description

Currently, we have 3 Perf widgets for Dashboard: DayTrader, ODM and SPECjbb2015. There is significant duplication of code between those 3 widgets since we just copied and modified the code from the first widget instead of using a common library while adding a new widget every time.

All perf graphs have the same purpose of displaying perf results for different benchmarks run on different platforms. Besides some specific data, everything else is the same among those widgets as shown below in the screenshots.

image

image

The graphs would have some minor feature difference because some of the features added by https://github.com/AdoptOpenJDK/openjdk-test-tools/pull/84, where not extended to all 3 perf widgets.

As a result, it's not easy to add new widgets for new benchmarks without duplicating code from some existing widget.

Proposed Changes

We should use a library to keep the common code, in order to avoid duplicating code for different benchmark widgets. For example, currently, utils.js just has one function parseSHA, which is used in multiple widgets but there is still enough scope to clean up code by moving common code to this library.

https://github.com/AdoptOpenJDK/openjdk-test-tools/blob/524d16e3784c17f4af6cee75f9105eb929397792/test-result-summary-client/src/Dashboard/Widgets/Graph/utils.js#L1-L2

https://github.com/AdoptOpenJDK/openjdk-test-tools/blob/524d16e3784c17f4af6cee75f9105eb929397792/test-result-summary-client/src/Dashboard/Widgets/Graph/ODM.jsx#L159-L160

https://github.com/AdoptOpenJDK/openjdk-test-tools/blob/524d16e3784c17f4af6cee75f9105eb929397792/test-result-summary-client/src/Dashboard/Widgets/Graph/DayTrader3.jsx#L151-L152

piyush286 avatar Jun 18 '19 18:06 piyush286

FYI @jiayaolinn @joransiu

It would be easier to add graphs for AcmeAir if we can clean up this code.

piyush286 avatar Jun 18 '19 18:06 piyush286

I think it is easier to complete this issue after https://github.com/AdoptOpenJDK/openjdk-test-tools/issues/106 as the data structure is updated.

llxia avatar Jun 19 '19 14:06 llxia

As discussed, we break this issue into several parts. The first couple of tasks:

  1. Update internal server https://github.com/AdoptOpenJDK/openjdk-test-tools/issues/223
  2. create react component for charts
  3. update all graphs if needed
  4. TBD...

llxia avatar Apr 08 '20 15:04 llxia