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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
yunazuno
July 09, 2014
Technology
1
6.7k
Norikraを非リアルタイムなデータ集計に使う試み
yunazuno
July 09, 2014
Tweet
Share
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.2k
自作ロードバランサ開発 / JANOG40 SP6LB
yunazuno
0
180
Other Decks in Technology
See All in Technology
Codex 5.3 と Opus 4.6 にコーポレートサイトを作らせてみた / Codex 5.3 vs Opus 4.6
ama_ch
0
130
顧客の言葉を、そのまま信じない勇気
yamatai1212
1
350
名刺メーカーDevグループ 紹介資料
sansan33
PRO
0
1k
ClickHouseはどのように大規模データを活用したAIエージェントを全社展開しているのか
mikimatsumoto
0
220
Azure Durable Functions で作った NL2SQL Agent の精度向上に取り組んだ話/jat08
thara0402
0
170
2026年、サーバーレスの現在地 -「制約と戦う技術」から「当たり前の実行基盤」へ- /serverless2026
slsops
2
220
OWASP Top 10:2025 リリースと 少しの日本語化にまつわる裏話
okdt
PRO
3
630
AI駆動開発を事業のコアに置く
tasukuonizawa
1
140
Contract One Engineering Unit 紹介資料
sansan33
PRO
0
13k
OCI Database Management サービス詳細
oracle4engineer
PRO
1
7.4k
SREのプラクティスを用いた3領域同時 マネジメントへの挑戦 〜SRE・情シス・セキュリティを統合した チーム運営術〜
coconala_engineer
2
630
AIと新時代を切り拓く。これからのSREとメルカリIBISの挑戦
0gm
0
880
Featured
See All Featured
Building an army of robots
kneath
306
46k
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
200
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
180
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
57
50k
A Tale of Four Properties
chriscoyier
162
24k
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
910
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
7.9k
30 Presentation Tips
portentint
PRO
1
210
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
180
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
0
200
Chasing Engaging Ingredients in Design
codingconduct
0
110
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
51
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