AvailabilityTelemetry Class

  • java.lang.Object
    • com.microsoft.applicationinsights.telemetry.BaseTelemetry
      • com.microsoft.applicationinsights.telemetry.BaseSampleSourceTelemetry
        • com.microsoft.bot.applicationinsights.AvailabilityTelemetry

public final class AvailabilityTelemetry
extends com.microsoft.applicationinsights.telemetry.BaseSampleSourceTelemetry<com.microsoft.applicationinsights.internal.schemav2.AvailabilityData>

We took this class from https://github.com/microsoft/ApplicationInsights-Java/issues/1099 as this is not already migrated in ApplicationInsights-Java library.

Field Summary

Modifier and Type Field and Description
static final java.lang.String BASE_TYPE
static final java.lang.String ENVELOPE_NAME

Constructor Summary

Constructor Description
AvailabilityTelemetry()

Initializes a new instance of the AvailabilityTelemetry class.

AvailabilityTelemetry(String name, Duration duration, String runLocation, String message, boolean success, ConcurrentMap<String,Double> measurements, ConcurrentMap<String,String> properties)

Initializes a new instance of the AvailabilityTelemetry class with the given name, time stamp, duration, HTTP response code and success property values.

Method Summary

Modifier and Type Method and Description
protected void additionalSanitize()
java.lang.String getBaseTypeName()
protected com.microsoft.applicationinsights.internal.schemav2.AvailabilityData getData()
com.microsoft.applicationinsights.telemetry.Duration getDuration()

Gets the amount of time it took the application to handle the request.

java.lang.String getEnvelopName()
java.lang.String getId()

Gets the unique identifier of the request.

java.util.concurrent.ConcurrentMap<java.lang.String,java.lang.Double> getMetrics()

Gets a map of application-defined request metrics.

java.lang.String getName()

Gets or human-readable name of the requested page.

java.lang.String getRunLocation()

Gets or human-readable name of the run location.

java.lang.Double getSamplingPercentage()
int getVer()

Gets the ver value from the data object.

boolean isSuccess()

Gets a value indicating whether application handled the request successfully.

void setDuration(Duration duration)

Sets the amount of time it took the application to handle the request.

void setId(String id)

Sets the unique identifier of the request.

void setName(String name)

Sets or human-readable name of the requested page.

void setRunLocation(String runLocation)

Sets or human-readable name of the run location.

void setSamplingPercentage(Double samplingPercentage)
void setSuccess(boolean success)

Sets a value indicating whether application handled the request successfully.

void setTimestamp(Date timestamp)

Sets the StartTime.

Methods inherited from com.microsoft.applicationinsights.telemetry.BaseSampleSourceTelemetry

com.microsoft.applicationinsights.telemetry.BaseSampleSourceTelemetry.reset com.microsoft.applicationinsights.telemetry.BaseSampleSourceTelemetry.setSampleRate

Methods inherited from com.microsoft.applicationinsights.telemetry.BaseTelemetry

com.microsoft.applicationinsights.telemetry.BaseTelemetry.additionalSanitize com.microsoft.applicationinsights.telemetry.BaseTelemetry.getBaseTypeName com.microsoft.applicationinsights.telemetry.BaseTelemetry.getContext com.microsoft.applicationinsights.telemetry.BaseTelemetry.getData com.microsoft.applicationinsights.telemetry.BaseTelemetry.getEnvelopName com.microsoft.applicationinsights.telemetry.BaseTelemetry.getProperties com.microsoft.applicationinsights.telemetry.BaseTelemetry.getSequence com.microsoft.applicationinsights.telemetry.BaseTelemetry.getTelemetryName com.microsoft.applicationinsights.telemetry.BaseTelemetry.getTimestamp com.microsoft.applicationinsights.telemetry.BaseTelemetry.getVer com.microsoft.applicationinsights.telemetry.BaseTelemetry.initialize com.microsoft.applicationinsights.telemetry.BaseTelemetry.normalizeInstrumentationKey com.microsoft.applicationinsights.telemetry.BaseTelemetry.sanitize com.microsoft.applicationinsights.telemetry.BaseTelemetry.serialize com.microsoft.applicationinsights.telemetry.BaseTelemetry.setSequence com.microsoft.applicationinsights.telemetry.BaseTelemetry.setTimestamp com.microsoft.applicationinsights.telemetry.BaseTelemetry.toString

Methods inherited from java.lang.Object

java.lang.Object.clone java.lang.Object.equals java.lang.Object.finalize java.lang.Object.getClass java.lang.Object.hashCode java.lang.Object.notify java.lang.Object.notifyAll java.lang.Object.wait java.lang.Object.wait java.lang.Object.wait

Field Details

BASE_TYPE

public static final String BASE_TYPE

ENVELOPE_NAME

public static final String ENVELOPE_NAME

Constructor Details

AvailabilityTelemetry

public AvailabilityTelemetry()

Initializes a new instance of the AvailabilityTelemetry class.

AvailabilityTelemetry

public AvailabilityTelemetry(String name, Duration duration, String runLocation, String message, boolean success, ConcurrentMap measurements, ConcurrentMap properties)

Initializes a new instance of the AvailabilityTelemetry class with the given name, time stamp, duration, HTTP response code and success property values.

Parameters:

name - A user-friendly name for the request.
duration - The time of the request.
runLocation - The duration, in milliseconds, of the request processing.
message - The HTTP response code.
success - 'true' if the request was a success, 'false' otherwise.
measurements - The measurements.
properties - The corresponding properties.

Method Details

additionalSanitize


protected void additionalSanitize()

Overrides:

AvailabilityTelemetry.additionalSanitize()

getBaseTypeName

public String getBaseTypeName()

Overrides:

AvailabilityTelemetry.getBaseTypeName()

getData

protected AvailabilityData getData()

Overrides:

AvailabilityTelemetry.getData()

getDuration

public Duration getDuration()

Gets the amount of time it took the application to handle the request.

Returns:

Amount of time in milliseconds.

getEnvelopName

public String getEnvelopName()

Overrides:

AvailabilityTelemetry.getEnvelopName()

getId

public String getId()

Gets the unique identifier of the request.

Returns:

Unique identifier.

getMetrics

public ConcurrentMap getMetrics()

Gets a map of application-defined request metrics.

Returns:

The map of metrics

getName

public String getName()

Gets or human-readable name of the requested page.

Returns:

A human-readable name.

getRunLocation

public String getRunLocation()

Gets or human-readable name of the run location.

Returns:

A human-readable name.

getSamplingPercentage

public Double getSamplingPercentage()

getVer

public int getVer()

Gets the ver value from the data object.

Overrides:

AvailabilityTelemetry.getVer()

Returns:

The ver value.

isSuccess

public boolean isSuccess()

Gets a value indicating whether application handled the request successfully.

Returns:

Success indication.

setDuration

public void setDuration(Duration duration)

Sets the amount of time it took the application to handle the request.

Parameters:

duration - Amount of time in captured in a com.microsoft.applicationinsights.telemetry.Duration.

setId

public void setId(String id)

Sets the unique identifier of the request.

Parameters:

id - Unique identifier.

setName

public void setName(String name)

Sets or human-readable name of the requested page.

Parameters:

name - A human-readable name.

setRunLocation

public void setRunLocation(String runLocation)

Sets or human-readable name of the run location.

Parameters:

runLocation - A human-readable name

setSamplingPercentage

public void setSamplingPercentage(Double samplingPercentage)

Parameters:

samplingPercentage

setSuccess

public void setSuccess(boolean success)

Sets a value indicating whether application handled the request successfully.

Parameters:

success - Success indication.

setTimestamp

public void setTimestamp(Date timestamp)

Sets the StartTime. Uses the default behavior and sets the property on the 'data' start time.

Overrides:

AvailabilityTelemetry.setTimestamp(Date timestamp)

Parameters:

timestamp - The timestamp as Date.

Applies to