Package jenkins.telemetry
Class Telemetry
- java.lang.Object
-
- jenkins.telemetry.Telemetry
-
- All Implemented Interfaces:
ExtensionPoint
- Direct Known Subclasses:
DistributedBuilds,JavaSystemProperties,OptionalPermissions,SecurityConfiguration,SecuritySystemProperties,StaplerDispatches,Uptime,UserLanguages
public abstract class Telemetry extends Object implements ExtensionPoint
Extension point for collecting JEP-214 telemetry. Implementations should provide adescription.jellyfile with additional details about their purpose and behavior which will be included inhelp-usageStatisticsCollected.jellyforUsageStatistics.- Since:
- 2.143
- See Also:
- JEP-214
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTelemetry.TelemetryReporter-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Constructor Summary
Constructors Constructor Description Telemetry()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static ExtensionList<Telemetry>all()protected Map<String,String>buildComponentInformation()Produces a list of Jenkins core and plugin version numbers to include in telemetry implementations for which this would be relevant.abstract net.sf.json.JSONObjectcreateContent()Returns the content to be sent to the telemetry service.abstract StringgetDisplayName()User friendly display name for this telemetry collector, ideally localized.abstract LocalDategetEnd()End date for the collection.StringgetId()ID of this collector, typically an alphanumeric string (and punctuation).abstract LocalDategetStart()Start date for the collection.booleanisActivePeriod()Returns true iff we're in the time period during which this is supposed to collect data.static booleanisDisabled()
-
-
-
Method Detail
-
getId
@NonNull public String getId()
ID of this collector, typically an alphanumeric string (and punctuation). Good IDs are globally unique and human readable (i.e. no UUIDs). For a periodically updated list of all public implementations, see the developer documentation.- Returns:
- ID of the collector, never null or empty
-
getDisplayName
@NonNull public abstract String getDisplayName()
User friendly display name for this telemetry collector, ideally localized.- Returns:
- display name, never null or empty
-
getStart
@NonNull public abstract LocalDate getStart()
Start date for the collection. Will be checked in Jenkins to not collect outside the defined time span. This does not have to be precise enough for time zones to be a consideration.- Returns:
- collection start date
-
getEnd
@NonNull public abstract LocalDate getEnd()
End date for the collection. Will be checked in Jenkins to not collect outside the defined time span. This does not have to be precise enough for time zones to be a consideration.- Returns:
- collection end date
-
createContent
@CheckForNull public abstract net.sf.json.JSONObject createContent()
Returns the content to be sent to the telemetry service. This method is called periodically, once per content submission.- Returns:
- The JSON payload, or null if no content should be submitted.
-
all
public static ExtensionList<Telemetry> all()
-
isDisabled
public static boolean isDisabled()
- Returns:
- whether to collect telemetry
- Since:
- 2.147
-
isActivePeriod
public boolean isActivePeriod()
Returns true iff we're in the time period during which this is supposed to collect data.- Returns:
- true iff we're in the time period during which this is supposed to collect data
- Since:
- 2.202
-
buildComponentInformation
protected final Map<String,String> buildComponentInformation()
Produces a list of Jenkins core and plugin version numbers to include in telemetry implementations for which this would be relevant.- Returns:
- a map in a format suitable for a value of
createContent() - Since:
- 2.325
-
-