| Flutter iOS Embedder |

profiler_metrics_ios.h
Go to the documentation of this file.
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_PROFILER_METRICS_IOS_H_
6 #define FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_PROFILER_METRICS_IOS_H_
7
8 #include <mach/mach.h>
9
10 #include <cassert>
11 #include <optional>
12
13 #include "flutter/fml/logging.h"
14 #include "flutter/shell/profiling/sampling_profiler.h"
15
16 namespace flutter {
17
18 /**
19 * @brief Utility class that gathers profiling metrics used by
20 * `flutter::SamplingProfiler`.
21 *
22 * @see flutter::SamplingProfiler
23 */
24 class ProfilerMetricsIOS {
25 public:
26 ProfilerMetricsIOS() = default;
27
28 ProfileSample GenerateSample();
29
30 private:
31 std::optional<CpuUsageInfo> CpuUsage();
32
33 std::optional<MemoryUsageInfo> MemoryUsage();
34
35 FML_DISALLOW_COPY_AND_ASSIGN(ProfilerMetricsIOS);
36 };
37
38 } // namespace flutter
39
40 #endif // FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_PROFILER_METRICS_IOS_H_
flutter::ProfilerMetricsIOS
Utility class that gathers profiling metrics used by flutter::SamplingProfiler.
Definition: profiler_metrics_ios.h:24
flutter::ProfilerMetricsIOS::ProfilerMetricsIOS
ProfilerMetricsIOS()=default
flutter::ProfilerMetricsIOS::GenerateSample
ProfileSample GenerateSample()
Definition: profiler_metrics_ios.mm:127
flutter
Definition: accessibility_bridge.h:26