com.vaadin.base.devserver.stats.
Class DevModeUsageStatistics
Singleton for collecting development time usage metrics
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.
Since:
Author:
Vaadin Ltd
-
Method Summary
Modifier and TypeMethodDescriptionstatic 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
(File projectFolder, StatisticsStorage storage, StatisticsSender sender) Initialize the statistics module.
void
Set value of string value in current project statistics data.
void
Set value of string field in current statistics data.
-
Method Details
-
init
public static DevModeUsageStatistics init(File projectFolder, StatisticsStorage storage, StatisticsSender sender) Initialize the statistics module.
This should only ever be called in development mode.
Parameters:
projectFolder
- the folder of the current projectstorage
- the statistics storage to usesender
- the statistics sender to useReturns:
the created instance or
null
if telemetry is not used -
handleBrowserData
public static void handleBrowserData(elemental.json.JsonObject data) Stores telemetry data received from the browser.
Parameters:
data
- the data from the browser -
collectEvent
Increments specified event count in the current project data.
Good for logging statistics of recurring events.
Parameters:
name
- Name of the event. -
collectEvent
Update a value in usage statistics. Also, automatically aggregates min, max and average of the value.
Good for logging statistics about chancing values over time.
Parameters:
name
- Name of the field to update.value
- The new value to store. -
set
Set value of string value in current project statistics data.
Parameters:
name
- name of the field to set.value
- the new string value to set. -
setGlobal
Set value of string field in current statistics data.
Parameters:
name
- name of the field to set.value
- the new string value to set.
-