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
Norikraを非リアルタイムなデータ集計に使う試み
Search
yunazuno
July 09, 2014
Technology
6.7k
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Norikraを非リアルタイムなデータ集計に使う試み
yunazuno
July 09, 2014
More Decks by yunazuno
See All by yunazuno
eXpress Data Path (XDP) の概要とLINEにおける利活用 / Brief summary of XDP and use-case at LINE
yunazuno
10
3.4k
自作ロードバランサ開発 / JANOG40 SP6LB
yunazuno
0
190
Other Decks in Technology
See All in Technology
Bet AI Day 2026丨バクラク Autopilot、業務システムの再設計
layerx
PRO
2
1.1k
振り返りこそエンジニアの本領
negima
0
260
Guerilla InnerSource in enterprises, during the AI hype
onenashev
PRO
0
140
Bet AI Day 2026丨Production-Ready AI Agents — エンタープライズの実務を任せるための設計と運用
layerx
PRO
3
2k
KPIだけでは評価できないプロダクトが考えるべき Evalsという第二の評価系 / Beyond KPIs: Evals as a Second Evaluation Framework for Products #PdEConf
aki_iinuma
3
3.5k
「重なり」は迎える側がつくる ― 人もAIエージェントも歓迎するプロダクトエンジニアリング ―
go0517go
PRO
0
220
Kiro Crewしか勝たん!?
miu_crescent
PRO
0
170
データエンジニアの困りごとをDevinと一緒に解消する
10xinc
2
790
Sony-DroidKaigi2026
sony
1
310
『止めない』を設計する — 制約の中で、事業の根幹を支える判断
hiroyaterui
0
160
Bet AI Day 2026丨Agentは、「金融」という巨大産業の何を変えられるのか
layerx
PRO
0
700
When Does a Local Qwen Start to Break
morshoto
0
160
Featured
See All Featured
Site-Speed That Sticks
csswizardry
13
1.5k
Skip the Path - Find Your Career Trail
mkilby
1
220
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
2
1.8k
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.4k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.9k
The Curious Case for Waylosing
cassininazir
1
490
Producing Creativity
orderedlist
PRO
348
41k
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.6k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
The Spectacular Lies of Maps
axbom
PRO
1
970
Deep Space Network (abreviated)
tonyrice
0
290
Transcript
Norikraを非リアルタイムな データ集計に使う試み Norikra meetup #1 Yohei KANEMARU @yunazuno
誰? • 金丸 洋平 (かねまる ようへい) • @yunazuno • ネットワークまわり担当
at LINE Corp. – BGP, CDN, DNS, ロードバランサ周辺 – たまにツール書いたり • 主にPython 2
非リアルタイム ログ集計 + 3
ユースケース: トラフィック集計 4 R1 R2 R3 R4 R5 R6 NW
A NW B • NW A → Bのトラフィックが, R3-5のどれにどのくらい流れ ているか知りたい • ログはR1,R2で個別にCSVで エクスポート可能
「CSVでエクスポート」 • 割とスキーマレス • 外部サービスやアプライアンスが絡むと, 唯一のログ取得手段な場合も – API欲しいけども... • サービスや機器を跨いだ集計は自分で
頑張る 5
6
他の手段を考えてみた 1. スクリプトで全部頑張る? – CSVパース + ひたすら足し算 – 書く手間はそんなに無さそう 2.
DBに入れてから集計? – CSVパース + insert + select – クエリ書くのつらい 7
他の手段を考えてみた 1. スクリプトで全部頑張る? – CSVパース + ひたすら足し算 – 書く手間はそんなに無さそう 2.
DBに入れてから集計? – CSVパース + insert + select – クエリ書くのつらい 3. Norikraで集計! 8
9 From http://norikra.github.io/query.html
win:time_batch 10 “Publisher” Norikra Internal time Wall-clock time Norikraがeventを受け取った時刻を基準に処理 send
send send send send [{name: …, value: …, …}]
win:ext_time_batch 11 “Publisher” Norikra Internal time Wall-clock time eventに含まれるタイムスタンプを基準に処理 send
send send send send Buffer (Delay) [{timestamp: 1396278060000, name: …, value: …, …}]
全体像 12 csv2json.py … traffic_stats.py norikra- client-python 1. CSVをタイムスタンプ順に JSONに詰める
CSVファイルはタイムスタンプで ソートされている ASSUMPTION 2. クエリ登録 3. send 4. fetch 5. クエリとtargetを削除 6. CSVに出力 Query 1: aggregate Query 2: max/avg
Query 1: 複数ファイルの集約 13 input = [{timestamp:1400511600, src_nw: “NW_A”, dst_nw:
“NW_B”, traffic_out: 10.0}] timestamp (in msec) time window time reference 後段のクエリの targetを指定
Query 2: MAX/AVG集計 14 output = [{timestamp:1400511000, traffic_out_daily_avg: 42.34, traffic_out_daily_max:
130.25}]
Q. 「それNorikraじゃなくても いいよね?」 15
A. Yes. 16
あえてNorikraな理由 • 意外と気軽に使える – 入力フォーマットや対象メトリックが変わる たびにスクリプトやDBに手を加えるのは割と 辛い – クエリ編集だけで大抵事足りる >
Norikra – hoge2json部分だけ用意すればよい • xml2json, rrd2json, … 17
まとめ • Excelで開けない辛いデータも割と気軽に 扱えるようになる – 気軽さ大事 • 最近fluent-plugin-netflowとかいう素敵 なものが登場した –
ネットワーク+リアルタイムな話は#2で? 18