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
Tests API
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Yoshiki Nakagawa
August 30, 2016
Programming
79
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Tests API
Yoshiki Nakagawa
August 30, 2016
More Decks by Yoshiki Nakagawa
See All by Yoshiki Nakagawa
Amazon Bedrock で作る未来の開発サイクルと オペレーション戦略 / AWS Summit Japan 2025
yyoshiki41
0
1.3k
MCP Documentation Server @AI Coding Meetup #1
yyoshiki41
2
4.2k
Go API クライアントの実装 〜Go Conference に載せれなかったTIPS〜
yyoshiki41
0
770
マルチテナントのアプリケーション実装 〜実践編〜
yyoshiki41
5
3.1k
Canary Deployments
yyoshiki41
0
590
go-gmail-drafts
yyoshiki41
0
800
Graceful Upgrade for Go App
yyoshiki41
0
150
Other Decks in Programming
See All in Programming
freeeにおけるEvalsの実践例の紹介
freee
PRO
0
150
夏だ!祭りだ!祭りとはドメインモデリングでは?
ryugen04
0
390
まだ間に合う!今年の夏こそSchemeのマクロ展開器を完全理解!
omasanori
0
500
思考垂れ流し開発 ~音声入力 × AIエージェント × 開発ハーネスによる試行錯誤~
npostring
0
170
Dockerfile CMD for Node.js
grazie1999
0
120
「つくるAI」だけではバグは見つからない ~テストに必要な「見つけるAI」を分離させる戦略~
mfunaki
0
180
仕様駆動開発へのトライを機に チームに適合する手法を模索し続けている話
freee
PRO
0
620
30年振りにコンパイラの定数整数除算を改善した
herumi
9
4.2k
Go を使い始めて 2 ヶ月の学び / My first two months with Go
contour_gara
0
380
komatsuna「分散システムにおけるバグ分析手法」
komatsunaqa
0
280
KotlinConf Extended South Korea 2026 Keynote
l2hyunwoo
0
120
ALB ログから Trace を気合で繋げる技術
fohte
5
520
Featured
See All Featured
Making the Leap to Tech Lead
cromwellryan
135
10k
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
420
Deep Space Network (abreviated)
tonyrice
0
270
The Pragmatic Product Professional
lauravandoore
37
7.4k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
810
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
3k
A Tale of Four Properties
chriscoyier
163
24k
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
64
56k
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
550
The Limits of Empathy - UXLibs8
cassininazir
1
610
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
67
57k
Writing Fast Ruby
sferik
630
63k
Transcript
Tests API Agora Tech Talk #5 Aug / 30 /
2016 @yyoshiki41 Yoshiki Nakagawa
Health Check API Runscope Blog Build a Health Check API
for Services Underneath Your API TL;DR • Create separate health check API endpoints for all services! • Set up notifications!
Health Check API How do we monitor them? • MySQL
• Redis • BIND • etc ... They don't come with (HTTP) RESTful APIs ! Communicate over lower-level protocols like TCP and UDP.
Good Example! ElasticSearch $ curl localhost:9200/_cluster/health { "cluster_name": "pairs-jp-es-cluster", "status":
"green", "timed_out": false, "number_of_nodes": 6, "number_of_data_nodes": 5, "active_primary_shards": 8, "active_shards": 32, "relocating_shards": 0, "initializing_shards": 0, "unassigned_shards": 0, "delayed_unassigned_shards": 0, "number_of_pending_tasks": 0, "number_of_in_flight_fetch": 0, "task_max_waiting_in_queue_millis": 0, "active_shards_percent_as_number": 100 }
Create Health Check API Endpoints! Check MySQL connection <?php $config
= [ "server" => "databaseserver:3306", "username" => "root", "password" => "password" ]; header('Content-type: application/json'); $link = new mysqli($config['server'],$config['username'],$config['password']); if ($link->connect_errno) { http_response_code(503); echo('{ "status": "Unable to connect" }'); } else { http_response_code(200); echo('{ "status": "Connection successful." }'); }
Caution Do not open to the public ! Access control
by ip address or authentication. nginx Advent Calendar 2015 Day21 nginx APIΤϯυϙΠϯτຖͷΞΫηε੍ޚ
Tests API Unit test $ go test -run TestHogehoge How
do we test API endpoints??
Runscope
Runscope • Monitor API perfomance • CI
Monitor API performance Set schedules for this test Demo
Ghost Inspector
Ghost Inspector Ghost InspectorΛࢼͯ͠Έ·ͨ͠ FYI (૿੮)·ͩࢹͰফͯ͠ΔͷʁϒϥβνΣοΫࣗಈԽͷ͢͢ Ί
Demo
Automate everything Commit => Unit Test => Deploy => API
Tests => !