Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Performance testing with Multi-Mechanize
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Rich Leland
February 07, 2012
Programming
1
400
Performance testing with Multi-Mechanize
Presentation to DC Python on Feb 7, 2012 about Multi-Mechanize, a performance testing framework.
Rich Leland
February 07, 2012
Tweet
Share
Other Decks in Programming
See All in Programming
Vibe Coding - AI 驅動的軟體開發
mickyp100
0
170
Oxlint JS plugins
kazupon
1
870
[KNOTS 2026登壇資料]AIで拡張‧交差する プロダクト開発のプロセス および携わるメンバーの役割
hisatake
0
270
AI巻き込み型コードレビューのススメ
nealle
1
160
MDN Web Docs に日本語翻訳でコントリビュート
ohmori_yusuke
0
650
Architectural Extensions
denyspoltorak
0
280
360° Signals in Angular: Signal Forms with SignalStore & Resources @ngLondon 01/2026
manfredsteyer
PRO
0
120
dchart: charts from deck markup
ajstarks
3
990
【卒業研究】会話ログ分析によるユーザーごとの関心に応じた話題提案手法
momok47
0
190
余白を設計しフロントエンド開発を 加速させる
tsukuha
7
2.1k
AI前提で考えるiOSアプリのモダナイズ設計
yuukiw00w
0
220
AIによる高速開発をどう制御するか? ガードレール設置で開発速度と品質を両立させたチームの事例
tonkotsuboy_com
7
2.2k
Featured
See All Featured
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
140
Build The Right Thing And Hit Your Dates
maggiecrowley
38
3k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
117
110k
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
0
200
So, you think you're a good person
axbom
PRO
2
1.9k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
180
How To Stay Up To Date on Web Technology
chriscoyier
791
250k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
92
WCS-LA-2024
lcolladotor
0
450
Prompt Engineering for Job Search
mfonobong
0
160
The Mindset for Success: Future Career Progression
greggifford
PRO
0
240
Transcript
Rich Leland DC Python - February 7, 2012 PERFORMANCE TESTING
WITH
WHAT IS MULTI-MECHANIZE?
WHAT IS PERFORMANCE TESTING?
UNDERSTAND AND DEFINE YOUR GOALS
WRITE TESTS, RUN. RINSE & REPEAT.
None
OBLIGATORY BILL MURRAY PHOTO
NOW WHAT?
None
USE THEM ALL
WHY USE MULTI-MECHANIZE?
IT’S PYTHON OH, AND IT CAN TEST MORE THAN JUST
WEBS
PAGES
FORMS
APIs
DATABASES
CACHE
ANYTHING YOU CAN WRITE USING PYTHON
HOW DO I USE IT?
pip install multi-mechanize
multimech-newproject <myproject>
myproject ├── test_scripts │ └── example.py └── config.cfg multimech-newproject myproject
[global] run_time: 30 rampup: 0 results_ts_interval: 10 progress_bar: on console_logging:
off xml_report: off [user_group-1] threads: 3 script: example.py [user_group-2] threads: 3 script: example.py
import requests import time class Transaction(object): def run(self): start =
time.time() url = 'http://www.treehugger.com/' r = requests.get(url) latency = time.time() - start self.custom_timers['Home_Page'] = latency time.sleep(1)
multimech-run <myproject>
$ multimech-run . user_groups: 2 threads: 20 [================100%==================] 60s/60s transactions:
232 timers: 464 errors: 0 waiting for all requests to finish... analyzing results... created results/results_2012.02.06_23.11.01/results.html done.
RESULTS
myproject ├── results │ ├── results_2012.02.05_00.16.23 │ │ ├── config.cfg
│ │ ├── results.csv │ │ └── results.html │ └── static ├── test_scripts └── config.cfg Results output
None
None
AIGHT, COOL. HOW ABOUT SOME OTHER EXAMPLES?
import requests import time class Transaction(object): def run(self): start =
time.time() url = 'http://example.com/api/v1/articles/' r = requests.get(url) latency = time.time() - start self.custom_timers['API_Articles'] = latency time.sleep(1)
import time from sqlalchemy import create_engine class Transaction(object): def __init__(self):
self.custom_timers = {} conn_info = 'postgresql+psycopg2://rleland@localhost/th' self.engine = create_engine(conn_info) def run(self): start = time.time() self.engine.execute("SELECT COUNT(*) FROM cms_entry") latency = time.time() - start self.custom_timers['Entries_Count'] = latency
import memcache import random import time NODES = ['192.168.10.2:11211',] DATA_SIZE
= 30000 WAIT_TIME = .1 KEY_RANGE = (1, 1000000) class Transaction(object): def __init__(self): self.mc = memcache.Client(NODES) self.custom_timers = {} def run(self): key = str(random.randint(*KEY_RANGE)) data = '*' * DATA_SIZE start_timer = time.time() self.mc.set(key, data) stop_timer = time.time() self.custom_timers['SET'] = stop_timer - start_timer start_timer = time.time() self.mc.get(key) stop_timer = time.time() self.custom_timers['GET'] = stop_timer - start_timer time.sleep(WAIT_TIME)
None
SET GOALS WRITE TESTS RUN TESTS ANALYZE RESPOND REPEAT
THANK YOU
Docs http://testutils.org/multi-mechanize/ Code http://github.com/cgoldberg/multi-mechanize Twitter @multimechanize IRC #multimech NOW GO
GET YOU SOME