This library contains enhancements to the Microsoft.AppCenter.Analytics
package to provide additional metrics with direct logging to Visual Studio App Center. It provides an AnalyticsMetrics
object implementing the IAppCenterService
interface with the ability to track additional types of events. This allows you to use the measured information to enrich your analytics.
This package can be installed as a nuget package.
Tracking the duration of an event such as a network request or some data processing task can be achieved using the TrackTimedEvent()
method.
The following additional properties are exposed in the event sent to App Center:
Property Name | Property Value |
---|---|
Start Time | The start time of the event. |
End Time | The end time of the event. |
Duration | The time interval between the start and end time. |
using (AnalyticsMetrics.TrackTimedEvent("Network Request"))
{
var client = new HttpClient();
var response = await client.GetStringAsync("https://google.com");
return response;
}