統計
統計エンドポイントは、アプリと組織に関する詳細な分析を提供します。さまざまな期間にわたる月間アクティブ ユーザー (MAU)、ストレージ使用量、帯域幅消費量を追跡できます。このデータは、アプリの成長、リソースの使用状況、および容量の計画を監視するために不可欠です。
メトリクスを理解する
Section titled “メトリクスを理解する”- MAU (月間アクティブ ユーザー): 過去 30 日間にアプリにアクセスした一意のデバイスの数
- ストレージ: 保存されているすべてのバンドルとリソースの合計サイズ (バイト単位)
- 帯域幅: バンドル ダウンロードの合計データ転送量 (バイト単位)
ベストプラクティス
Section titled “ベストプラクティス”- 定期的なモニタリング: 統計を定期的にチェックして、増加と使用パターンを追跡します。
- リソース プランニング: 容量計画にストレージと帯域幅のメトリクスを使用する
- ユーザー エンゲージメント: MAU を追跡してユーザー エンゲージメントの傾向を理解する
- コスト管理: リソースの使用状況を監視してコストを最適化します。
エンドポイント
Section titled “エンドポイント”GET /statistics/app/:app_id/
Section titled “GET /statistics/app/:app_id/”特定のアプリの統計を取得します。このエンドポイントは、個々のアプリのパフォーマンスを監視するのに役立ちます。
クエリパラメータ
Section titled “クエリパラメータ”interface StatsQuery { from: Date // Start date for the statistics (format: YYYY-MM-DD) to: Date // End date for the statistics (format: YYYY-MM-DD)}リクエストの例
Section titled “リクエストの例”curl -H "authorization: your-api-key" \ "https://api.capgo.app/statistics/app/com.demo.app/?from=2024-01-01&to=2024-02-01"[ { "date": "2024-01-01", "mau": 1500, "storage": 536870912, // 512MB in bytes "bandwidth": 1073741824 // 1GB in bytes }, { "date": "2024-01-02", "mau": 1550, "storage": 537919488, // 513MB in bytes "bandwidth": 1074790400 // 1.01GB in bytes }]GET /statistics/org/:org_id/
Section titled “GET /statistics/org/:org_id/”特定の組織の統計を取得します。組織レベルの使用状況を監視するのに役立ちます。
クエリパラメータ
Section titled “クエリパラメータ”interface StatsQuery { from: Date // Start date for the statistics (format: YYYY-MM-DD) to: Date // End date for the statistics (format: YYYY-MM-DD) breakdown: boolean // default false, optional if true it return the breakdown by app noAccumulate: boolean // default false, optional if true it will not accumulate data and just return day by day result}リクエストの例
Section titled “リクエストの例”curl -H "authorization: your-api-key" \ "https://api.capgo.app/statistics/org/046a36ac-e03c-4590-9257-bd6c9dba9ee8/?from=2024-01-01&to=2024-02-01"[ { "date": "2024-01-01", "mau": 10000, "storage": 536870912, // 512MB in bytes "bandwidth": 1073741824 // 1GB in bytes }, { "date": "2024-01-02", "mau": 10200, "storage": 537919488, // 513MB in bytes "bandwidth": 1074790400 // 1.01GB in bytes }]GET /統計/ユーザー/
Section titled “GET /統計/ユーザー/”アクセスできるすべての組織の集計統計を取得します。全体的な使用状況の監視に最適です。
クエリパラメータ
Section titled “クエリパラメータ”interface StatsQuery { from: Date // Start date for the statistics (format: YYYY-MM-DD) to: Date // End date for the statistics (format: YYYY-MM-DD)}リクエストの例
Section titled “リクエストの例”curl -H "authorization: your-api-key" \ "https://api.capgo.app/statistics/user/?from=2024-01-01&to=2024-02-01"[ { "date": "2024-01-01", "mau": 25000, "storage": 1073741824, // 1GB in bytes "bandwidth": 2147483648 // 2GB in bytes }, { "date": "2024-01-02", "mau": 25500, "storage": 1074790400, // 1.01GB in bytes "bandwidth": 2148532224 // 2.01GB in bytes }]GET /statistics/app/:app_id/bundle_usage
Section titled “GET /statistics/app/:app_id/bundle_usage”特定のアプリのバンドル使用統計を取得し、指定した期間におけるユーザー間のバンドル (バージョン) の分布を示します。
クエリパラメータ
Section titled “クエリパラメータ”interface BundleUsageQuery { from: Date // Start date for the statistics (format: YYYY-MM-DD) to: Date // End date for the statistics (format: YYYY-MM-DD)}リクエストの例
Section titled “リクエストの例”curl -H "authorization: your-api-key" \ "https://api.capgo.app/statistics/app/com.demo.app/bundle_usage?from=2024-01-01&to=2024-02-01"{ "labels": ["2024-01-01", "2024-01-02", "2024-01-03"], "datasets": [ { "label": "1.0.0", "data": [60.5, 58.2, 55.3] }, { "label": "1.0.1", "data": [39.5, 41.8, 44.7] } ]}一般的なエラーのシナリオとその対応:
// Invalid body{ "status": "Invalid body", "error": "Invalid date format or missing parameters"}
// Permission denied{ "status": "You can't access this app", "error": "Insufficient permissions to access statistics"}
// Permission denied for organization{ "status": "You can't access this organization", "error": "Insufficient permissions to access organization statistics"}
// No organizations found for user statistics{ "status": "No organizations found", "error": "No organizations found"}
// Internal server error{ "status": "Cannot get app statistics", "error": "Internal server error message"}一般的な使用例
Section titled “一般的な使用例”- 成長追跡: MAU の成長を時間の経過とともに監視する
- リソースの最適化: ストレージと帯域幅の使用状況を追跡してコストを最適化します。
- キャパシティ プランニング: トレンドを使用して、将来のリソースのニーズを計画します。
- 使用状況レポート: 関係者向けに定期的な使用状況レポートを作成します。
- バンドル (バージョン) の分布分析: バンドルの使用状況統計を使用して、ユーザーがさまざまなアプリ バンドル (バージョン) にどのように分布しているかを理解します。
分析のヒント
Section titled “分析のヒント”- 期間の比較: 前月比または前年比の傾向を確認します。
- 追跡率: ユーザーごとの帯域幅またはアプリごとのストレージを監視します
- アラートの設定: 使用量の異常な急増に対するアラートを作成します
- 定期的なバックアップ: 履歴分析のために統計を定期的にエクスポートします。
- バンドル (バージョン) の採用: バンドルの使用状況を使用して、新しいバンドル (バージョン) の採用率を追跡します。