View in English

  • Apple Developer
    • 今すぐ始める

    「今すぐ始める」を詳しく見る

    • 概要
    • 学ぶ
    • Apple Developer Program

    最新情報

    • 最新ニュース
    • Hello Developer
    • プラットフォーム

    プラットフォームを詳しく見る

    • Appleプラットフォーム
    • iOS
    • iPadOS
    • macOS
    • tvOS
    • visionOS
    • watchOS
    • App Store

    特集

    • デザイン
    • 配信
    • ゲーム
    • アクセサリ
    • Web
    • Home
    • CarPlay
    • テクノロジー

    テクノロジーを詳しく見る

    • 概要
    • Xcode
    • Swift
    • SwiftUI

    特集

    • アクセシビリティ
    • App Intent
    • Apple Intelligence
    • ゲーム
    • 機械学習とAI
    • セキュリティ
    • Xcode Cloud
    • コミュニティ

    コミュニティを詳しく見る

    • 概要
    • 「Appleに相談」イベント
    • コミュニティによるイベント
    • デベロッパフォーラム
    • オープンソース

    特集

    • WWDC
    • Swift Student Challenge
    • デベロッパストーリー
    • App Store Awards
    • Apple Design Awards
    • Apple Developer Center
    • ドキュメント

    ドキュメントを詳しく見る

    • ドキュメントライブラリ
    • テクノロジー概要
    • サンプルコード
    • ヒューマンインターフェイスガイドライン
    • ビデオ

    リリースノート

    • 注目のアップデート
    • iOS
    • iPadOS
    • macOS
    • watchOS
    • visionOS
    • tvOS
    • Xcode
    • ダウンロード

    ダウンロードを詳しく見る

    • すべてのダウンロード
    • オペレーティングシステム
    • アプリ
    • デザインリソース

    特集

    • Xcode
    • TestFlight
    • フォント
    • SF Symbols
    • Icon Composer
    • サポート

    サポートを詳しく見る

    • 概要
    • ヘルプガイド
    • デベロッパフォーラム
    • フィードバックアシスタント
    • お問い合わせ

    特集

    • アカウントヘルプ
    • App Reviewガイドライン
    • App Store Connectヘルプ
    • 近日導入予定の要件
    • 契約およびガイドライン
    • システムステータス
  • クイックリンク

    • イベント
    • ニュース
    • Forum
    • サンプルコード
    • ビデオ
 

ビデオ

メニューを開く メニューを閉じる
  • コレクション
  • すべてのビデオ
  • 利用方法

その他のビデオ

  • 概要
  • Summary
  • コード
  • 新しいMetricKitについて

    MetricKitを利用すると、これまで以上にすばやくパフォーマンスの問題を発見して修正できます。重要なパフォーマンスメトリックスと実用的な診断情報を提供し、アプリにおいて改善の余地のある部分を正確に把握できるようにする、MetricKitの詳細を確認しましょう。アプリ体験の最適化に向けた調査を行うための全体像を把握できるように、StateReportingフレームワークを使用して、アプリのメトリックスとアプリの状態に関する診断情報を組み合わせる方法についても解説します。

    関連する章

    • 0:01 - Introduction
    • 4:07 - Metrics
    • 7:13 - Diagnostics
    • 10:03 - Context

    リソース

    • Getting started with StateReporting
    • Analyzing app performance with MetricKit
    • Monitoring app performance with MetricKit
    • Track performance by app state using MetricKit
    • MetricKit
      • HDビデオ
      • SDビデオ

    関連ビデオ

    WWDC26

    • プロファイリング、修正、検証:Instrumentsによるアプリの応答性の向上
    • Metalゲームのパフォーマンス問題の検出と修正
  • このビデオを検索
    • 4:59 - Receive metrics from MetricKit

      // Receive metrics from MetricKit
      
      import MetricKit
      
      let manager = MetricManager()
      
      for await report in manager.metricReports {
          processReport(report)
      }
    • 5:25 - Send your metrics to the server

      // Send your metrics to the server
      
      import MetricKit
      
      for await report in manager.metricReports {
          let jsonData = try JSONEncoder().encode(report)
          sendToServer(jsonData)
      }
    • 5:44 - Access your performance metrics

      // Access your performance metrics
      
      import MetricKit
      
      for await report in manager.metricReports {
          let intervalEntries = report.intervalEntries
          let fullDayEntry = intervalEntries.fullDayEntry
          
          for entry in intervalEntries {
              let memoryMetrics = entry.values.filter { $0.metricGroup == .memory }
              
              for metric in memoryMetrics {
                  switch metric {
                  case .peakMemory(let peak):
                      processPeakMemory(peak)
                  default: break
                  }
              }
          }
      }
    • 8:59 - Receive diagnostics

      // Receive diagnostics
      
      import MetricKit
      
      let manager = MetricManager()
      
      for await report in manager.diagnosticReports {
          processReport(report)
      }
    • 9:14 - Send your diagnostic data to the server

      // Send your diagnostic data to the server
      
      import MetricKit
      
      for await report in manager.diagnosticReports {
          let jsonData = try JSONEncoder().encode(report)
          sendToServer(jsonData)
      }
    • 9:39 - Access your diagnostic data

      // Access your diagnostic data
      
      import MetricKit
      
      for await report in manager.diagnosticReports {
          switch report.result {
          case .crash(let crash):
              let backtrace = crash.callStackTree
              let reason = crash.terminationReason
              let category = crash.terminationCategory
              processCrash(backtrace: backtrace, reason: reason, category: category)
          case .hang(let hang):
              processHangDiagnostic(hang)
          default: break
          }
      }
    • 13:57 - Receive MetricKit data with states

      // Receive MetricKit data with states
      
      import MetricKit
      import StateReporting
      
      let domain = StateReportingDomain("com.metrickitsample.tabs")
      let manager = MetricManager(enabledStateReportingDomains: [domain])
      
      
      // Report transitions throughout the app
      
      let reporter = StateReporter.reporter(for: domain.rawValue)
      reporter.reportTransition(to: "Reports")
    • 14:21 - Define custom structured types

      // Define custom structured types
      
      import StateReporting
      
      @ReportableMetadata
      struct ViewConfiguration {
          let listSize: String
          let isSorted: Bool
      }
      
      let reporter = StateReporter.reporter(
          for: domain.rawValue,
          stableMetadata: ViewConfiguration.self
      )
      
      reporter.reportTransition(
          to: "Reports",
          stableMetadata: ViewConfiguration(listSize: "large", isSorted: false)
      )
    • 15:29 - Send encoded metric reports to the server

      // Send encoded metric reports to the server
      
      import MetricKit
      
      for await report in manager.metricReports {
          let encoder = JSONEncoder()
          
          let formatKey = MetricReport.encodingFormatKey
          encoder.userInfo[formatKey] = MetricReport.EncodingFormat.byStateReportingDomain
          
          let jsonData = try encoder.encode(report)
          sendToServer(jsonData)
      }
    • 0:01 - Introduction
    • MetricKit is a framework that provides metrics and diagnostics for monitoring real-world app performance. In iOS 27, the framework has been rebuilt from the ground up with a new Swift-first API and new features including Metal frame rate metrics, memory exception diagnostics, and granular data with state reporting.

    • 4:07 - Metrics
    • MetricKit delivers daily reports containing performance metrics — including launch time, hangs, CPU, memory, organized into interval entries and metric groups. Metrics can be retrieved as Codable reports for server-side aggregation or inspected directly by filtering for specific groups and values.

    • 7:13 - Diagnostics
    • When an app encounters a crash, hang, or other failure, MetricKit captures and immediately delivers a diagnostic report containing a symbolicated backtrace and metadata such as exception type and termination reason. iOS 27 adds memory exception diagnostics and a new termination category field on crash diagnostics.

    • 10:03 - Context
    • The State Reporting framework lets apps report their active configuration or user flow as named domains and states, which then allows MetricKit to aggregate data separately for each state rather than blending them. Custom structured metadata can be attached to states using the @ReportableMetadata macro, and per-state metrics are surfaced as StateEntry values in the metric report.

Developer Footer

  • ビデオ
  • WWDC26
  • 新しいMetricKitについて
  • メニューを開く メニューを閉じる
    • iOS
    • iPadOS
    • macOS
    • tvOS
    • visionOS
    • watchOS
    Open Menu Close Menu
    • Swift
    • SwiftUI
    • Swift Playground
    • TestFlight
    • Xcode
    • Xcode Cloud
    • SF Symbols
    メニューを開く メニューを閉じる
    • アクセシビリティ
    • アクセサリ
    • Apple Intelligence
    • App Extension
    • App Store
    • オーディオとビデオ(英語)
    • 拡張現実
    • デザイン
    • 配信
    • 教育
    • フォント(英語)
    • ゲーム
    • ヘルスケアとフィットネス
    • アプリ内課金
    • ローカリゼーション
    • マップと位置情報
    • 機械学習とAI
    • オープンソース(英語)
    • セキュリティ
    • SafariとWeb(英語)
    メニューを開く メニューを閉じる
    • 英語ドキュメント(完全版)
    • 日本語ドキュメント(一部トピック)
    • チュートリアル
    • ダウンロード
    • フォーラム(英語)
    • ビデオ
    Open Menu Close Menu
    • サポートドキュメント
    • お問い合わせ
    • バグ報告
    • システム状況(英語)
    メニューを開く メニューを閉じる
    • Apple Developer
    • App Store Connect
    • Certificates, IDs, & Profiles(英語)
    • フィードバックアシスタント
    メニューを開く メニューを閉じる
    • Apple Developer Program
    • Apple Developer Enterprise Program
    • App Store Small Business Program
    • MFi Program(英語)
    • Mini Apps Partner Program
    • News Partner Program(英語)
    • Video Partner Program(英語)
    • セキュリティ報奨金プログラム(英語)
    • Security Research Device Program(英語)
    Open Menu Close Menu
    • Appleに相談
    • Apple Developer Center
    • App Store Awards(英語)
    • Apple Design Awards
    • Apple Developer Academy(英語)
    • WWDC
    最新ニュースを読む。
    Apple Developerアプリを入手する。
    Copyright © 2026 Apple Inc. All rights reserved.
    利用規約 プライバシーポリシー 契約とガイドライン