5#ifndef FLUTTER_SHELL_PROFILING_SAMPLING_PROFILER_H_
6#define FLUTTER_SHELL_PROFILING_SAMPLING_PROFILER_H_
13#include "flutter/fml/synchronization/count_down_latch.h"
14#include "flutter/fml/task_runner.h"
15#include "flutter/fml/trace_event.h"
99 int num_samples_per_sec);
112 const std::string thread_label_;
115 const uint32_t num_samples_per_sec_;
116 bool is_running_ =
false;
117 std::atomic<fml::AutoResetWaitableEvent*> shutdown_latch_ =
nullptr;
127 void UpdateDartVMServiceThreadName()
const;
a Sampling Profiler that runs peridically and calls the Sampler which servers as a value function to ...
SamplingProfiler(const char *thread_label, fml::RefPtr< fml::TaskRunner > profiler_task_runner, Sampler sampler, int num_samples_per_sec)
Construct a new Sampling Profiler object.
void Start()
Starts the SamplingProfiler by triggering SampleRepeatedly.
Dart_NativeFunction function
std::function< ProfileSample(void)> Sampler
Sampler is run during SamplingProfiler::SampleRepeatedly. Each platform should implement its version ...
CPU usage stats. num_threads is the number of threads owned by the process. It is to be noted that th...
Polled information related to the usage of the GPU.
Memory usage stats. dirty_memory_usage is the memory usage (in MB) such that the app uses its physica...
double dirty_memory_usage
double owned_shared_memory_usage
Container for the metrics we collect during each run of Sampler. This currently holds CpuUsageInfo an...
std::optional< CpuUsageInfo > cpu_usage
std::optional< GpuUsageInfo > gpu_usage
std::optional< MemoryUsageInfo > memory_usage