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
開発者から情シスまで - 多様なユーザー層に届けるAPI提供戦略 / Postman API Night Okinawa 2026 Winter
tasshi
0
200
Data-Centric Kaggle
isax1015
2
770
MDN Web Docs に日本語翻訳でコントリビュート
ohmori_yusuke
0
650
20260127_試行錯誤の結晶を1冊に。著者が解説 先輩データサイエンティストからの指南書 / author's_commentary_ds_instructions_guide
nash_efp
1
950
フロントエンド開発の勘所 -複数事業を経験して見えた判断軸の違い-
heimusu
7
2.8k
[KNOTS 2026登壇資料]AIで拡張‧交差する プロダクト開発のプロセス および携わるメンバーの役割
hisatake
0
270
humanlayerのブログから学ぶ、良いCLAUDE.mdの書き方
tsukamoto1783
0
190
OSSとなったswift-buildで Xcodeのビルドを差し替えられるため 自分でXcodeを直せる時代になっている ダイアモンド問題編
yimajo
3
610
AgentCoreとHuman in the Loop
har1101
5
230
インターン生でもAuth0で認証基盤刷新が出来るのか
taku271
0
190
例外処理とどう使い分ける?Result型を使ったエラー設計 #burikaigi
kajitack
16
6k
【卒業研究】会話ログ分析によるユーザーごとの関心に応じた話題提案手法
momok47
0
190
Featured
See All Featured
エンジニアに許された特別な時間の終わり
watany
106
230k
VelocityConf: Rendering Performance Case Studies
addyosmani
333
24k
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
3
98
Designing for Timeless Needs
cassininazir
0
130
Rebuilding a faster, lazier Slack
samanthasiow
85
9.4k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.1k
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
84
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
3.6k
GraphQLとの向き合い方2022年版
quramy
50
14k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
180
How GitHub (no longer) Works
holman
316
140k
ラッコキーワード サービス紹介資料
rakko
1
2.3M
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