public class DevModeUsageStatistics extends Object
All statistics gathering methods in this class are static for easy caller code and they immediately update the stored JSON on disk.
For internal use only. May be renamed or removed in a future release.
Modifier and Type | Method and Description |
---|---|
static void |
collectEvent(String name)
Increments specified event count in the current project data.
|
static void |
collectEvent(String name,
double value)
Update a value in usage statistics.
|
static void |
handleBrowserData(elemental.json.JsonObject data)
Stores telemetry data received from the browser.
|
static DevModeUsageStatistics |
init(String projectFolder,
StatisticsStorage storage,
StatisticsSender sender)
Initialize the statistics module.
|
void |
set(String name,
String value)
Set value of string value in current project statistics data.
|
void |
setGlobal(String name,
String value)
Set value of string field in current statistics data.
|
public static DevModeUsageStatistics init(String projectFolder, StatisticsStorage storage, StatisticsSender sender)
This should only ever be called in development mode.
projectFolder
- the folder of the current projectstorage
- the statistics storage to usesender
- the statistics sender to usenull
if telemetry is not usedpublic static void handleBrowserData(elemental.json.JsonObject data)
data
- the data from the browserpublic static void collectEvent(String name)
Good for logging statistics of recurring events.
name
- Name of the event.public static void collectEvent(String name, double value)
Good for logging statistics about chancing values over time.
name
- Name of the field to update.value
- The new value to store.public void set(String name, String value)
name
- name of the field to set.value
- the new string value to set.Copyright © 2022. All rights reserved.