Japan
このブログでは、Google から開発者のみなさま向けの情報をいち早くお届けします。
Realtime Database パフォーマンスのプロファイリング
2017年4月3日月曜日
この記事は Tyler Rockwood による The Firebase Blog の記事 "
Profiling your Realtime Database Performance
" を元に翻訳・加筆したものです。詳しくは元記事をご覧ください。
Tyler Rockwood
Software Engineer
以前より、Firebase Realtime Database はパフォーマンスに関する情報をあまり得られないブラックボックスでした。私たちは、この点を変えようとしており、本日(*原文公開当時)から、
Firebase CLI に組み込まれているプロファイラ
を使ってデータベース インスタンスについての情報が得られるようになりました。具体的には、帯域幅の使用量や速度についての細かいデータを収集することにより、データベースに対する書き込みや読み込みをパスレベルで簡単に監視できるようになります。
まずは、最新版の
Firebase CLI
をインストールおよび初期化していることを確認してください。プロファイリングを開始するには、database:profile コマンドを使用します。
firebase database:profile
これによって、Realtime Database からのストリーミングが開始されます。Enter キーを押すと、CLI は収集したデータをスピード、帯域幅、インデックスのないクエリという 3 つのメインカテゴリに分解し、サマリー表に集計します。スピードと帯域幅のレポートは、さらに操作タイプ(書き込みまたは読み取り)と Realtime Database のパスに分解されます。子の数が 25 個以上(たとえば、SDK の .push を使っている場合)である場合は、サマリー表はパスを 1 つのエントリに折りたたみ、push ID を $wildcard で置き換えます。
スピード*
この表には、パス、そのパスへのアクセス回数、サーバーがリクエストの処理にかかった時間(ミリ秒)、ルールによってそのパスへのアクセスが拒絶された回数という 4 つの項目が表示されています。
帯域幅**
この表には、パス、そのパスの合計帯域幅、操作あたりの平均帯域幅という 3 つの項目が表示されています。
インデックスのないクエリ
ここには、パス、ルールに追加するべきインデックス ルール、そのパスに対するクエリの数の 3 つが表示されています。これらのクエリに対する警告は、SDK ログにも表示されます。
さらに詳しい情報が必要な場合
--raw フラグ(--output で出力ファイルを指定することも可能)を使うと、接続されているアプリの IP アドレスやユーザー エージェント文字列など、サーバーでの生の操作を直接収集することもできます。情報を収集できるすべての操作項目や、表示される情報の内容については、
プロファイラのリファレンス ページ
をご覧ください。
* スピードは、ミリ秒単位で報告されます。これは、データベースがリクエストされた操作を処理する際にかかった時間を示します。なお、ネットワーク条件などのさまざまな要因によって、大幅にレイテンシが異なる場合があります。
** 帯域幅は、データのペイロードに基づく推定値であり、課金額の計測に使うことはできません。ここに表示される値は、実際に課金される帯域幅と誤差がある可能性があります。また、プロファイラが送信する統計情報も帯域幅として課金されます。
Posted by
Khanh LeViet - Developer Relations Team
コメントを投稿
ラベル
#DevFest16
1
#hack4jp
3
A4A
2
Action on Google
1
Addy Osmani
1
ADK
2
AdMob
18
Ads
10
Agency
1
ALPN
1
AMP
31
AMP Cache
3
Analytics
9
Andorid
9
Android
201
Android Auto
1
Android Design Support Library
1
Android Developer Story
3
Android N
18
Android O
1
Android Pay
1
Android Studio
17
Android Support Library
4
Android Things
1
Android TV
8
Android Wear
23
androidmarket
3
Angular 2
2
AngularJS
2
API
22
APIExpert
45
apk
2
app engine
21
App Indexing
7
App Invites
6
AppCompat
2
Apps Script
7
aprilfool
3
ArtTech
1
Associate Android Developer Certificate
1
Audio
3
Auth Code
1
Authentication
7
AuthSub
2
Autotrack
2
Awareness API
1
Beacons
6
BigQuery
9
Billing
1
BLE
4
Blink
1
blogger
1
Brillo
1
Brotli
1
Budou
1
Calendar
1
Cardboard
4
Career
1
Case Study
1
chrome
72
Chrome Custom Tab
1
Chrome Dev Summit
1
chrome extension
4
Chrome for Android
2
Chrome for iOS
2
Chrome OS
2
Chromebook
2
Chromecast
7
chromewebstore
6
Chromium
5
CLI
1
ClientLogin
3
Closure Compiler
1
Cloud
8
Cloud Functions
1
Cloud Storage
1
Cloud Test Lab
2
CocoaPods
1
codejam
5
codelab
2
compute engine
3
Context
1
Crash Reporting
1
Dart
2
DataCenter
1
Daydream
4
Deep Learning
1
Demo Party
1
Design Sprint
3
DesignBytes
1
DevArt
3
DevBytes
6
Developer
14
Developer Console
4
Developer Preview
4
Developer Relations
2
DevFest
7
DevFestX
3
devtools
3
DirectShare
1
Doodle
1
DoubleClick
4
Doze モード
1
drive
2
Dynamic Links
1
EarlGrey
1
Easter Egg
1
ECMAScript 2015
1
Eddystone
4
egypt
1
English
2
ES2015
1
ES2016
1
ES6
2
ES7
1
Firebase
62
Firebase Admin SDK
1
Firebase Analytics
7
Firebase Auth
1
Firebase Cloud Messaging
5
Firebase Database
4
Firebase Libraries
1
Firebase Notifications
1
Firebase Remote Config
3
Flash
1
font
3
G Suite
3
game
17
GDD11JP
56
GDD2010JP
23
GDE
2
GDG
12
Geo
37
Gingerbread
1
GLIDE
5
Gmail
2
Gmail API
1
Go
1
golang
4
goo.gl
1
Google
5
Google Analytics
1
Google Apps
6
Google Apps Script
3
Google Assistant
1
Google Cast
8
Google Cloud Messaging
10
Google Cloud Platform
6
Google Code-in
1
Google Developer Experts
2
Google Developers Academy
1
Google Developers live
5
Google Developers Summit
1
Google Drive
3
Google Fit
2
Google for Mobile
1
Google for Work
1
Google Maps
43
Google Play
40
Google Play Game Services
7
Google Play Services
19
Google Plus
14
Google Search
6
Google Sheets API
1
Google Sign-In
12
Google Slides API
3
Google Summer of Code
1
Google Tag Manager
1
Google Trust Services
1
Google+
2
Googleapps
10
GoogleGames
1
GoogleI/O
27
GoogleLabs
1
GoogleTV
1
Gradle
1
gRPC
2
GTUG
5
GWT
2
hack4jp
2
hackathon
6
Hosting
2
HTML5
17
HTML5Rocks
1
HTTP/2
5
HTTPS
7
ID Token
1
Identity
12
Identity Toolkit
1
Ignite
4
IME
10
Instant Apps
1
intern
2
Invites
1
iOS
15
IoT
2
IPv6
1
Japanese Input
1
JavaScript
5
K-12
1
Key Transparency
1
Knowledge Graph
1
l10n
8
LINE
1
Lollipop
10
Machine Learning
2
Marshmallow
10
Material
1
Material Design
19
MDL
1
MIDI
2
Mobile
12
Mobile Bootcamp
4
Mobile Vision
3
mod_pagespeed
1
monetize
3
Mozc
14
Music
1
NativeDriver
2
NativeScript
1
Nearby
4
Nexus
2
Nexus S
1
NFC
1
Node.js
2
NPAPI
2
NPN
1
oauth
8
OpenGL
4
OpenID
3
OpenID Connect
2
OpenSocial
1
opensource
15
Optimization
1
Payment
2
People API
1
Performance
8
PersonFinder
1
Physical Web
3
Place Picker
1
Player Analytics
4
Policy
2
Polymer
7
Progressive Web Apps
10
project hosting
1
Promise
1
Promo code
1
Protocol Buffers
1
PRPL
1
publicdata
1
Push API
1
Push Notification
3
QUIC
1
RAIL
1
React
1
React Native
2
Realtime Database
3
Redux
1
Remote Config
3
Remote Display API
1
Rewarded Video Ads
1
Runtime Permission
1
Sample Code
2
Santa Tracker
1
schema.org
1
security
22
Service Worker
3
SHA-1
1
sketchup
1
SmartLock for Passwords
4
social
4
SPDY
3
speak2tweet
1
Spreadsheet
1
startup
3
Storage
2
streetview
3
Study Jams
3
Swift
1
SwiftShader
1
Task
4
techtalk
12
TensorFlow
3
test
3
Test Lab
3
ToS
1
Transliteration
1
Twitter
1
Udacity
16
Unity
3
UX
1
V8
2
VP9
1
VR
7
Vulkan
2
Watch Face
2
wave
2
Weave
1
Web
8
Web Animations
1
Web Components
5
Web Manifest
1
WebAssembly
1
WebGL
1
WebMusic
4
WTM
2
Xcode
1
YouTube
15
YouTube API
1
インタビュー
1
コードサンプル
1
プライバシー
1
言論の自由
1
節電
3
東日本大震災
9
日本語入力
40
ブログ アーカイブ
2017
4
3
2
1
2016
12
11
10
9
8
7
6
5
4
3
2
1
2015
12
11
10
9
8
7
6
5
4
3
2
2014
12
11
10
9
8
7
6
5
4
3
2
1
2013
12
11
10
9
8
7
6
5
4
3
2
1
2012
12
11
10
9
8
7
6
5
4
3
2
1
2011
12
11
10
9
8
7
6
5
4
3
2
1
2010
12
11
Feed
Google
on
Follow @googledevjp
"プロダクトに関するご意見は
プロダクトフォーラム
にお願いします"