SlideShare une entreprise Scribd logo
1  sur  12
Performance Testing REST APIs
Selenium Conference 2013
Jason Weden @jweden
Principal Quality Engineer
Constant Contact, WebServices
Copyright © 2012 Constant Contact Inc. 1
Who We Are
 What do we do?
 Expose our internal web services externally to developers and
partners via an API for their own applications.
 http://developer.constantcontact.com
 Fun Digression: Very easy to get up and running with signing into API using
Mashery and using our console to hit the REST API
Copyright © 2012 Constant Contact Inc. 2
Problem Domain
 System Under Test: HTTP REST APIs
 Hitting the REST API with concurrent connections
 Defining your Performance Test approach
 Getting & Sharing results – performance metrics
Copyright © 2012 Constant Contact Inc. 3
Lesson 1: Be DRY
 Why in the heck repeat yourself?
 You already have the logic in your functional tests for REST calls so
reuse that logic for your performance tests
 http://techblog.constantcontact.com/api/what-lego-blocks-teach-us-
about-rest-api-testing/
 Reuse your data-seeding (e.g. for tests that have GET calls)
 Tools like LoadRunner and Jmeter have their place but
 They’re creating blocking connections that reduce scalability
 You are wet – you’re rewriting logic you already wrote in your functional
tests
 You confine the creation, execution, and general knowledge of the
performance testing arena to one or more toolsmiths
Copyright © 2012 Constant Contact Inc. 4
Lesson 2: Choose Carefully
 Choose your http client library with care
 Non-blocking
 Scale-up
 Seriously consider Akka (if on the JVM)
 Non-blocking but with high throughput
 Scales to multiple processors and prevents need to deal with shared state
 More on this later
 Other Examples on the JVM of non-blocking http clients
 http://spray.io (Scala) – Spray – Akka-based
 http://www.eclipse.org/jetty/ (Java) -- Jetty 9
 https://github.com/timboudreau/netty-http-client (Java) -- Netty
Copyright © 2012 Constant Contact Inc. 5
Lesson 2: Choose Carefully (cont.) – Our Choice…
 Written in Java but takes advantage of Akka for concurrency
 Integrated into test framework for everyone to use
 3rd Party libraries
 Apache HttpClient library
 Apache HttpCore library
 Akka concurrency framework
 Apache Commons Math3 library
 High performance
 Easy to use programmatic API – small learning curve
 Developers can go in and create performance tests
 Useful for any http functional OR performance testing
 Even functional tests have performance metrics logged
Copyright © 2012 Constant Contact Inc. 6
Lesson 2: Choose Carefully (cont.) – Our Choice…
 Found errors & significant bottlenecks
 Comparison with JMeter and LoadRunner
 Preliminary tests show faster than JMeter (even with our 8
threads vs JMeter's 1500)
 All performance tests can be checked into source control
 No dependency on toolsmiths for HTTP performance testing
 Performance testing experience shared across the team
 Likely faster than JMeter and LoadRunner -- still to be
scientifically determined
 Ability to tweak our home-grown solution vs. closed source
purchased solutions. (e.g. lots of concurrency properties to
tweak)
Copyright © 2012 Constant Contact Inc. 7
Lesson 3: Devise a Performance Test Plan
 What is your SLA? (e.g. avg. response time, avg. requests/sec)
 What kind of performance test? Options:
 Profile of production performance. Do the following
concurrently:
 X amount of POSTs to endpoint 1
 Y amount of GETs to endpoint 2 (data seeding needed)
 Z amount of DELETEs to endpoint 3 (data seeding needed)
 One type of Request: x amount of GETs
 Longevity – run test above for x amount of time
 What metrics will be recorded (client vs server)?
 How will results be captured and reported?
 Have sign-offs on your test plan (e.g. in a wiki section)
Copyright © 2012 Constant Contact Inc. 8
Lesson 4: Capture Perf. Test Results in a Database
 Capture:
 Performance Metrics
 Client: min/max/avg response time, standard deviation, avg
requests/second, percentiles, request failures
 Server: cpu, memory, open db connections, thread count, consider app.
profiling
 Test tool used and version
 Test name and description
 Freeform comments
 Concurrency level
 In what environment was test performed (server hostnames)
 When it was performed
 Version of Test tool and application under test
 Allows for posterity
 Allows for trending
Copyright © 2012 Constant Contact Inc. 9
Lesson 5: Run Performance Tests Continuously
 Lobby for a dedicated performance environment
 Run tests in non-production CI environments if only for trending relative
measurements
 Run daily
Copyright © 2012 Constant Contact Inc. 10
Lesson 6: Create Visualizations for Perf Test Results
 Charts, Charts, Charts: Have a webpage dashboard
 Preferably having ability to query or filter to obtain customized results
 Charts, Charts, Charts: Email results of each performance test run
 Visualization Research:
 Splunk w/ DB Connect
 D3: http://shop.oreilly.com/product/0636920026938.do
 Fun Digression: playing with this at: http://codepen.io
Copyright © 2012 Constant Contact Inc. 11
References – The end…
 http://akka.io/
 http://commons.apache.org/math/
 http://hc.apache.org/httpcomponents-client-ga/
 Slides available at: https://www.slideshare.net/jweden/rest-
performance-testing
Copyright © 2012 Constant Contact Inc. 12

Contenu connexe

Tendances

QA. Load Testing
QA. Load TestingQA. Load Testing
QA. Load TestingAlex Galkin
 
Load Testing Strategy 101
Load Testing Strategy 101Load Testing Strategy 101
Load Testing Strategy 101iradari
 
Performance testing with Jmeter
Performance testing with JmeterPerformance testing with Jmeter
Performance testing with JmeterPrashanth Kumar
 
Performance testing using jmeter
Performance testing using jmeterPerformance testing using jmeter
Performance testing using jmeterRachappa Bandi
 
Introduction to performance testing
Introduction to performance testingIntroduction to performance testing
Introduction to performance testingTharinda Liyanage
 
Performance testing using Jmeter for apps which needs authentication
Performance testing using Jmeter for apps which needs authenticationPerformance testing using Jmeter for apps which needs authentication
Performance testing using Jmeter for apps which needs authenticationJay Jha
 
JMeter vs LoadRunner | Edureka
JMeter vs LoadRunner | EdurekaJMeter vs LoadRunner | Edureka
JMeter vs LoadRunner | EdurekaEdureka!
 
Automation test framework with cucumber – BDD
Automation test framework with cucumber – BDDAutomation test framework with cucumber – BDD
Automation test framework with cucumber – BDD123abcda
 
Performance testing jmeter
Performance testing jmeterPerformance testing jmeter
Performance testing jmeterBhojan Rajan
 
4 Major Advantages of API Testing
4 Major Advantages of API Testing4 Major Advantages of API Testing
4 Major Advantages of API TestingQASource
 
JMeter JMX Script Creation via BlazeMeter
JMeter JMX Script Creation via BlazeMeterJMeter JMX Script Creation via BlazeMeter
JMeter JMX Script Creation via BlazeMeterRapidValue
 
Postman Webinar: “Continuous Testing with Postman”
Postman Webinar: “Continuous Testing with Postman”Postman Webinar: “Continuous Testing with Postman”
Postman Webinar: “Continuous Testing with Postman”Postman
 
Cross-Browser-Testing with Protractor & Browserstack
Cross-Browser-Testing with Protractor & BrowserstackCross-Browser-Testing with Protractor & Browserstack
Cross-Browser-Testing with Protractor & BrowserstackLeo Lindhorst
 

Tendances (20)

Api testing
Api testingApi testing
Api testing
 
QA. Load Testing
QA. Load TestingQA. Load Testing
QA. Load Testing
 
Load Testing Strategy 101
Load Testing Strategy 101Load Testing Strategy 101
Load Testing Strategy 101
 
API Testing for everyone.pptx
API Testing for everyone.pptxAPI Testing for everyone.pptx
API Testing for everyone.pptx
 
Performance testing with Jmeter
Performance testing with JmeterPerformance testing with Jmeter
Performance testing with Jmeter
 
Performance testing using jmeter
Performance testing using jmeterPerformance testing using jmeter
Performance testing using jmeter
 
Introduction to performance testing
Introduction to performance testingIntroduction to performance testing
Introduction to performance testing
 
Automation With A Tool Demo
Automation With A Tool DemoAutomation With A Tool Demo
Automation With A Tool Demo
 
Api Testing
Api TestingApi Testing
Api Testing
 
Performance testing using Jmeter for apps which needs authentication
Performance testing using Jmeter for apps which needs authenticationPerformance testing using Jmeter for apps which needs authentication
Performance testing using Jmeter for apps which needs authentication
 
JMeter vs LoadRunner | Edureka
JMeter vs LoadRunner | EdurekaJMeter vs LoadRunner | Edureka
JMeter vs LoadRunner | Edureka
 
Neoload overview
Neoload overviewNeoload overview
Neoload overview
 
Jmeter
JmeterJmeter
Jmeter
 
Automation test framework with cucumber – BDD
Automation test framework with cucumber – BDDAutomation test framework with cucumber – BDD
Automation test framework with cucumber – BDD
 
Performance testing jmeter
Performance testing jmeterPerformance testing jmeter
Performance testing jmeter
 
4 Major Advantages of API Testing
4 Major Advantages of API Testing4 Major Advantages of API Testing
4 Major Advantages of API Testing
 
JMeter JMX Script Creation via BlazeMeter
JMeter JMX Script Creation via BlazeMeterJMeter JMX Script Creation via BlazeMeter
JMeter JMX Script Creation via BlazeMeter
 
Postman Webinar: “Continuous Testing with Postman”
Postman Webinar: “Continuous Testing with Postman”Postman Webinar: “Continuous Testing with Postman”
Postman Webinar: “Continuous Testing with Postman”
 
Cross-Browser-Testing with Protractor & Browserstack
Cross-Browser-Testing with Protractor & BrowserstackCross-Browser-Testing with Protractor & Browserstack
Cross-Browser-Testing with Protractor & Browserstack
 
Postman.ppt
Postman.pptPostman.ppt
Postman.ppt
 

En vedette

Performance Testing using LoadRunner - Kamran Khan [chromeis.com]
Performance Testing using LoadRunner - Kamran Khan [chromeis.com]Performance Testing using LoadRunner - Kamran Khan [chromeis.com]
Performance Testing using LoadRunner - Kamran Khan [chromeis.com]Kamran Khan
 
API Best Practices Webinar: Metrics - What to Measure
API Best Practices Webinar:  Metrics - What to MeasureAPI Best Practices Webinar:  Metrics - What to Measure
API Best Practices Webinar: Metrics - What to MeasureApigee | Google Cloud
 
KPIs for APIs (and how API Calls are the new Web Hits, and you may be measuri...
KPIs for APIs (and how API Calls are the new Web Hits, and you may be measuri...KPIs for APIs (and how API Calls are the new Web Hits, and you may be measuri...
KPIs for APIs (and how API Calls are the new Web Hits, and you may be measuri...John Musser
 
How to Automate API Testing
How to Automate API TestingHow to Automate API Testing
How to Automate API TestingBruno Pedro
 
Evaluating and Testing Web APIs
Evaluating and Testing Web APIsEvaluating and Testing Web APIs
Evaluating and Testing Web APIsSmartBear
 
Performance testing using hp load runner
Performance testing using hp load runnerPerformance testing using hp load runner
Performance testing using hp load runnerReturn on Intelligence
 
API Best Practices
API Best PracticesAPI Best Practices
API Best PracticesSai Koppala
 
Why API Ops is the Next Wave of DevOps
Why API Ops is the Next Wave of DevOpsWhy API Ops is the Next Wave of DevOps
Why API Ops is the Next Wave of DevOpsJohn Musser
 
REST API testing with SpecFlow
REST API testing with SpecFlowREST API testing with SpecFlow
REST API testing with SpecFlowAiste Stikliute
 
Five Ways to Scale your API Without Touching Your Code
Five Ways to Scale your API Without Touching Your CodeFive Ways to Scale your API Without Touching Your Code
Five Ways to Scale your API Without Touching Your Code3scale
 
Web api scalability and performance
Web api scalability and performanceWeb api scalability and performance
Web api scalability and performanceHimanshu Desai
 
Postman tests in jenkins
Postman tests in jenkinsPostman tests in jenkins
Postman tests in jenkinsAlex Galkin
 
Django敏捷开发 刘天斯
Django敏捷开发 刘天斯Django敏捷开发 刘天斯
Django敏捷开发 刘天斯liuts
 
Automated Performance Testing With J Meter And Maven
Automated  Performance  Testing With  J Meter And  MavenAutomated  Performance  Testing With  J Meter And  Maven
Automated Performance Testing With J Meter And MavenPerconaPerformance
 
Scaling APIs: Predict, Prepare for, Overcome the Challenges
Scaling APIs: Predict, Prepare for, Overcome the ChallengesScaling APIs: Predict, Prepare for, Overcome the Challenges
Scaling APIs: Predict, Prepare for, Overcome the ChallengesApigee | Google Cloud
 
Automate WebServices Rest API (testing) using Java
Automate WebServices Rest API (testing) using JavaAutomate WebServices Rest API (testing) using Java
Automate WebServices Rest API (testing) using Javaayman diab
 

En vedette (20)

Performance Testing using LoadRunner - Kamran Khan [chromeis.com]
Performance Testing using LoadRunner - Kamran Khan [chromeis.com]Performance Testing using LoadRunner - Kamran Khan [chromeis.com]
Performance Testing using LoadRunner - Kamran Khan [chromeis.com]
 
API Best Practices Webinar: Metrics - What to Measure
API Best Practices Webinar:  Metrics - What to MeasureAPI Best Practices Webinar:  Metrics - What to Measure
API Best Practices Webinar: Metrics - What to Measure
 
KPIs for APIs (and how API Calls are the new Web Hits, and you may be measuri...
KPIs for APIs (and how API Calls are the new Web Hits, and you may be measuri...KPIs for APIs (and how API Calls are the new Web Hits, and you may be measuri...
KPIs for APIs (and how API Calls are the new Web Hits, and you may be measuri...
 
How to Automate API Testing
How to Automate API TestingHow to Automate API Testing
How to Automate API Testing
 
Evaluating and Testing Web APIs
Evaluating and Testing Web APIsEvaluating and Testing Web APIs
Evaluating and Testing Web APIs
 
Api testing
Api testingApi testing
Api testing
 
Performance testing using hp load runner
Performance testing using hp load runnerPerformance testing using hp load runner
Performance testing using hp load runner
 
API Best Practices
API Best PracticesAPI Best Practices
API Best Practices
 
Why API Ops is the Next Wave of DevOps
Why API Ops is the Next Wave of DevOpsWhy API Ops is the Next Wave of DevOps
Why API Ops is the Next Wave of DevOps
 
REST API testing with SpecFlow
REST API testing with SpecFlowREST API testing with SpecFlow
REST API testing with SpecFlow
 
Building Web APIs that Scale
Building Web APIs that ScaleBuilding Web APIs that Scale
Building Web APIs that Scale
 
Five Ways to Scale your API Without Touching Your Code
Five Ways to Scale your API Without Touching Your CodeFive Ways to Scale your API Without Touching Your Code
Five Ways to Scale your API Without Touching Your Code
 
The Groovy Way
The Groovy WayThe Groovy Way
The Groovy Way
 
Web api scalability and performance
Web api scalability and performanceWeb api scalability and performance
Web api scalability and performance
 
Postman tests in jenkins
Postman tests in jenkinsPostman tests in jenkins
Postman tests in jenkins
 
Django敏捷开发 刘天斯
Django敏捷开发 刘天斯Django敏捷开发 刘天斯
Django敏捷开发 刘天斯
 
Performance Engineering Basics
Performance Engineering BasicsPerformance Engineering Basics
Performance Engineering Basics
 
Automated Performance Testing With J Meter And Maven
Automated  Performance  Testing With  J Meter And  MavenAutomated  Performance  Testing With  J Meter And  Maven
Automated Performance Testing With J Meter And Maven
 
Scaling APIs: Predict, Prepare for, Overcome the Challenges
Scaling APIs: Predict, Prepare for, Overcome the ChallengesScaling APIs: Predict, Prepare for, Overcome the Challenges
Scaling APIs: Predict, Prepare for, Overcome the Challenges
 
Automate WebServices Rest API (testing) using Java
Automate WebServices Rest API (testing) using JavaAutomate WebServices Rest API (testing) using Java
Automate WebServices Rest API (testing) using Java
 

Similaire à Performance Testing REST APIs

Performancetestingjmeter 131210111657-phpapp02
Performancetestingjmeter 131210111657-phpapp02Performancetestingjmeter 131210111657-phpapp02
Performancetestingjmeter 131210111657-phpapp02Nitish Bhardwaj
 
Automated Acceptance Tests & Tool choice
Automated Acceptance Tests & Tool choiceAutomated Acceptance Tests & Tool choice
Automated Acceptance Tests & Tool choicetoddbr
 
Shuvam dutta | Performance tester
Shuvam dutta | Performance testerShuvam dutta | Performance tester
Shuvam dutta | Performance testerShuvam Dutta
 
API automation with JMeter + Bamboo CI
API automation with JMeter + Bamboo CIAPI automation with JMeter + Bamboo CI
API automation with JMeter + Bamboo CIMykola Kovsh
 
Mykola Kovsh - Functional API automation with Jmeter
Mykola Kovsh - Functional API automation with JmeterMykola Kovsh - Functional API automation with Jmeter
Mykola Kovsh - Functional API automation with JmeterIevgenii Katsan
 
Performance testing and j meter
Performance testing and j meterPerformance testing and j meter
Performance testing and j meterPurna Chandar
 
Building Maintainable Android Apps (DroidCon NYC 2014)
Building Maintainable Android Apps (DroidCon NYC 2014)Building Maintainable Android Apps (DroidCon NYC 2014)
Building Maintainable Android Apps (DroidCon NYC 2014)Kevin Schultz
 
Performancetestingjmeter 121109061704-phpapp02
Performancetestingjmeter 121109061704-phpapp02Performancetestingjmeter 121109061704-phpapp02
Performancetestingjmeter 121109061704-phpapp02Shivakumara .
 
Stepin evening presented
Stepin evening presentedStepin evening presented
Stepin evening presentedVijayan Reddy
 
Automation testing
Automation testingAutomation testing
Automation testingTomy Rhymond
 
JMeter & ColdFusion
JMeter & ColdFusion JMeter & ColdFusion
JMeter & ColdFusion isummation
 
Web and load testing with Visual Studio 2010 Ultimate
Web and load testing with Visual Studio 2010 UltimateWeb and load testing with Visual Studio 2010 Ultimate
Web and load testing with Visual Studio 2010 UltimateAbhimanyu Singhal
 
Introduction to Back End Automation Testing - Nguyen Vu Hoang, Hoang Phi
Introduction to Back End Automation Testing - Nguyen Vu Hoang, Hoang PhiIntroduction to Back End Automation Testing - Nguyen Vu Hoang, Hoang Phi
Introduction to Back End Automation Testing - Nguyen Vu Hoang, Hoang PhiHo Chi Minh City Software Testing Club
 
Getting Started with Apache Jmeter
Getting Started with Apache JmeterGetting Started with Apache Jmeter
Getting Started with Apache JmeterMindfire Solutions
 
eXo Platform SEA - Play Framework Introduction
eXo Platform SEA - Play Framework IntroductioneXo Platform SEA - Play Framework Introduction
eXo Platform SEA - Play Framework Introductionvstorm83
 
Neha Arora_Resume
Neha Arora_ResumeNeha Arora_Resume
Neha Arora_ResumeNeha Arora
 

Similaire à Performance Testing REST APIs (20)

Performancetestingjmeter 131210111657-phpapp02
Performancetestingjmeter 131210111657-phpapp02Performancetestingjmeter 131210111657-phpapp02
Performancetestingjmeter 131210111657-phpapp02
 
Automated Acceptance Tests & Tool choice
Automated Acceptance Tests & Tool choiceAutomated Acceptance Tests & Tool choice
Automated Acceptance Tests & Tool choice
 
QSpiders - Presentation JMeter
QSpiders - Presentation JMeterQSpiders - Presentation JMeter
QSpiders - Presentation JMeter
 
Shuvam dutta
Shuvam duttaShuvam dutta
Shuvam dutta
 
Shuvam dutta | Performance tester
Shuvam dutta | Performance testerShuvam dutta | Performance tester
Shuvam dutta | Performance tester
 
API automation with JMeter + Bamboo CI
API automation with JMeter + Bamboo CIAPI automation with JMeter + Bamboo CI
API automation with JMeter + Bamboo CI
 
Mykola Kovsh - Functional API automation with Jmeter
Mykola Kovsh - Functional API automation with JmeterMykola Kovsh - Functional API automation with Jmeter
Mykola Kovsh - Functional API automation with Jmeter
 
Jmeter From Scratch
Jmeter From ScratchJmeter From Scratch
Jmeter From Scratch
 
Performance testing and j meter
Performance testing and j meterPerformance testing and j meter
Performance testing and j meter
 
Building Maintainable Android Apps (DroidCon NYC 2014)
Building Maintainable Android Apps (DroidCon NYC 2014)Building Maintainable Android Apps (DroidCon NYC 2014)
Building Maintainable Android Apps (DroidCon NYC 2014)
 
Performancetestingjmeter 121109061704-phpapp02
Performancetestingjmeter 121109061704-phpapp02Performancetestingjmeter 121109061704-phpapp02
Performancetestingjmeter 121109061704-phpapp02
 
Stepin evening presented
Stepin evening presentedStepin evening presented
Stepin evening presented
 
Automation testing
Automation testingAutomation testing
Automation testing
 
JMeter & ColdFusion
JMeter & ColdFusion JMeter & ColdFusion
JMeter & ColdFusion
 
Web and load testing with Visual Studio 2010 Ultimate
Web and load testing with Visual Studio 2010 UltimateWeb and load testing with Visual Studio 2010 Ultimate
Web and load testing with Visual Studio 2010 Ultimate
 
Introduction to Back End Automation Testing - Nguyen Vu Hoang, Hoang Phi
Introduction to Back End Automation Testing - Nguyen Vu Hoang, Hoang PhiIntroduction to Back End Automation Testing - Nguyen Vu Hoang, Hoang Phi
Introduction to Back End Automation Testing - Nguyen Vu Hoang, Hoang Phi
 
Selva_Selenium
Selva_SeleniumSelva_Selenium
Selva_Selenium
 
Getting Started with Apache Jmeter
Getting Started with Apache JmeterGetting Started with Apache Jmeter
Getting Started with Apache Jmeter
 
eXo Platform SEA - Play Framework Introduction
eXo Platform SEA - Play Framework IntroductioneXo Platform SEA - Play Framework Introduction
eXo Platform SEA - Play Framework Introduction
 
Neha Arora_Resume
Neha Arora_ResumeNeha Arora_Resume
Neha Arora_Resume
 

Dernier

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 

Dernier (20)

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 

Performance Testing REST APIs

  • 1. Performance Testing REST APIs Selenium Conference 2013 Jason Weden @jweden Principal Quality Engineer Constant Contact, WebServices Copyright © 2012 Constant Contact Inc. 1
  • 2. Who We Are  What do we do?  Expose our internal web services externally to developers and partners via an API for their own applications.  http://developer.constantcontact.com  Fun Digression: Very easy to get up and running with signing into API using Mashery and using our console to hit the REST API Copyright © 2012 Constant Contact Inc. 2
  • 3. Problem Domain  System Under Test: HTTP REST APIs  Hitting the REST API with concurrent connections  Defining your Performance Test approach  Getting & Sharing results – performance metrics Copyright © 2012 Constant Contact Inc. 3
  • 4. Lesson 1: Be DRY  Why in the heck repeat yourself?  You already have the logic in your functional tests for REST calls so reuse that logic for your performance tests  http://techblog.constantcontact.com/api/what-lego-blocks-teach-us- about-rest-api-testing/  Reuse your data-seeding (e.g. for tests that have GET calls)  Tools like LoadRunner and Jmeter have their place but  They’re creating blocking connections that reduce scalability  You are wet – you’re rewriting logic you already wrote in your functional tests  You confine the creation, execution, and general knowledge of the performance testing arena to one or more toolsmiths Copyright © 2012 Constant Contact Inc. 4
  • 5. Lesson 2: Choose Carefully  Choose your http client library with care  Non-blocking  Scale-up  Seriously consider Akka (if on the JVM)  Non-blocking but with high throughput  Scales to multiple processors and prevents need to deal with shared state  More on this later  Other Examples on the JVM of non-blocking http clients  http://spray.io (Scala) – Spray – Akka-based  http://www.eclipse.org/jetty/ (Java) -- Jetty 9  https://github.com/timboudreau/netty-http-client (Java) -- Netty Copyright © 2012 Constant Contact Inc. 5
  • 6. Lesson 2: Choose Carefully (cont.) – Our Choice…  Written in Java but takes advantage of Akka for concurrency  Integrated into test framework for everyone to use  3rd Party libraries  Apache HttpClient library  Apache HttpCore library  Akka concurrency framework  Apache Commons Math3 library  High performance  Easy to use programmatic API – small learning curve  Developers can go in and create performance tests  Useful for any http functional OR performance testing  Even functional tests have performance metrics logged Copyright © 2012 Constant Contact Inc. 6
  • 7. Lesson 2: Choose Carefully (cont.) – Our Choice…  Found errors & significant bottlenecks  Comparison with JMeter and LoadRunner  Preliminary tests show faster than JMeter (even with our 8 threads vs JMeter's 1500)  All performance tests can be checked into source control  No dependency on toolsmiths for HTTP performance testing  Performance testing experience shared across the team  Likely faster than JMeter and LoadRunner -- still to be scientifically determined  Ability to tweak our home-grown solution vs. closed source purchased solutions. (e.g. lots of concurrency properties to tweak) Copyright © 2012 Constant Contact Inc. 7
  • 8. Lesson 3: Devise a Performance Test Plan  What is your SLA? (e.g. avg. response time, avg. requests/sec)  What kind of performance test? Options:  Profile of production performance. Do the following concurrently:  X amount of POSTs to endpoint 1  Y amount of GETs to endpoint 2 (data seeding needed)  Z amount of DELETEs to endpoint 3 (data seeding needed)  One type of Request: x amount of GETs  Longevity – run test above for x amount of time  What metrics will be recorded (client vs server)?  How will results be captured and reported?  Have sign-offs on your test plan (e.g. in a wiki section) Copyright © 2012 Constant Contact Inc. 8
  • 9. Lesson 4: Capture Perf. Test Results in a Database  Capture:  Performance Metrics  Client: min/max/avg response time, standard deviation, avg requests/second, percentiles, request failures  Server: cpu, memory, open db connections, thread count, consider app. profiling  Test tool used and version  Test name and description  Freeform comments  Concurrency level  In what environment was test performed (server hostnames)  When it was performed  Version of Test tool and application under test  Allows for posterity  Allows for trending Copyright © 2012 Constant Contact Inc. 9
  • 10. Lesson 5: Run Performance Tests Continuously  Lobby for a dedicated performance environment  Run tests in non-production CI environments if only for trending relative measurements  Run daily Copyright © 2012 Constant Contact Inc. 10
  • 11. Lesson 6: Create Visualizations for Perf Test Results  Charts, Charts, Charts: Have a webpage dashboard  Preferably having ability to query or filter to obtain customized results  Charts, Charts, Charts: Email results of each performance test run  Visualization Research:  Splunk w/ DB Connect  D3: http://shop.oreilly.com/product/0636920026938.do  Fun Digression: playing with this at: http://codepen.io Copyright © 2012 Constant Contact Inc. 11
  • 12. References – The end…  http://akka.io/  http://commons.apache.org/math/  http://hc.apache.org/httpcomponents-client-ga/  Slides available at: https://www.slideshare.net/jweden/rest- performance-testing Copyright © 2012 Constant Contact Inc. 12