Flutter Engine
The Flutter Engine
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
16namespace flutter {
17
18/**
19 * @brief Utility class that gathers profiling metrics used by
20 * `flutter::SamplingProfiler`.
21 *
22 * @see flutter::SamplingProfiler
23 */
25 public:
26 ProfilerMetricsIOS() = default;
27
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_
Utility class that gathers profiling metrics used by flutter::SamplingProfiler.
Container for the metrics we collect during each run of Sampler. This currently holds CpuUsageInfo an...