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
Fluentd, mongoDB, Kibanaを利用したはてなブログABテストの事例
Search
shibayu36
November 25, 2013
Programming
30
12k
Fluentd, mongoDB, Kibanaを利用したはてなブログABテストの事例
「Hatena Engineer Seminar #2」で発表した資料です
shibayu36
November 25, 2013
Tweet
Share
More Decks by shibayu36
See All by shibayu36
今の生産性改善活動で大切にしている考え方
shibayu36
8
8.4k
エンジニアメンター制度の効果的な運用を目指して/improve-mentor-system
shibayu36
27
10k
グレードイメージ具体化のため昇格理由を公開する
shibayu36
8
5.8k
新機能作成時に開発ブランチに細かくmergeしていく戦略/merge-strategy-for-new-feature
shibayu36
6
17k
一から始めるJavaScriptユニットテスト/js-unit-test-from-scratch
shibayu36
8
32k
技術ブログを書くことについて/writing-tech-blog
shibayu36
17
26k
はてなと技術研修
shibayu36
1
6.3k
はてなブログチームの開発フローとGitHub
shibayu36
145
76k
課題をテストで解決する
shibayu36
2
2.3k
Other Decks in Programming
See All in Programming
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
0
120
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
1
100
OSSで起業してもうすぐ10年 / Open Source Conference 2024 Shimane
furukawayasuto
0
110
Creating a Free Video Ad Network on the Edge
mizoguchicoji
0
120
NSOutlineView何もわからん:( 前編 / I Don't Understand About NSOutlineView :( Pt. 1
usagimaru
0
340
Quine, Polyglot, 良いコード
qnighy
4
650
Realtime API 入門
riofujimon
0
150
「今のプロジェクトいろいろ大変なんですよ、app/services とかもあって……」/After Kaigi on Rails 2024 LT Night
junk0612
5
2.2k
.NET のための通信フレームワーク MagicOnion 入門 / Introduction to MagicOnion
mayuki
1
1.7k
聞き手から登壇者へ: RubyKaigi2024 LTでの初挑戦が 教えてくれた、可能性の星
mikik0
1
130
광고 소재 심사 과정에 AI를 도입하여 광고 서비스 생산성 향상시키기
kakao
PRO
0
170
ヤプリ新卒SREの オンボーディング
masaki12
0
130
Featured
See All Featured
Imperfection Machines: The Place of Print at Facebook
scottboms
265
13k
GraphQLとの向き合い方2022年版
quramy
43
13k
Writing Fast Ruby
sferik
627
61k
Speed Design
sergeychernyshev
25
620
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
26
2.1k
VelocityConf: Rendering Performance Case Studies
addyosmani
325
24k
No one is an island. Learnings from fostering a developers community.
thoeni
19
3k
The Cult of Friendly URLs
andyhume
78
6k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
6.8k
Unsuck your backbone
ammeep
668
57k
Visualization
eitanlees
145
15k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
6.9k
Transcript
'MVFOUE NPOHP%# ,JCBOB Λར༻ͨ͠ ͯͳϒϩά"#ςετͷࣄྫ )BUFOB&OHJOFFS4FNJOBS JETIJCB@ZV
ຊͷΞδΣϯμ wͯͳϒϩάͰͷ"#ςετࣄྫհ w؆୯ʹ"#ςετΛߦ͏Έհ
ࣗݾհ wJETIJCB@ZV !TIJCB@ZV wΞϓϦέʔγϣϯΤϯδχΞ ೖࣾ
ࣗݾհ wͯͳϒϩάνʔϜ wཪଆΑΓͷ։ൃ͕ଟ͍ wσʔλूܭ wσϓϩΠपΓ wͦͷଞ৭ʑ
ͯͳϒϩάͰͷ "#ςετࣄྫ
ͯͳϒϩάͰ wαʔϏεͷվળʹ"#ςετΛಋೖ wϥϯσΟϯάϖʔδͷվળ wฤूը໘ͷվળ
ͯͳϒϩάͰ wαʔϏεͷվળʹ"#ςετΛಋೖ wϥϯσΟϯάϖʔδͷվળ wฤूը໘ͷվળ
ϥϯσΟϯάϖʔδվળ wొϘλϯͷΫϦοΫΛ৳͍ͨ͠ wϘλϯͱϑΥʔϜͲͪΒ͕ΫϦοΫ͞ ΕΔ
None
ςετ݁Ռ ΫϦοΫ্͕ঢ
"#ςετΛ͢Δͱ wਪଌͰͳ͘ɺࣈΛݕূ͠ͳ͕Βվ ળ͕ग़དྷΔ w։ൃऀͷצͰ࡞Βͳ͍ wࣦഊͯ͠ৼΓฦΓ͕ग़དྷΔ
ʑ"#ςετΛ͢Δʹ wͯͳϒϩάͰʑ"#ςετΛͯ͠ ͍Δ w࣮ࢪ͕ͱʹ͔͘؆୯Ͱͳ͍ͱବ w͍͠ͱΒͳ͍
؆୯ʹ"#ςετΛ ͢ΔΈ
ϥϯσΟϯάϖʔδͷ "#ςετखॱ wදࣔΛग़͚͠Δ wϘλϯΛΫϦοΫͨ࣌͠ʹϩάΛه wू·ͬͨϩάΛूܭɾάϥϑԽ͢Δ
දࣔͷସ ू·ͬͨϩάͷ ूܭɾάϥϑԽ ΫϦοΫใͷه ɾͲͪΒͷύλʔϯʁ ɾͲͷϘλϯʁ
wදࣔΛग़͚͠ wDIBOLPͷΑ͏ͳΈ wΫϦοΫϩάͷه w+4ͰͷΠϕϯτૹ৴ɾ'MVFOUE wूܭɾάϥϑԽ w.POHP%#ɺ,JCBOBͷར༻ Ͱ͖Δ͚ͩ؆୯ʹ
wදࣔΛग़͚͠ wDIBOLPͷΑ͏ͳΈ wΫϦοΫϩάͷه w+4ͰͷΠϕϯτૹ৴ɾ'MVFOUE wूܭɾάϥϑԽ wNPOHP%#ɺ,JCBOBͷར༻ Ͱ͖Δ͚ͩ؆୯ʹ
None
දࣔͷग़͠Θ͚
දࣔͷସ ू·ͬͨϩάͷ ूܭɾάϥϑԽ ΫϦοΫใͷه ɾͲͪΒͷύλʔϯʁ ɾͲͷϘλϯʁ
දࣔͷग़͠Θ͚ wࠓճ͋·Γ͠·ͤΜ w͜ͷ෦ग़དྷ͍ͯΔͱ͍͏લఏͰ ͠·͢
දࣔͷग़͠Θ͚ w*1ΞυϨεͳͲͰग़͠Θ͚ wSVCZͷDIBOLP wDPPLQBEࣾ wͯͳϒϩάͰಉ͡Α͏ͳΈΛ ࡞͍ͬͯΔ
None
ΫϦοΫϩάͷه
දࣔͷସ ू·ͬͨϩάͷ ूܭɾάϥϑԽ ΫϦοΫใͷه ɾͲͪΒͷύλʔϯʁ ɾͲͷϘλϯʁ
؆୯ͳྲྀΕ wΫϦοΫ͞ΕͨΒΠϕϯτ͕αʔόʹ ૹ৴ wαʔόͰ"#ςετใͱڞʹ+40/ Ͱه w+40/ͷϩά'MVFOUEͰதԝαʔόʹ ूΊΔ
ΫϦοΫ +4ͰΠϕϯτ ૹ৴ αʔόͰใ͚ͯ +40/ʹه ϩάΛ'MVFOUEͰ தԝʹ
ΫϦοΫ +4ͰΠϕϯτ ૹ৴ αʔόͰใ͚ͯ +40/ʹه ϩάΛ'MVFOUEͰ தԝʹ
+4ͰΠϕϯτૹ৴ wEBUBFWFOUOBNFଐੑΛॻ͍͓ͯͩ͘ ͚Ͱૹ৴ wσβΠφͳͲͰ؆୯ʹग़དྷΔΑ͏ʹ <button data-event-name="guide-register-button"> ͯͳϒϩάΛ࢝ΊΔ(ແྉ) </button>
࣮ wΫϦοΫΠϕϯτΛࢹ wEBUBFWFOUOBNF͕͋ΔཁૉͳΒ"1* ʹΞΫηε
࣮ྫ $(document).on('mousedown', '[data-event-name]', function(e) { $.ajax({ url: "/api/event", type: "POST",
data: { event_name: $(this).attr('data-event-name') } }); });
ΫϦοΫ +4ͰΠϕϯτ ૹ৴ αʔόͰใ͚ͯ +40/ʹه ϩάΛ'MVFOUEͰ தԝʹ
αʔόͰ+40/ϩά wΞΫηεʹ߹Θͤͯ+40/ΛϑΝΠϧग़ ྗ͢Δ͚ͩ wBQJFWFOU FWFOU@OBNF w"#ςετใڞʹه wͲͪΒͷύλʔϯ͔ wͲͷϘλϯ FWFOU ͔
FLUENT({ tag => "event", event_name => "guide-register-button", }) { "tag"
: "event", "event_name" : "guide-register-button", "units" : { "ABUnit::GuideForm" : 1, "ABUnit::EditorColor" : 0, }, "time" : 1384844834 }
ΫϦοΫ +4ͰΠϕϯτ ૹ৴ αʔόͰใ͚ͯ +40/ʹه ϩάΛ'MVFOUEͰ தԝʹ
ϩάΛதԝʹूΊΔ wͲ͜Ͱه͞Εͯ͏·͘ूΊΒΕͨ ͍ wूܭՄࢹԽͷͨΊʹσʔλΛม͠ ͍ͨ
ϩάΛதԝʹूΊΔ wͲ͜Ͱه͞Εͯ͏·͘ूΊΒΕͨ ͍ wूܭՄࢹԽͷͨΊʹσʔλΛม͠ ͍ͨ
'MVFOUE
'MVFOUE wγεςϜͷ֤ॴ͔Βग़ྗ͞ΕΔϩάΛ ૹɾू͢ΔͨΊͷϛυϧΣΞ wϓϥάΠϯʹΑͬͯूΊͨϩάΛଞͷ σʔλʹมग़དྷΔ
ϩάΛूΊΔߏ w֤αʔόϩάϑΝΠϧʹɺϩάߦ ͷ+40/ͱͯ͠ग़ྗ w֤αʔόͷϑΝΠϧΛUBJMͯ͠ɺBHFOU ͕தԝʹૹΔ͚ͩ
None
͜͜·Ͱͷ·ͱΊ wಠࣗσʔλଐੑΛ͚Δ͚ͩͰΫϦο Ϋϩά͕ग़དྷΔΑ͏ʹ wϩάࣗಈͰ'MVFOUEͷதԝʹू͞Ε ΔΑ͏ʹ ΫϦοΫ +4ͰΠϕϯτ ૹ৴ αʔόͰใ͚ͯ +40/ʹه
ϩάΛ'MVFOUEͰ தԝʹ
None
ूܭɾάϥϑԽ
දࣔͷସ ू·ͬͨϩάͷ ूܭɾάϥϑԽ ΫϦοΫใͷه ɾͲͪΒͷύλʔϯʁ ɾͲͷϘλϯʁ
ू͞Εͨϩά w+40/͕'MVFOUEͰू·͍ͬͯΔ͚ͩ w͜ͷ··ͰԿΘ͔Βͳ͍
ूܭɾՄࢹԽՄೳʹ w"˓ΫϦοΫɺ#˚ΫϦοΫͱ͍͏ ใΛूܭ wදάϥϑʹΑΔՄࢹԽ
ख๏ wॊೈʹूܭNPOHP%#Λར༻ w؆୯ʹάϥϑԽ,JCBOBΛར༻
ϩάΛूܭՄೳʹ wNPOHP%#Λར༻ w'MVFOUEͷ+40/NPOHP%#ʹ w+BWB4DSJQUΛͬͯूܭ
'MVFOUENPOHP%# w'MVFOUEͰू͞Εͨϩά͕NPOHP%# ʹೖΔΑ͏ʹ
'MVFOUENPOHP%# wqVFOUQMVHJONPOHP ߦͷઃఆ w'MVFOUEͷUBH͝ͱͷDPMMFDUJPO͕ग़དྷ Δ
'MVFOUEઃఆྫ <match **> type mongo database fluent collection debug host
mongohost port 10000 capped capped_size 100m </match>
NPOHP%#Ͱूܭ w+BWB4DSJQUͰΫΤϦΛ࡞ΓɺूܭՄೳ
{ "tag" : "event", "event_name" : "guide-register-button", "units" : {
"ABUnit::GuideForm" : 1, }, } ϩάͷܗࣜ "ύλʔϯͷΫϦοΫूܭ db.event.find({ "event_name":"guide-register-button", "units.ABUnit::GuideForm":1 }).count();
NPOHP%#Ͱूܭ wΫΤϦΛ࡞ΕूܭՄೳʹ wΫΤϦΛ͢ΕॊೈʹूܭͰ͖Δ
άϥϑԽՄೳʹ wॊೈʹूܭग़དྷΔ͚ͩͰతୡ wͨͩ͠ຖճΫΤϦΛ࡞Δͷେม wͬ͟ͱ"#ςετঢ়گΛάϥϑԽ͍ͨ͠
άϥϑԽՄೳʹ w&MBTUJD4FBSDI ,JCBOBΛར༻
,JCBOB w&MBTUJDTFBSDIͷΠϯσοΫεΛར༻͠ ͯXFC্Ͱ༷ʑͳάϥϑΛ࡞Δπʔϧ w&MBTUJDTFBSDI4PMSͷΑ͏ͳશจݕࡧ γεςϜ
'MVFOUE,JCBOB w'MVFOUEͰू͞ΕͨϩάΛ &MBTUJDTFBSDIʹ wqVFOUQMVHJOFMBTUJDTFBSDI ߦͷ ઃఆ w,JCBOB&MBTUJDTFBSDIΛݟΔΑ͏ʹ
'MVFOUE,JCBOB
'MVFOUEઃఆྫ <match **> type elasticsearch host fluenthost port 9200 logstash_format
true logstash_prefix service type_name service </store>
,JCBOBͰάϥϑԽ w'MVFOUEͷσʔλ&MBTUJDTFBSDIʹೖ ΔΑ͏ʹͳͬͨ wXFC্Ͱ,JCBOBΛར༻ͯ͠άϥϑԽͰ ͖Δ
None
άϥϑԽσϞ wશσʔλΛදͰදࣔ͠ wΫϦοΫσʔλͷΈʹݕࡧͰߜΓࠐΈ w"#ςετঢ়گ͕࣠ͷάϥϑΛՃ
άϥϑԽσϞ { "tag" : "event", "event_name" : "guide-register-button", "units" :
{ "ABUnit::GuideForm" : 1, }, } ΫϦοΫσʔλΛݕࡧ "#ঢ়ଶΛ࣠ʹάϥϑ
None
͜͜·Ͱͷ·ͱΊ w'MVFOUEͷϩάNPOHP%# &MBTUJDTFBSDIʹ wNPOHP%#ͰॊೈʹूܭՄೳʹ w,JCBOBͰ؆୯ʹάϥϑԽՄೳʹ
࠷ऴతͳΈ
None
؆୯ͳ"#ςετखॱ wϘλϯʹEBUBFWFOUOBNFͱ͍͏ଐੑ Ճ wϦϦʔεޙ,JCBOBͰάϥϑԽ w࠷ऴతʹNPOHP%#Ͱूܭ͠ɺ݁ՌΛ ֬ೝ
·ͱΊ wͯͳϒϩάͰ"#ςετσʔλղ ੳͳͲͷࣄ͍ͬͯ·͢ w'MVFOUE NPOHP%# ,JCBOBΛར༻͠ ͨ"#ςετΛ؆୯ʹߦ͏ΈΛհ wࣗࣾͰΈΛ࡞ͬͨͷͰɺͬͱෳ ࡶͳ"#ςετग़དྷ·͢
͝ਗ਼ௌ͋Γ͕ͱ͏ ͍͟͝·ͨ͠