* Add TelemetryService Currently it only allows you to get a list of the name of all the installed packages * Create model class for package telemetry And move the telemetry report data out of ReportSiteTask * Add version as an option in package manifest * Use TelemetryService to generate telemetry data Instead of doing it directly in the ReportSiteTask * Seal TelemetryService This should not be overwritten * Add option for package creators to opt out * Add global setting to restrict package telemetry * Add TelemetryService unit tests * Add ManifestParser tests for new properties * Clean * Update src/Umbraco.Core/Telemetry/TelemetryService.cs Co-authored-by: Bjarke Berg <mail@bergmania.dk> * Create interface for telemetry service * Use IOptionsMonitor instead of IOptions However I chose to use CurrentValue since according to microsoft: "Some file systems, such as Docker containers and network shares, may not reliably send change notifications.", additionally TelemetryService only runs once pr. day, so it shouldn't be too much of an issue that it doesn't cache the result. * Use is false instead of negation It's a bit more readable * Track restrict package telemetry value * Save RestrictPackageTelemetry in report data Not packages, since it'll be the same for all packages * Fix TelemetryService unit tests * Clean * Update src/Umbraco.Core/Telemetry/ITelemetryService.cs Co-authored-by: Bjarke Berg <mail@bergmania.dk> * Remove RestrictPackageTelemetry Co-authored-by: Bjarke Berg <mail@bergmania.dk>
35 lines
1.0 KiB
C#
35 lines
1.0 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Runtime.Serialization;
|
|
|
|
namespace Umbraco.Cms.Core.Telemetry.Models
|
|
{
|
|
/// <summary>
|
|
/// Serializable class containing telemetry information.
|
|
/// </summary>
|
|
[DataContract]
|
|
public class TelemetryReportData
|
|
{
|
|
/// <summary>
|
|
/// Gets or sets a random GUID to prevent an instance posting multiple times pr. day.
|
|
/// </summary>
|
|
[DataMember(Name = "id")]
|
|
public Guid Id { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the Umbraco CMS version.
|
|
/// </summary>
|
|
[DataMember(Name = "version")]
|
|
public string Version { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets an enumerable containing information about packages.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Contains only the name and version of the packages, unless no version is specified.
|
|
/// </remarks>
|
|
[DataMember(Name = "packages")]
|
|
public IEnumerable<PackageTelemetry> Packages { get; set; }
|
|
}
|
|
}
|