Fluentd, mongoDB, Kibanaを利用したはてなブログABテストの事例
by
Link
Embed
Share
Beginning
This slide
Copy link URL
Copy link URL
Copy iframe embed code
Copy iframe embed code
Copy javascript embed code
Copy javascript embed code
Share
Tweet
Share
Tweet
Slide 1
Slide 1 text
'MVFOUE NPOHP%# ,JCBOB Λར༻ͨ͠ ͯͳϒϩά"#ςετͷࣄྫ )BUFOB&OHJOFFS4FNJOBS JETIJCB@ZV
Slide 2
Slide 2 text
ຊͷΞδΣϯμ wͯͳϒϩάͰͷ"#ςετࣄྫհ w؆୯ʹ"#ςετΛߦ͏Έհ
Slide 3
Slide 3 text
ࣗݾհ wJETIJCB@ZV !TIJCB@ZV wΞϓϦέʔγϣϯΤϯδχΞ ೖࣾ
Slide 4
Slide 4 text
ࣗݾհ wͯͳϒϩάνʔϜ wཪଆΑΓͷ։ൃ͕ଟ͍ wσʔλूܭ wσϓϩΠपΓ wͦͷଞ৭ʑ
Slide 5
Slide 5 text
ͯͳϒϩάͰͷ "#ςετࣄྫ
Slide 6
Slide 6 text
ͯͳϒϩάͰ wαʔϏεͷվળʹ"#ςετΛಋೖ wϥϯσΟϯάϖʔδͷվળ wฤूը໘ͷվળ
Slide 7
Slide 7 text
ͯͳϒϩάͰ wαʔϏεͷվળʹ"#ςετΛಋೖ wϥϯσΟϯάϖʔδͷվળ wฤूը໘ͷվળ
Slide 8
Slide 8 text
ϥϯσΟϯάϖʔδվળ wొϘλϯͷΫϦοΫΛ৳͍ͨ͠ wϘλϯͱϑΥʔϜͲͪΒ͕ΫϦοΫ͞ ΕΔ
Slide 9
Slide 9 text
No content
Slide 10
Slide 10 text
ςετ݁Ռ ΫϦοΫ্͕ঢ
Slide 11
Slide 11 text
"#ςετΛ͢Δͱ wਪଌͰͳ͘ɺࣈΛݕূ͠ͳ͕Βվ ળ͕ग़དྷΔ w։ൃऀͷצͰ࡞Βͳ͍ wࣦഊͯ͠ৼΓฦΓ͕ग़དྷΔ
Slide 12
Slide 12 text
ʑ"#ςετΛ͢Δʹ wͯͳϒϩάͰʑ"#ςετΛͯ͠ ͍Δ w࣮ࢪ͕ͱʹ͔͘؆୯Ͱͳ͍ͱବ w͍͠ͱΒͳ͍
Slide 13
Slide 13 text
؆୯ʹ"#ςετΛ ͢ΔΈ
Slide 14
Slide 14 text
ϥϯσΟϯάϖʔδͷ "#ςετखॱ wදࣔΛग़͚͠Δ wϘλϯΛΫϦοΫͨ࣌͠ʹϩάΛه wू·ͬͨϩάΛूܭɾάϥϑԽ͢Δ
Slide 15
Slide 15 text
දࣔͷସ ू·ͬͨϩάͷ ूܭɾάϥϑԽ ΫϦοΫใͷه ɾͲͪΒͷύλʔϯʁ ɾͲͷϘλϯʁ
Slide 16
Slide 16 text
wදࣔΛग़͚͠ wDIBOLPͷΑ͏ͳΈ wΫϦοΫϩάͷه w+4ͰͷΠϕϯτૹ৴ɾ'MVFOUE wूܭɾάϥϑԽ w.POHP%#ɺ,JCBOBͷར༻ Ͱ͖Δ͚ͩ؆୯ʹ
Slide 17
Slide 17 text
wදࣔΛग़͚͠ wDIBOLPͷΑ͏ͳΈ wΫϦοΫϩάͷه w+4ͰͷΠϕϯτૹ৴ɾ'MVFOUE wूܭɾάϥϑԽ wNPOHP%#ɺ,JCBOBͷར༻ Ͱ͖Δ͚ͩ؆୯ʹ
Slide 18
Slide 18 text
No content
Slide 19
Slide 19 text
දࣔͷग़͠Θ͚
Slide 20
Slide 20 text
දࣔͷସ ू·ͬͨϩάͷ ूܭɾάϥϑԽ ΫϦοΫใͷه ɾͲͪΒͷύλʔϯʁ ɾͲͷϘλϯʁ
Slide 21
Slide 21 text
දࣔͷग़͠Θ͚ wࠓճ͋·Γ͠·ͤΜ w͜ͷ෦ग़དྷ͍ͯΔͱ͍͏લఏͰ ͠·͢
Slide 22
Slide 22 text
දࣔͷग़͠Θ͚ w*1ΞυϨεͳͲͰग़͠Θ͚ wSVCZͷDIBOLP wDPPLQBEࣾ wͯͳϒϩάͰಉ͡Α͏ͳΈΛ ࡞͍ͬͯΔ
Slide 23
Slide 23 text
No content
Slide 24
Slide 24 text
ΫϦοΫϩάͷه
Slide 25
Slide 25 text
දࣔͷସ ू·ͬͨϩάͷ ूܭɾάϥϑԽ ΫϦοΫใͷه ɾͲͪΒͷύλʔϯʁ ɾͲͷϘλϯʁ
Slide 26
Slide 26 text
؆୯ͳྲྀΕ wΫϦοΫ͞ΕͨΒΠϕϯτ͕αʔόʹ ૹ৴ wαʔόͰ"#ςετใͱڞʹ+40/ Ͱه w+40/ͷϩά'MVFOUEͰதԝαʔόʹ ूΊΔ
Slide 27
Slide 27 text
ΫϦοΫ +4ͰΠϕϯτ ૹ৴ αʔόͰใ͚ͯ +40/ʹه ϩάΛ'MVFOUEͰ தԝʹ
Slide 28
Slide 28 text
ΫϦοΫ +4ͰΠϕϯτ ૹ৴ αʔόͰใ͚ͯ +40/ʹه ϩάΛ'MVFOUEͰ தԝʹ
Slide 29
Slide 29 text
+4ͰΠϕϯτૹ৴ wEBUBFWFOUOBNFଐੑΛॻ͍͓ͯͩ͘ ͚Ͱૹ৴ wσβΠφͳͲͰ؆୯ʹग़དྷΔΑ͏ʹ ͯͳϒϩάΛ࢝ΊΔ(ແྉ)
Slide 30
Slide 30 text
࣮ wΫϦοΫΠϕϯτΛࢹ wEBUBFWFOUOBNF͕͋ΔཁૉͳΒ"1* ʹΞΫηε
Slide 31
Slide 31 text
࣮ྫ $(document).on('mousedown', '[data-event-name]', function(e) { $.ajax({ url: "/api/event", type: "POST", data: { event_name: $(this).attr('data-event-name') } }); });
Slide 32
Slide 32 text
ΫϦοΫ +4ͰΠϕϯτ ૹ৴ αʔόͰใ͚ͯ +40/ʹه ϩάΛ'MVFOUEͰ தԝʹ
Slide 33
Slide 33 text
αʔόͰ+40/ϩά wΞΫηεʹ߹Θͤͯ+40/ΛϑΝΠϧग़ ྗ͢Δ͚ͩ wBQJFWFOU FWFOU@OBNF w"#ςετใڞʹه wͲͪΒͷύλʔϯ͔ wͲͷϘλϯ FWFOU ͔
Slide 34
Slide 34 text
FLUENT({ tag => "event", event_name => "guide-register-button", }) { "tag" : "event", "event_name" : "guide-register-button", "units" : { "ABUnit::GuideForm" : 1, "ABUnit::EditorColor" : 0, }, "time" : 1384844834 }
Slide 35
Slide 35 text
ΫϦοΫ +4ͰΠϕϯτ ૹ৴ αʔόͰใ͚ͯ +40/ʹه ϩάΛ'MVFOUEͰ தԝʹ
Slide 36
Slide 36 text
ϩάΛதԝʹूΊΔ wͲ͜Ͱه͞Εͯ͏·͘ूΊΒΕͨ ͍ wूܭՄࢹԽͷͨΊʹσʔλΛม͠ ͍ͨ
Slide 37
Slide 37 text
ϩάΛதԝʹूΊΔ wͲ͜Ͱه͞Εͯ͏·͘ूΊΒΕͨ ͍ wूܭՄࢹԽͷͨΊʹσʔλΛม͠ ͍ͨ
Slide 38
Slide 38 text
'MVFOUE
Slide 39
Slide 39 text
'MVFOUE wγεςϜͷ֤ॴ͔Βग़ྗ͞ΕΔϩάΛ ૹɾू͢ΔͨΊͷϛυϧΣΞ wϓϥάΠϯʹΑͬͯूΊͨϩάΛଞͷ σʔλʹมग़དྷΔ
Slide 40
Slide 40 text
ϩάΛूΊΔߏ w֤αʔόϩάϑΝΠϧʹɺϩάߦ ͷ+40/ͱͯ͠ग़ྗ w֤αʔόͷϑΝΠϧΛUBJMͯ͠ɺBHFOU ͕தԝʹૹΔ͚ͩ
Slide 41
Slide 41 text
No content
Slide 42
Slide 42 text
͜͜·Ͱͷ·ͱΊ wಠࣗσʔλଐੑΛ͚Δ͚ͩͰΫϦο Ϋϩά͕ग़དྷΔΑ͏ʹ wϩάࣗಈͰ'MVFOUEͷதԝʹू͞Ε ΔΑ͏ʹ ΫϦοΫ +4ͰΠϕϯτ ૹ৴ αʔόͰใ͚ͯ +40/ʹه ϩάΛ'MVFOUEͰ தԝʹ
Slide 43
Slide 43 text
No content
Slide 44
Slide 44 text
ूܭɾάϥϑԽ
Slide 45
Slide 45 text
දࣔͷସ ू·ͬͨϩάͷ ूܭɾάϥϑԽ ΫϦοΫใͷه ɾͲͪΒͷύλʔϯʁ ɾͲͷϘλϯʁ
Slide 46
Slide 46 text
ू͞Εͨϩά w+40/͕'MVFOUEͰू·͍ͬͯΔ͚ͩ w͜ͷ··ͰԿΘ͔Βͳ͍
Slide 47
Slide 47 text
ूܭɾՄࢹԽՄೳʹ w"˓ΫϦοΫɺ#˚ΫϦοΫͱ͍͏ ใΛूܭ wදάϥϑʹΑΔՄࢹԽ
Slide 48
Slide 48 text
ख๏ wॊೈʹूܭNPOHP%#Λར༻ w؆୯ʹάϥϑԽ,JCBOBΛར༻
Slide 49
Slide 49 text
ϩάΛूܭՄೳʹ wNPOHP%#Λར༻ w'MVFOUEͷ+40/NPOHP%#ʹ w+BWB4DSJQUΛͬͯूܭ
Slide 50
Slide 50 text
'MVFOUENPOHP%# w'MVFOUEͰू͞Εͨϩά͕NPOHP%# ʹೖΔΑ͏ʹ
Slide 51
Slide 51 text
'MVFOUENPOHP%# wqVFOUQMVHJONPOHPߦͷઃఆ w'MVFOUEͷUBH͝ͱͷDPMMFDUJPO͕ग़དྷ Δ
Slide 52
Slide 52 text
'MVFOUEઃఆྫ type mongo database fluent collection debug host mongohost port 10000 capped capped_size 100m
Slide 53
Slide 53 text
NPOHP%#Ͱूܭ w+BWB4DSJQUͰΫΤϦΛ࡞ΓɺूܭՄೳ
Slide 54
Slide 54 text
{ "tag" : "event", "event_name" : "guide-register-button", "units" : { "ABUnit::GuideForm" : 1, }, } ϩάͷܗࣜ "ύλʔϯͷΫϦοΫूܭ db.event.find({ "event_name":"guide-register-button", "units.ABUnit::GuideForm":1 }).count();
Slide 55
Slide 55 text
NPOHP%#Ͱूܭ wΫΤϦΛ࡞ΕूܭՄೳʹ wΫΤϦΛ͢ΕॊೈʹूܭͰ͖Δ
Slide 56
Slide 56 text
άϥϑԽՄೳʹ wॊೈʹूܭग़དྷΔ͚ͩͰతୡ wͨͩ͠ຖճΫΤϦΛ࡞Δͷେม wͬ͟ͱ"#ςετঢ়گΛάϥϑԽ͍ͨ͠
Slide 57
Slide 57 text
άϥϑԽՄೳʹ w&MBTUJD4FBSDI,JCBOBΛར༻
Slide 58
Slide 58 text
,JCBOB w&MBTUJDTFBSDIͷΠϯσοΫεΛར༻͠ ͯXFC্Ͱ༷ʑͳάϥϑΛ࡞Δπʔϧ w&MBTUJDTFBSDI4PMSͷΑ͏ͳશจݕࡧ γεςϜ
Slide 59
Slide 59 text
'MVFOUE,JCBOB w'MVFOUEͰू͞ΕͨϩάΛ &MBTUJDTFBSDIʹ wqVFOUQMVHJOFMBTUJDTFBSDIߦͷ ઃఆ w,JCBOB&MBTUJDTFBSDIΛݟΔΑ͏ʹ
Slide 60
Slide 60 text
'MVFOUE,JCBOB
Slide 61
Slide 61 text
'MVFOUEઃఆྫ type elasticsearch host fluenthost port 9200 logstash_format true logstash_prefix service type_name service
Slide 62
Slide 62 text
,JCBOBͰάϥϑԽ w'MVFOUEͷσʔλ&MBTUJDTFBSDIʹೖ ΔΑ͏ʹͳͬͨ wXFC্Ͱ,JCBOBΛར༻ͯ͠άϥϑԽͰ ͖Δ
Slide 63
Slide 63 text
No content
Slide 64
Slide 64 text
άϥϑԽσϞ wશσʔλΛදͰදࣔ͠ wΫϦοΫσʔλͷΈʹݕࡧͰߜΓࠐΈ w"#ςετঢ়گ͕࣠ͷάϥϑΛՃ
Slide 65
Slide 65 text
άϥϑԽσϞ { "tag" : "event", "event_name" : "guide-register-button", "units" : { "ABUnit::GuideForm" : 1, }, } ΫϦοΫσʔλΛݕࡧ "#ঢ়ଶΛ࣠ʹάϥϑ
Slide 66
Slide 66 text
No content
Slide 67
Slide 67 text
͜͜·Ͱͷ·ͱΊ w'MVFOUEͷϩάNPOHP%# &MBTUJDTFBSDIʹ wNPOHP%#ͰॊೈʹूܭՄೳʹ w,JCBOBͰ؆୯ʹάϥϑԽՄೳʹ
Slide 68
Slide 68 text
࠷ऴతͳΈ
Slide 69
Slide 69 text
No content
Slide 70
Slide 70 text
؆୯ͳ"#ςετखॱ wϘλϯʹEBUBFWFOUOBNFͱ͍͏ଐੑ Ճ wϦϦʔεޙ,JCBOBͰάϥϑԽ w࠷ऴతʹNPOHP%#Ͱूܭ͠ɺ݁ՌΛ ֬ೝ
Slide 71
Slide 71 text
·ͱΊ wͯͳϒϩάͰ"#ςετσʔλղ ੳͳͲͷࣄ͍ͬͯ·͢ w'MVFOUE NPOHP%# ,JCBOBΛར༻͠ ͨ"#ςετΛ؆୯ʹߦ͏ΈΛհ wࣗࣾͰΈΛ࡞ͬͨͷͰɺͬͱෳ ࡶͳ"#ςετग़དྷ·͢
Slide 72
Slide 72 text
͝ਗ਼ௌ͋Γ͕ͱ͏ ͍͟͝·ͨ͠