public class TelemetryClient
extends java.lang.Object
Modifier | Constructor and Description |
---|---|
protected |
TelemetryClient(boolean telemetryEnabled)
Restrict access to the default constructor
|
Modifier and Type | Method and Description |
---|---|
protected void |
disableAutoAppearanceTracking()
Disable auto appearance management tracking.
|
protected void |
disableAutoPageViewTracking()
Disable auto page view tracking.
|
protected void |
disableAutoSessionManagement()
Disable auto session management tracking.
|
protected void |
enableAutoAppearanceTracking()
Enable auto appearance management tracking.
|
protected void |
enableAutoPageViewTracking()
Enable auto page view tracking.
|
protected void |
enableAutoSessionManagement()
Enable auto session management tracking.
|
static TelemetryClient |
getInstance() |
protected static void |
initialize(boolean telemetryEnabled,
Application application)
Initialize the INSTANCE of the telemetryclient
|
protected boolean |
isTelemetryEnabled()
Determines, whether tracking telemetry data is enabled or not.
|
protected static void |
startAutoCollection(TelemetryContext context,
Configuration config,
boolean autoAppearanceEnabled,
boolean autoPageViewsEnabled,
boolean autoSessionManagementEnabled)
Start auto collection features.
|
protected void |
startSyncWhenBackgrounding() |
void |
track(TelemetryData telemetry)
Sends information about any object that extend TelemetryData interface to Application Insights.
|
void |
trackEvent(java.lang.String eventName)
properties defaults to null . |
void |
trackEvent(java.lang.String eventName,
java.util.Map<java.lang.String,java.lang.String> properties)
measurements defaults to null . |
void |
trackEvent(java.lang.String eventName,
java.util.Map<java.lang.String,java.lang.String> properties,
java.util.Map<java.lang.String,java.lang.Double> measurements)
Sends information about an event to Application Insights.
|
void |
trackMetric(java.lang.String name,
double value)
Sends information about an aggregated metric to Application Insights.
|
void |
trackMetric(java.lang.String name,
double value,
java.util.Map<java.lang.String,java.lang.String> properties)
Sends information about an aggregated metric to Application Insights.
|
void |
trackNewSession()
Sends information about a new Session to Application Insights.
|
void |
trackPageView(java.lang.String pageName)
properties defaults to null . |
void |
trackPageView(java.lang.String pageName,
java.util.Map<java.lang.String,java.lang.String> properties)
measurements defaults to null . |
void |
trackPageView(java.lang.String pageName,
java.util.Map<java.lang.String,java.lang.String> properties,
java.util.Map<java.lang.String,java.lang.Double> measurements) |
void |
trackTrace(java.lang.String message)
measurements defaults to null . |
void |
trackTrace(java.lang.String message,
java.util.Map<java.lang.String,java.lang.String> properties)
Sends tracing information to Application Insights.
|
protected TelemetryClient(boolean telemetryEnabled)
telemetryEnabled
- YES if tracking telemetry data manually should be enabledprotected static void initialize(boolean telemetryEnabled, Application application)
telemetryEnabled
- YES if tracking telemetry data manually should be enabledapplication
- application used for auto collection featuresprotected static void startAutoCollection(TelemetryContext context, Configuration config, boolean autoAppearanceEnabled, boolean autoPageViewsEnabled, boolean autoSessionManagementEnabled)
public static TelemetryClient getInstance()
public void trackEvent(java.lang.String eventName)
properties
defaults to null
.
measurements
defaults to null
.trackEvent(String, Map, Map)
public void trackEvent(java.lang.String eventName, java.util.Map<java.lang.String,java.lang.String> properties)
measurements
defaults to null
.trackEvent(String, Map, Map)
public void track(TelemetryData telemetry)
telemetry
- an object that extends TelemetryDatapublic void trackEvent(java.lang.String eventName, java.util.Map<java.lang.String,java.lang.String> properties, java.util.Map<java.lang.String,java.lang.Double> measurements)
eventName
- The name of the eventproperties
- Custom properties associated with the event. Note: values set here will
supersede values set in ApplicationInsights.setCommonProperties(java.util.Map<java.lang.String, java.lang.String>)
.measurements
- Custom measurements associated with the event.public void trackTrace(java.lang.String message)
measurements
defaults to null
.trackTrace(String, Map)
public void trackTrace(java.lang.String message, java.util.Map<java.lang.String,java.lang.String> properties)
message
- The message associated with this trace.properties
- Custom properties associated with the event. Note: values set here will
supersede values set in ApplicationInsights.setCommonProperties(java.util.Map<java.lang.String, java.lang.String>)
.public void trackMetric(java.lang.String name, double value)
trackEvent(String, Map, Map)
with measurements.name
- The name of the metricvalue
- The value of the metricpublic void trackMetric(java.lang.String name, double value, java.util.Map<java.lang.String,java.lang.String> properties)
trackEvent(String, Map, Map)
with measurements.name
- The name of the metricvalue
- The value of the metricpublic void trackPageView(java.lang.String pageName)
properties
defaults to null
.
measurements
defaults to null
.trackPageView(String, Map, Map)
public void trackPageView(java.lang.String pageName, java.util.Map<java.lang.String,java.lang.String> properties)
measurements
defaults to null
.trackPageView(String, Map, Map)
public void trackPageView(java.lang.String pageName, java.util.Map<java.lang.String,java.lang.String> properties, java.util.Map<java.lang.String,java.lang.Double> measurements)
trackPageView(String, Map, Map)
public void trackNewSession()
protected boolean isTelemetryEnabled()
protected void enableAutoPageViewTracking()
initialize(boolean, Application)
has been called before.protected void disableAutoPageViewTracking()
initialize(boolean, Application)
has been called before.protected void enableAutoSessionManagement()
initialize(boolean, Application)
has been called before.protected void disableAutoSessionManagement()
initialize(boolean, Application)
has been called before.protected void enableAutoAppearanceTracking()
initialize(boolean, Application)
has been called before.protected void disableAutoAppearanceTracking()
initialize(boolean, Application)
has been called before.protected void startSyncWhenBackgrounding()