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
Extension point for collecting JEP-214 telemetry.
Implementations should provide a
description.jelly
file with additional details about their purpose and
behavior which will be included in help-usageStatisticsCollected.jelly
for UsageStatistics
.- Since:
- 2.143
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic ExtensionList<Telemetry>
all()
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.JSONObject
Returns the content to be sent to the telemetry service.abstract String
User friendly display name for this telemetry collector, ideally localized.abstract LocalDate
getEnd()
End date for the collection.getId()
ID of this collector, typically an alphanumeric string (and punctuation).abstract LocalDate
getStart()
Start date for the collection.boolean
Returns true iff we're in the time period during which this is supposed to collect data.static boolean
static boolean
-
Constructor Details
-
Telemetry
public Telemetry()
-
-
Method Details
-
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
User friendly display name for this telemetry collector, ideally localized.- Returns:
- display name, never null or empty
-
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
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
-
isAnyTrialActive
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public static boolean isAnyTrialActive() -
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
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
-