GSoC’24 Week 02: My First Task In GSoC

Manojlakshan
4 min readMay 18, 2024

--

Hey flows!

This is my second blog post about my journey in Google Summer of Code 2024. In this week, I focused on finding an effective and easy way to to evaluate the performance of my implementations with current flag module. I was able to successfully inserted some demo data to my openMRS development server. Additionally, I had a call with my mentors, where we discussed my progress and planned the next steps.

Find out a way to performance evaluation

As my first task for GSoC, I needed to find a way to evaluate the performance between my implementations and the current OpenMRS patient flag module. I stared it by searching on Google: “How to evaluate performance of a Spring web application.” This search led me to find out several methods for evaluate the performance of Java applications.

JMeter : JMeter is a tool used for testing the performance of software applications. It can simulate multiple users accessing a web service, allowing developers to see how the application performs under load. JMeter is open-source, easy to use, and can test both static and dynamic resources. It’s especially useful for web application testing and is widely used in the software development industry to ensure applications can handle heavy traffic.

Java Profilers : Java profilers help to monitor various aspects such as memory usage, CPU usage, and thread activity, identifying bottlenecks and performance issues. JProfiler, VisualVM and YorKit are some popular Java profilers. And also IDE’s like InteliJ is having build-in profiling tool.

resource about java profilers : https://www.baeldung.com/java-profilers

JMH : JMH (Java Microbenchmark Harness) is a Java library used for creating benchmarks to measure the performance of small code snippets. Developed by the same team at Oracle that develops the Java Virtual Machine (JVM), JMH is designed to provide accurate and reliable performance metrics.

From these evaluation methods, I selected JMeter because it is easy to use and if I needed to check CPU usage, memory usage, and thread behavior , I would use a Java profiler. However, I found using JMeter a bit challenging because I wanted to check the response time, but the current flag module does not have a REST implementation for the flag evaluation process. So, I set JMeter aside for a while and considered another way to evaluate performance. Then a great idea came to mind: checking the method execution time. This was amazing, and I could do this using three simple code lines.

long start = System.currentTimeInMilliSec();
// code gose here
long endTime = System.currentTimeInMilliSec() - start ;
log.Infor("executing time : "+ endTime)

implementation

The current OpenMRS patient flag module evaluates the flags sequentially. I modified this to evaluate the patient flags in parallel. To achieve this, I used a thread pool with the number of threads equal to the number of flags.

flag evaluation of current module
my implementation

This implementation is still on testing, and there are few more method that need to implement like this to evaluate patient flags in parallel way.

Created few patient flags

My OpenMRS development server didn’t contain any data for testing. My next task was to add some test data. Initially, I tried importing OpenMRS demo data, but I couldn’t do it successfully. After importing, my server kept crashing. I tried many ways to fix this issue but was unable to resolve it. Then, I found a guide that saved my life. It contained everything needed to create a patient file, along with some examples. Additionally, to create a patient flag, I realized I should have a good understanding of the OpenMRS data model.

Week 03 plan

Next week, I will focus mainly on conducting more testing on my implementation and raising a PR. Additionally, I mentioned batch processing in my proposal, and I plan to discuss this further with my mentors.

Stay tuned — I’ll be sharing everything I’m doing on this project in my weekly blog updates.

Thank you for the reading, Join me on this tech adventure! Follow my profile to stay updated on the cool world of technology and innovation. Your support means a lot, and I can’t wait to share more exciting stuff with you. Let’s stay connected for more insights and fun discoveries ahead!

Github: https://github.com/ManojLL

LinkedIn : https://www.linkedin.com/in/manoj-lakshan/

--

--