#pragma once #include #include #include namespace RBX { class DataModel; class Instance; class GamePerfMonitor { std::string baseUrl; std::string jobId; int placeId; int userId; bool shouldPostDiagStats; boost::shared_ptr frmStats; // keep a shared pointer here so we can still use it after RenderView shuts down void collectAndPostStats(boost::weak_ptr dataModel); void postDiagStats(boost::shared_ptr dataModel); void onGameClose(boost::weak_ptr dataModel); public: GamePerfMonitor(const std::string& baseUrl, const std::string& jobId, int placeId, int userId) : baseUrl(baseUrl), jobId(jobId), placeId(placeId), userId(userId), shouldPostDiagStats(false) {}; ~GamePerfMonitor(); void start(DataModel* dataModel); void setPostDiagStats(bool shouldPost) { shouldPostDiagStats = shouldPost; } }; } // namespace