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
33k
技術ブログを書くことについて/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
N.E.X.T LEVEL
pluu
2
300
暇に任せてProxmoxコンソール 作ってみました
karugamo
1
710
Symfony Mapper Component
soyuka
2
730
今年一番支援させていただいたのは認証系サービスでした
satoshi256kbyte
1
250
Recoilを剥がしている話
kirik
5
6.6k
クリエイティブコーディングとRuby学習 / Creative Coding and Learning Ruby
chobishiba
0
3.9k
103 Early Hints
sugi_0000
1
220
バグを見つけた?それAppleに直してもらおう!
uetyo
0
170
Discord Bot with AI -for English learners-
xin9le
1
120
RWC 2024 DICOM & ISO/IEC 2022
m_seki
0
200
Criando Commits Incríveis no Git
marcelgsantos
2
170
fs2-io を試してたらバグを見つけて直した話
chencmd
0
220
Featured
See All Featured
The Art of Programming - Codeland 2020
erikaheidi
53
13k
Reflections from 52 weeks, 52 projects
jeffersonlam
347
20k
How to Ace a Technical Interview
jacobian
276
23k
A Modern Web Designer's Workflow
chriscoyier
693
190k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
26
1.5k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
44
9.3k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
29
2k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
48
2.2k
Gamification - CAS2011
davidbonilla
80
5.1k
A Philosophy of Restraint
colly
203
16k
YesSQL, Process and Tooling at Scale
rocio
169
14k
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.5k
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ࣗࣾͰΈΛ࡞ͬͨͷͰɺͬͱෳ ࡶͳ"#ςετग़དྷ·͢
͝ਗ਼ௌ͋Γ͕ͱ͏ ͍͟͝·ͨ͠