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.3k
エンジニアメンター制度の効果的な運用を目指して/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.2k
はてなブログチームの開発フローとGitHub
shibayu36
145
76k
課題をテストで解決する
shibayu36
2
2.3k
Other Decks in Programming
See All in Programming
ビット演算の話 / Let's play with bit operations
kaityo256
PRO
4
160
Modern Functional Fluent CFML REST by Luis Majano
ortus24
0
130
Cancel Next.js Page Navigation: Full Throttle
ypresto
1
110
Cloud Adoption Frameworkにみる組織とクラウド導入戦略(縮小版)
tomokusaba
1
170
[KR] Server Driven Compose With Firebase
skydoves
2
130
データサイエンスのフルサイクル開発を実現する機械学習パイプライン
xcnkx
2
460
学生の時に開催したPerl入学式をきっかけにエンジニアが組織に馴染むために勉強会を主催や仲間と参加して職能間の境界を越えていく
ohmori_yusuke
1
100
文化が生産性を作る
jimpei
3
500
M5Stack に色々な M5ユニットをつないで扱う為の新たなアプローチ
gob
0
200
Progressive Web Apps for Rails developers
siaw23
2
530
Applied NLP in the Age of Generative AI
inesmontani
PRO
3
1.1k
"noncopyable types" の使いどころについて考えてみた
andpad
0
130
Featured
See All Featured
What's new in Ruby 2.0
geeforr
341
31k
Code Reviewing Like a Champion
maltzj
519
39k
The Language of Interfaces
destraynor
154
24k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
30
2.6k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
92
16k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9k
Documentation Writing (for coders)
carmenintech
65
4.3k
Into the Great Unknown - MozCon
thekraken
30
1.4k
A Modern Web Designer's Workflow
chriscoyier
692
190k
Reflections from 52 weeks, 52 projects
jeffersonlam
346
20k
The Straight Up "How To Draw Better" Workshop
denniskardys
231
130k
ParisWeb 2013: Learning to Love: Crash Course in Emotional UX Design
dotmariusz
109
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ࣗࣾͰΈΛ࡞ͬͨͷͰɺͬͱෳ ࡶͳ"#ςετग़དྷ·͢
͝ਗ਼ௌ͋Γ͕ͱ͏ ͍͟͝·ͨ͠