-
Notifications
You must be signed in to change notification settings - Fork 15
Add Continuous Profiling technical report #12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
RonakLakhotia
wants to merge
19
commits into
TEAMMATES:master
Choose a base branch
from
RonakLakhotia:report
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 12 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
69b2d6a
Add boilerplate for technical report
RonakLakhotia b6561a4
Reorder
RonakLakhotia 7d3569d
Rephrase
RonakLakhotia 5aae534
Add authors
RonakLakhotia 7f1d72f
Add problem section
RonakLakhotia b0e38c0
Update
RonakLakhotia b6a67dd
Update changes
RonakLakhotia 55c6b4a
Fix line breaks
RonakLakhotia 4201c74
Update tools section and make fixes
RonakLakhotia 36457f0
Language tweaks
RonakLakhotia 141a8cd
Sync with google docs
RonakLakhotia 1915f02
Fix typos and language errors
RonakLakhotia e050dfa
Update based on review
RonakLakhotia 08d0e98
Minor nits
RonakLakhotia 5160718
Update
RonakLakhotia 168547a
Update changes
RonakLakhotia 62a59f1
Change headers
RonakLakhotia b5164f5
Link report
RonakLakhotia e979555
Minor fixes
RonakLakhotia File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,104 @@ | ||
| # Performance Testing in TEAMMATES | ||
|
|
||
| Authors: [Ronak Lakhotia](https://github.com/RonakLakhotia), [Amrut Prabhu](https://github.com/amrut-prabhu) and [Jacob Li PengCheng](https://github.com/jacoblipech) | ||
|
|
||
| * [Introduction](#Introduction) | ||
| * [Problem](#Problem) | ||
| * [Overview of the Proposed Solution](#Overview-of-Solution) | ||
RonakLakhotia marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| * [Tools considered for Performance Testing](#Tools-considered-for-Performance-Testing) | ||
| * [Reasons for using JMeter](#Reasons-for-using-JMeter) | ||
RonakLakhotia marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| * [Current implementation of the solution](#current-implementation-of-the-solution) | ||
| * [Findings and Recommendations](#findings-and-recommendations) | ||
| * [Future Work](#Future-work) | ||
|
|
||
| ## Introduction | ||
|
|
||
| This report gives a brief overview of the profiling operations performed on TEAMMATES. In particular, it includes a detailed discussion of the Load and Performance (L&P) testing framework and justification for our solution. | ||
RonakLakhotia marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ## Problem | ||
|
|
||
| TEAMMATES is one of the biggest student projects in the open source community. As of April 2019, TEAMMATES boasts a developer community of over 450 contributors and a codebase with ~130 KLoC. | ||
RonakLakhotia marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| Maintaining such a project demands high quality standards to ensure long term survival. | ||
| This means, continuously monitoring code health and product performance. As the number of developers and user base continue to grow, we need to ensure optimal performance at all times. | ||
RonakLakhotia marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| To do so, we need to be able to identify performance issue-prone operations with a quantitative measure so that they can be rectified. | ||
RonakLakhotia marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ## Overview of Solution | ||
|
|
||
| The idea behind L&P tests is to simplify the process of understanding production performance and enable the developers to address bottlenecks before they become genuine production issues. | ||
| Implementing these tests involves a few key points: | ||
|
|
||
| * A tool/software to help performing these tests. | ||
| * A method to simulate a large number of users and send requests to a target server. | ||
| * A way of generating reports to help developers understand the metrics. | ||
|
|
||
| After carefully considering various tools, we decided to use [Apache JMeter](https://jmeter.apache.org/) to help running the performance tests. | ||
| In this report we will discuss the reasons behind why we chose JMeter and a more detailed description of our implementation. | ||
|
|
||
| ## Tools considered for Performance Testing | ||
|
|
||
| Some of the tools that we considered before deciding on JMeter were: | ||
|
|
||
| * [Gatling](https://gatling.io/) - It higher barrier to entry for potential contributors. | ||
RonakLakhotia marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| * [LoadRunner](https://www.guru99.com/introduction-to-hp-loadrunner-and-its-archtecture.html) - This is a license tool and cost of using it is high. LoadRunner has a lot of protocols, such as HTTP, Oracle and SAP.WEB., but we don’t need this. | ||
RonakLakhotia marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| * [BlazeMeter](https://www.blazemeter.com/) | ||
RonakLakhotia marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ## Reasons for using JMeter | ||
|
|
||
| One of the main reasons we use JMeter over the other tools was the **extensive documentation** we found online. There are a number of resources to help you get started. Some of which we have listed below: | ||
RonakLakhotia marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| * [JMeter Tutorial for beginners](https://www.guru99.com/jmeter-tutorials.html) | ||
| * [How to use JMeter](https://www.blazemeter.com/blog/how-use-jmeter-assertions-three-easy-steps) | ||
| * [The official website](https://jmeter.apache.org/usermanual/build-web-test-plan.html) also offers a good documentation on how to get started. | ||
RonakLakhotia marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| Some other reasons why we found JMeter to be useful: | ||
|
|
||
| **Open Source** - JMeter is an open source software. This means that it can be downloaded free of cost. The developers can use its source code, can modify and customize it as per their requirement. | ||
|
|
||
| **Ease of Integration** - It is easier to integrate JMeter into the project because of the [JMeter Java API](https://jmeter.apache.org/api/index.html). There is also a [jmeter-gradle plugin](https://github.com/jmeter-gradle-plugin/jmeter-gradle-plugin) if you want to make it a part of your build process. | ||
RonakLakhotia marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| **Roust Reporting** - JMeter can generate effective reporting. The test results can be visualized by using Graph, Chart, and Tree View. JMeter supports different formats for reporting like text, XML, HTML and JSON. | ||
RonakLakhotia marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ## Current implementation of the solution | ||
|
|
||
| JMeter offers us a couple of ways to perform the tests. We had the choice of performing these tests with automating tools like jmeter-gradle plugin and the JMeter Java API. | ||
RonakLakhotia marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| We explored both possibilities but ended up using the JMeter Java API. Some key observations we made: | ||
|
|
||
| * The jmeter-gradle-plugin is not well maintained and does not have easy-to-find documentation. | ||
| * The existing resources are outdated and are not in sync with the latest version of JMeter. | ||
| * The JMeter Java API, on the other hand, fits well with TEAMMATES' backend testing framework. | ||
| * It is also easier to integrate it into the CI pipeline with a TestNG gradle task. | ||
| * The entire process is more coherent while allowing the same level of configuration. | ||
RonakLakhotia marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| A brief description of the process: | ||
|
|
||
| * Create a test json and csv file for the test. | ||
RonakLakhotia marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| * Since the data files are large (at least 5 times the size of test data used for E2E tests), they are not committed to the repo. This way, we can easily change the scale of the test without having to rewrite the code for generating the data. | ||
|
|
||
| * Create the JMeter test and run. | ||
| * Each test configures the test plan, similar to how it is done in the GUI. We also considered using a Builder pattern, but it didn’t make complete sense to do so (since we can’t say for sure what the components of the class are, and what order they should be in). Instead, we have created abstractions and default configurations which make it easier to create new tests. | ||
RonakLakhotia marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| * Determine the failure threshold criteria and display the summarised results for that endpoint. | ||
RonakLakhotia marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| * Delete the entities and data files created. | ||
|
|
||
| A more detailed overview of the tasks performed can be seen in the [Continuous Profiling Project page](https://github.com/teammates/teammates/projects/7). | ||
|
|
||
| ## Findings and Recommendations | ||
|
|
||
| Currently the performance issue-prone operations in TEAMMATES are as follows: | ||
RonakLakhotia marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| * Instructor page: Enrolling students | ||
|
|
||
| * Instructor page: Viewing feedback session results by instructor | ||
|
|
||
| * Student page: Submitting a feedback session when the number of questions is large | ||
|
|
||
| Our aim is to test these endpoints extensively and get metrics such as latency, throughput and other relevant results. | ||
RonakLakhotia marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| This is still a work-in-progress as we are yet to consolidate the results but our goal is to generate reports that will help the developers understand the performance of each endpoint. | ||
|
|
||
| ## Future Work | ||
|
|
||
| We need to fine-tune the L&P test parameters and set suitable thresholds for failure. These should align with the goals of the application. | ||
| Currently login takes a lot of time (compared to student profile, at least). So, we can explore the idea of using a delay after login, and testing the endpoint after that. | ||
RonakLakhotia marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| We can also explore elements like Timers and JSON Extractors. By synchronizing, Timer JMeter **Spike Testing** can be achieved. | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.