Class Telemetry
Defined in File Telemetry.h
Inheritance Relationships
Derived Type
private flamegpu::detail::TestSuiteTelemetry
(Class TestSuiteTelemetry)
Class Documentation
-
class Telemetry
Class for interacting with the telemetry, using static methods. This is a class rather than a namespace to prevent users from directly calling some methods which must be accessible from CUDASimulation and CUDAEnsemble.
Subclassed by flamegpu::detail::TestSuiteTelemetry
Public Static Functions
-
static void enable()
Opt-in to sending anonymous usage telemetry information, if currently disabled. This controls the default value used for CUDASimulation and CUDAEnsemble configuration objects, which can then independently be opted out.
-
static void disable()
Opt-out of sending anonymous usage telemetry information, if currently enabled. This controls the default value used for CUDASimulation and CUDAEnsemble configuration objects, which can then independently be opted out.
-
static bool isEnabled()
Get the current enabled/disabled status of telemetry. If the system environment variable FLAMEGPU_SHARE_USAGE_STATISTICS is defined, and is false-y (0, false, False, FALSE, off, Off, OFF) it will be disabled by default. Otherwise, the CMake FLAMEGPU_SHARE_USAGE_STATISTICS option will be used, which defaults to On/True. Otherwise, if the define was not specified at build time, it will default to enabled.
- Returns:
if telemetry is currently enabled or disabled.
-
static void suppressNotice()
If telemetry is not enabled, a notice will be emitted to encourage users to enable this as a way to support FLAMEGPU development, once per application run. This method can be called to disable that message from being printed. I.e. this is used within the test suite(s).
Protected Static Functions
-
static std::string generateData(std::string event_name, std::map<std::string, std::string> payload_items, bool isSWIG)
Generates the telemetry data packet as a string. Function is used by sendTelemetryData but is useful for returning the actual json for transparency. See documentation for data which is sent and why
- Parameters:
event_name – the name of the event to record. This will either be “simulation-run, ensemble-run”
payload_items – a map of key value items to embed in the payload of the telemetry packet
isSWIG – True if a swig build of flamegpu
- Returns:
The json string that should be sent via sendTelemetryData
-
static bool sendData(std::string telemetry_data)
Sends telemetry data in the form as the provided json to the TelemetryDeck web service.
- Parameters:
telemetry_data – json data to send
- Returns:
false if failed for any reason (including inability to reach host)
-
static void encourageUsage()
Prints a notice that telemetry is helpful to the development of the software. Notice will not be printed if telemetry is disabled, and the notice has not been suppressed.
-
static bool isTestMode()
Get the current test mode status of telemetry, which will be false unless the system environment variable FLAMEGPU_TELEMETRY_TEST_MODE is defined and not a false-y value, or if the CMake option FLAMEGPU_TELEMETRY_TEST_MODE was set to ON. Otherwise, if the define was not specified at build time, it will default to enabled.
- Returns:
if telemetry is currently in test mode or not.
-
static std::string getConfigDirectory()
Gets a cross platform location for storing user configuration data. Required to store a per user Id. On windows this uses the AppData folder (CSIDL_APPDATA) and in Linux this uses XDG_CONFIG_HOME.
- Returns:
Root directory for storing configuration files
-
static std::string generateRandomId()
Generates a randomised 36 character alphanumeric string for use as a User Id.
- Returns:
A 36 character randomised alphanumeric string
-
static std::string getUserId()
Obtains a unique user Id. If a configuration file (i.e. ${XDG_CONFIG_HOME}/flamegpu/telemetry_user.cfg on linux) exists this will be loaded from disk otherwise it will be generated and stored in the configuration location. If the configuration location is not writeable a new user Id will be generated each time. The user Id will be further obfuscated by Telemetry Deck which will salt and hash the Id.
- Returns:
A 36 character randomised alphanumeric string representing a unique user Id
Protected Static Attributes
-
static constexpr char TELEMETRY_ENDPOINT[] = "https://nom.telemetrydeck.com/v1/"
Friends
- friend class flamegpu::CUDASimulation
- friend class flamegpu::CUDAEnsemble
-
static void enable()