com.vaadin.base.devserver.stats.
Class DevModeUsageStatistics
- java.lang.Object
-
- com.vaadin.base.devserver.stats.DevModeUsageStatistics
-
public class DevModeUsageStatistics extends Object
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
All Methods Modifier and Type Method 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.
-
-
-
Method Detail
-
init
public static DevModeUsageStatistics init(String 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
public static void collectEvent(String name)
Increments specified event count in the current project data.
Good for logging statistics of recurring events.
Parameters:
name
- Name of the event.
-
collectEvent
public static void collectEvent(String name, double value)
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
public void set(String name, String value)
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.
-
-