Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix : Metrics - Remove all data collection from Stride.Engine #2261

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions build/Stride.Launcher.sln
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@


Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.28803.352
Expand Down Expand Up @@ -38,7 +38,6 @@ Global
..\sources\assets\Stride.Core.Assets.Yaml\Stride.Core.Assets.Yaml.projitems*{0f8be30e-c41f-4747-b52b-d2d4e13ec6a2}*SharedItemsImports = 5
..\sources\editor\Stride.Core.MostRecentlyUsedFiles\Stride.Core.MostRecentlyUsedFiles.projitems*{0f8be30e-c41f-4747-b52b-d2d4e13ec6a2}*SharedItemsImports = 5
..\sources\editor\Stride.Editor.CrashReport\Stride.Editor.CrashReport.projitems*{0f8be30e-c41f-4747-b52b-d2d4e13ec6a2}*SharedItemsImports = 5
..\sources\editor\Stride.PrivacyPolicy\Stride.PrivacyPolicy.projitems*{0f8be30e-c41f-4747-b52b-d2d4e13ec6a2}*SharedItemsImports = 5
EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -112,4 +111,4 @@ Global
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {04241BED-1662-4690-BA56-15C99A840CFE}
EndGlobalSection
EndGlobal
EndGlobal
7 changes: 1 addition & 6 deletions build/Stride.sln
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Stride.ConnectionRouter", "
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Stride.EffectCompilerServer", "..\sources\tools\Stride.EffectCompilerServer\Stride.EffectCompilerServer.csproj", "{E25E7778-0B2F-4A0B-BCD6-1DE95320B531}"
EndProject
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Stride.PrivacyPolicy", "..\sources\editor\Stride.PrivacyPolicy\Stride.PrivacyPolicy.shproj", "{950BADD0-AD5A-4F58-87EC-4ADAECBEA89B}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Stride.SpriteStudio.Offline", "..\sources\engine\Stride.SpriteStudio.Offline\Stride.SpriteStudio.Offline.csproj", "{63562B0A-E501-42C2-97BB-13D3AD3A7DB4}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Stride.SpriteStudio.Runtime", "..\sources\engine\Stride.SpriteStudio.Runtime\Stride.SpriteStudio.Runtime.csproj", "{9BC63BEC-F305-451D-BB31-262938EA964D}"
Expand Down Expand Up @@ -1549,7 +1547,6 @@ Global
{73AA8A18-15C4-405B-BBF4-5D41C1CE44AD} = {5D2D3BE8-9910-45CA-8E45-95660DA4C563}
{77E2FCC0-4CA6-436C-BE6F-9418CB807D45} = {1AE1AC60-5D2F-4CA7-AE20-888F44551185}
{E25E7778-0B2F-4A0B-BCD6-1DE95320B531} = {1AE1AC60-5D2F-4CA7-AE20-888F44551185}
{950BADD0-AD5A-4F58-87EC-4ADAECBEA89B} = {5D2D3BE8-9910-45CA-8E45-95660DA4C563}
{63562B0A-E501-42C2-97BB-13D3AD3A7DB4} = {F765035E-F4F4-4CFA-BA02-755DC677AA97}
{9BC63BEC-F305-451D-BB31-262938EA964D} = {4C142567-C42B-40F5-B092-798882190209}
{9AC6D791-811E-4D6A-B08E-93F0093EF268} = {75A820AB-0F21-40F2-9448-5D7F495B97A0}
Expand Down Expand Up @@ -1616,7 +1613,6 @@ Global
..\sources\shared\Stride.Core.ShellHelper\Stride.Core.ShellHelper.projitems*{1e54a9a2-4439-4444-ae57-6d2ed3c0dc47}*SharedItemsImports = 5
..\sources\shared\Stride.NuGetResolver.Targets\Stride.NuGetResolver.Targets.projitems*{2fc40214-a4aa-45dc-9c93-72ed800c40b0}*SharedItemsImports = 5
..\sources\editor\Stride.Editor.CrashReport\Stride.Editor.CrashReport.projitems*{2fca2d8b-b10f-4dca-9847-4221f74ba586}*SharedItemsImports = 5
..\sources\editor\Stride.PrivacyPolicy\Stride.PrivacyPolicy.projitems*{2fca2d8b-b10f-4dca-9847-4221f74ba586}*SharedItemsImports = 5
..\sources\shared\Stride.Core.ShellHelper\Stride.Core.ShellHelper.projitems*{2fca2d8b-b10f-4dca-9847-4221f74ba586}*SharedItemsImports = 5
..\sources\shared\Stride.NuGetResolver.Targets\Stride.NuGetResolver.Targets.projitems*{2fca2d8b-b10f-4dca-9847-4221f74ba586}*SharedItemsImports = 5
..\sources\shared\Stride.Core.ShellHelper\Stride.Core.ShellHelper.projitems*{39ae9c77-e94b-404f-8768-b6261b3c1e0e}*SharedItemsImports = 5
Expand All @@ -1628,7 +1624,6 @@ Global
..\sources\shared\Stride.Core.ShellHelper\Stride.Core.ShellHelper.projitems*{77e2fcc0-4ca6-436c-be6f-9418cb807d45}*SharedItemsImports = 5
..\sources\shared\Stride.NuGetResolver.Targets\Stride.NuGetResolver.Targets.projitems*{77e2fcc0-4ca6-436c-be6f-9418cb807d45}*SharedItemsImports = 5
..\sources\engine\Stride.Shared\Refactor\Stride.Refactor.projitems*{7af4b563-aad3-42ff-b91e-84b9d34d904a}*SharedItemsImports = 5
..\sources\editor\Stride.PrivacyPolicy\Stride.PrivacyPolicy.projitems*{950badd0-ad5a-4f58-87ec-4adaecbea89b}*SharedItemsImports = 13
..\sources\editor\Stride.Core.MostRecentlyUsedFiles\Stride.Core.MostRecentlyUsedFiles.projitems*{9ac6d791-811e-4d6a-b08e-93f0093ef268}*SharedItemsImports = 13
..\sources\shared\Stride.Core.ShellHelper\Stride.Core.ShellHelper.projitems*{a5dc820b-9554-45b6-9677-6a2f902e7787}*SharedItemsImports = 5
..\sources\shared\Stride.NuGetResolver.Targets\Stride.NuGetResolver.Targets.projitems*{a5dc820b-9554-45b6-9677-6a2f902e7787}*SharedItemsImports = 5
Expand All @@ -1641,4 +1636,4 @@ Global
..\sources\engine\Stride.Shared\Refactor\Stride.Refactor.projitems*{fb06c76a-6bb7-40be-9afa-fec13b045fb5}*SharedItemsImports = 5
..\sources\assets\Stride.Core.Assets.Yaml\Stride.Core.Assets.Yaml.projitems*{fb9ed2c4-94a0-4004-a498-3f29a9d5bb5d}*SharedItemsImports = 13
EndGlobalSection
EndGlobal
EndGlobal
2 changes: 0 additions & 2 deletions sources/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,7 @@
<PackageVersion Include="Microsoft.Xaml.Behaviors.Wpf" Version="1.1.77" />
<PackageVersion Include="Microsoft.Win32.Registry" Version="5.0.0" />
<PackageVersion Include="Microsoft-WindowsAPICodePack-Shell" Version="1.1.5" />
<PackageVersion Include="Stride.CrashReport" Version="1.0.2" />
<PackageVersion Include="Stride.GraphX.WPF.Controls" Version="2.4.0" />
<PackageVersion Include="Stride.Metrics" Version="1.0.3" />
<PackageVersion Include="RoslynPad.Editor.Windows" Version="1.2.0" />
<PackageVersion Include="RoslynPad.Roslyn" Version="3.6.0" />
<PackageVersion Include="RoslynPad.Roslyn.Windows" Version="3.6.0" />
Expand Down
12 changes: 9 additions & 3 deletions sources/core/Stride.Core.Design/Windows/AppHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using System.Text;
using Stride.Core.Annotations;
using Stride.Core.Extensions;
using System.Runtime.InteropServices;

namespace Stride.Core.Windows
{
Expand All @@ -29,7 +30,7 @@ public static string BuildErrorMessage([NotNull] Exception exception, string hea
}
body.AppendLine($"Current Directory: {Environment.CurrentDirectory}");
body.AppendLine($"Command Line Args: {string.Join(" ", GetCommandLineArgs())}");
body.AppendLine($"OS Version: {Environment.OSVersion} ({(Environment.Is64BitOperatingSystem ? "x64" : "x86")})");
body.AppendLine($"OS Version: {RuntimeInformation.OSDescription} ({(Environment.Is64BitOperatingSystem ? "x64" : "x86")})");
body.AppendLine($"Processor Count: {Environment.ProcessorCount}");
body.AppendLine("Video configuration:");
WriteVideoConfig(body);
Expand Down Expand Up @@ -83,7 +84,14 @@ public static void WriteVideoConfig(StringBuilder writer)
public static Dictionary<string, string> GetVideoConfig()
{
var result = new Dictionary<string, string>();
if(OperatingSystem.IsWindows())
GetVideoConfigWindows(result);

return result;
}

private static void GetVideoConfigWindows(Dictionary<string, string> result)
{
try
{
var searcher = new ManagementObjectSearcher("SELECT * FROM Win32_VideoController");
Expand All @@ -103,8 +111,6 @@ public static Dictionary<string, string> GetVideoConfig()
{
// ignored
}

return result;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,6 @@ static EditorSettings()
DisplayName = $"{Interface}/{Tr._p("Settings", "Ask before saving new scripts")}",
Description = Tr._p("Settings", "Ask before saving new scripts"),
};
EnableMetrics = new SettingsKey<bool>("Interface/ToggleMetrics", SettingsContainer, true)
{
DisplayName = $"{Interface}/{Tr._p("Settings", "Usage Analytics")}",
Description = Tr._p("Settings", "Anonymous usage analytics to help the Stride community improve the software. Statistics on installation, version-specific usage, and platform popularity. The data is open-source at https://metrics.stride3d.net")
};
StoreCrashEmail = new SettingsKey<string>("Interface/StoreCrashEmail", SettingsContainer, "")
{
DisplayName = $"{Interface}/{Tr._p("Settings", "Crash report e-mail")}",
Description = Tr._p("Settings", "Crash report e-mail"),
};
Language = new SettingsKey<SupportedLanguage>("Interface/Language", SettingsContainer, SupportedLanguage.MachineDefault)
{
DisplayName = $"{Interface}/{Tr._p("Settings", "Language")}",
Expand Down Expand Up @@ -112,8 +102,6 @@ static EditorSettings()

public static SettingsKey<bool> AskBeforeSavingNewScripts { get; }

public static SettingsKey<string> StoreCrashEmail { get; }

public static SettingsKey<SupportedLanguage> Language { get; }

public static SettingsCommand ResetEditorLayout { get; }
Expand All @@ -124,8 +112,6 @@ static EditorSettings()

public static SettingsKey<bool> ReloadLastSession { get; }

public static SettingsKey<bool> EnableMetrics { get; }

public static bool NeedRestart { get; set; }

public static void Initialize()
Expand All @@ -136,7 +122,6 @@ public static void Initialize()
// Settings that requires a restart must register here:
UseEffectCompilerServer.ChangesValidated += (s, e) => NeedRestart = true;
Language.ChangesValidated += (s, e) => NeedRestart = true;
EnableMetrics.ChangesValidated += (s, e) => NeedRestart = true;

Presentation.Themes.ThemesSettings.ThemeName.ChangesValidated += (s, e) => NeedRestart = true;
}
Expand Down
54 changes: 54 additions & 0 deletions sources/editor/Stride.Editor.CrashReport/CrashReportData.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
// Copyright (c) .NET Foundation and Contributors (https://dotnetfoundation.org/ & https://stride3d.net) and Silicon Studio Corp. (https://www.siliconstudio.co.jp)
// Distributed under the MIT license. See the LICENSE.md file in the project root for more information.

using System.Text;
using System.Collections.Generic;
using System.Linq;

namespace Stride.Editor.CrashReport;

public class CrashReportData
{
public List<(string, string)> Data = [];

public string this[string key]
{
get
{
return Data.FirstOrDefault(p => p.Item1 == key).Item2;
}
set
{
int num = -1;

foreach(var current in Data)
{
if (current.Item1 == key)
{
num = Data.IndexOf(current);
break;
}
}
if(value == null)
return;
if (num != -1)
{
Data[num] = (key, value);
}
else
{
Data.Add((key, value));
}
}
}

public override string ToString()
{
StringBuilder val = new();
foreach (var current in Data)
{
val.Append(string.Concat(current.Item1, ": ", current.Item2, "\r\n"));
}
return val.ToString();
}
}
Loading