Projects:EntityAccessChecker Perfomance Improvements/QA
Contents |
Introduction
There are some general improvements that be applied for the EntityAccessChecker process (Calculate access permissions). This new improvements help to reduce the time spent in the process of calculate permissions for entities. For this reason, the main goal of the QA-Test Plan of this project is to ensure that the new EntityAccessChecker process reduces as much as can this overall overhead.
Manual Tests
Several manual test have been done in order to cover some special scenarios.The following manual test have been done:
- Problem found when switching between roles. From a role without permissions to a role with permissions:
- Login in ERP using a role without permissions.
- Switch to F&B International Group admin role.
- Expected result: Switch is done as expected.
- Added/Removed new permissions:
- Login in ERP with F&B International Group admin role.
- Go to [Role] window and select a role without permissions. Added a window access. (e.g. [Financial Account] window).
- Switch to the role updated in the previous step.
- Go to [Financial Account] window.
- Expected result: [Financial Account] window is working as expected.
- Remove the Financial account window access and ensures that the permissions are removed properly.
- Expected result: Financial account window is not accessible anymore.
Performance Tests
Performance manual test have been done for four different roles:
- F&B International Group Admin [952 Access Permissions].
- System Administrator [540 Access Permissions].
- F&B EspaƱa, S.A - Employee [26 Access Permissions]
- Role without any access permissions [0 Access Permissions].
The following steps have been done before and after this project for every role:
- Login in Openbravo with a role mentioned previously.
- Execute x1000 times EntityAccessChecker.initialize() -> Method that calculates access permissions.
- Store in a spreadsheet all the access permissions calculated. -> Ensure than the number of permission access are the same than before the changes of this project are applied.
- Store the average time per EntityAccessChecker.initialize()
The following code is used to execute x1000 times EntityAccessChecker.initialize(). This code is placed into About.java:
........... private void printPageDataSheet(HttpServletResponse response, VariablesSecureApp vars) throws IOException, ServletException { if (log4j.isDebugEnabled()) log4j.debug("Output: dataSheet"); // TESTING CODE long start = System.currentTimeMillis(); OBContext context = OBContext.getOBContext(); context.getEntityAccessChecker().initialize(); System.out.println("Time initialization " + (System.currentTimeMillis() - start)); long total = 0L; for (int x = 1; x <= 1000; x++) { start = System.currentTimeMillis(); context.getEntityAccessChecker().initialize(); total += System.currentTimeMillis() - start; if (x % 100 == 0) { System.out.println("Execution number " + x + " and average is [" + total + "/" + x + "]=" + total / x); } OBDal.getInstance().getSession().clear(); } // END TESTING CODE OBContext.setAdminMode(); try { ...........
Overhead reduction
The results of this tests can be found here. Besides several snapshots of Yourkit have been captured: One of them is done before changes applied in this project and the other one is done with changes of this project. Download snapshots here.
This test should be applied in a high volume enviroment. This test let us to understand which is the expected reduction in a real customer with high volume enviroment: NOT Done.
Code review
https://docs.google.com/spreadsheets/d/15maDNAu5thmfUTBVHouZmv_M3Lr4fthz0gp_oGdbIsc/edit