#ifndef CHROME_BROWSER_ASH_ARC_TRACING_UMA_PERF_REPORTING_H_
#define CHROME_BROWSER_ASH_ARC_TRACING_UMA_PERF_REPORTING_H_
#include <optional>
#include <set>
#include <string>
#include <string_view>
#include "base/memory/weak_ptr.h"
#include "chrome/browser/ash/arc/tracing/arc_app_performance_tracing_session.h"
namespace arc {
inline constexpr base::TimeDelta kInitTracingDelay = base::Minutes(1);
inline constexpr base::TimeDelta kNextTracingDelay = base::Minutes(20);
class UmaPerfReporting {
public:
UmaPerfReporting();
~UmaPerfReporting();
void Schedule(ArcAppPerformanceTracingSession* session,
const std::string& category);
static void SetTracingPeriodForTesting(const base::TimeDelta& period);
private:
void OnDone(ArcAppPerformanceTracingSession* session,
const std::string& category,
const std::optional<PerfTraceResult>& result);
std::set<std::string> reported_categories_;
base::WeakPtrFactory<UmaPerfReporting> weak_ptr_factory_;
};
}
#endif