mirror of
https://github.com/bloxstraplabs/bloxstrap.git
synced 2025-04-21 10:01:27 -07:00
Add analytics datapoints for installs and channels
This commit is contained in:
parent
0cd87366a7
commit
d09bffeb22
@ -131,6 +131,21 @@ namespace Bloxstrap
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static async void SendStat(string key, string value)
|
||||||
|
{
|
||||||
|
if (!Settings.Prop.EnableAnalytics)
|
||||||
|
return;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
await HttpClient.GetAsync($"https://bloxstrapabs.com/metrics/post?key={key}&value={value}");
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Logger.WriteException("App::SendStat", ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected override void OnStartup(StartupEventArgs e)
|
protected override void OnStartup(StartupEventArgs e)
|
||||||
{
|
{
|
||||||
const string LOG_IDENT = "App::OnStartup";
|
const string LOG_IDENT = "App::OnStartup";
|
||||||
|
@ -245,6 +245,9 @@ namespace Bloxstrap
|
|||||||
channel = value;
|
channel = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (channel != "production")
|
||||||
|
App.SendStat("robloxChannel", channel);
|
||||||
|
|
||||||
ClientVersion clientVersion;
|
ClientVersion clientVersion;
|
||||||
|
|
||||||
try
|
try
|
||||||
@ -1055,8 +1058,7 @@ namespace Bloxstrap
|
|||||||
|
|
||||||
if (ex.GetType() == typeof(ChecksumFailedException))
|
if (ex.GetType() == typeof(ChecksumFailedException))
|
||||||
{
|
{
|
||||||
if (App.Settings.Prop.EnableAnalytics)
|
App.SendStat("packageDownloadState", "httpFail");
|
||||||
_ = App.HttpClient.GetAsync($"https://bloxstraplabs.com/metrics/post?key=packageDownloadState&value=httpFail");
|
|
||||||
|
|
||||||
Frontend.ShowConnectivityDialog(
|
Frontend.ShowConnectivityDialog(
|
||||||
Strings.Dialog_Connectivity_UnableToDownload,
|
Strings.Dialog_Connectivity_UnableToDownload,
|
||||||
@ -1088,11 +1090,8 @@ namespace Bloxstrap
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (statIsRetrying && App.Settings.Prop.EnableAnalytics)
|
if (statIsRetrying)
|
||||||
{
|
App.SendStat("packageDownloadState", statIsHttp ? "httpSuccess" : "retrySuccess");
|
||||||
string stat = statIsHttp ? "httpSuccess" : "retrySuccess";
|
|
||||||
_ = App.HttpClient.GetAsync($"https://bloxstraplabs.com/metrics/post?key=packageDownloadState&value={stat}");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ExtractPackage(Package package, List<string>? files = null)
|
private void ExtractPackage(Package package, List<string>? files = null)
|
||||||
|
@ -92,6 +92,9 @@ namespace Bloxstrap
|
|||||||
WindowsRegistry.RegisterStudio();
|
WindowsRegistry.RegisterStudio();
|
||||||
|
|
||||||
App.Logger.WriteLine(LOG_IDENT, "Installation finished");
|
App.Logger.WriteLine(LOG_IDENT, "Installation finished");
|
||||||
|
|
||||||
|
if (!IsImplicitInstall)
|
||||||
|
App.SendStat("installAction", "install");
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool ValidateLocation()
|
private bool ValidateLocation()
|
||||||
@ -340,6 +343,8 @@ namespace Bloxstrap
|
|||||||
WindowStyle = ProcessWindowStyle.Hidden
|
WindowStyle = ProcessWindowStyle.Hidden
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
App.SendStat("installAction", "uninstall");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void HandleUpgrade()
|
public static void HandleUpgrade()
|
||||||
@ -561,6 +566,8 @@ namespace Bloxstrap
|
|||||||
if (currentVer is null)
|
if (currentVer is null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
App.SendStat("installAction", "upgrade");
|
||||||
|
|
||||||
if (isAutoUpgrade)
|
if (isAutoUpgrade)
|
||||||
{
|
{
|
||||||
Utilities.ShellExecute($"https://github.com/{App.ProjectRepository}/wiki/Release-notes-for-Bloxstrap-v{currentVer}");
|
Utilities.ShellExecute($"https://github.com/{App.ProjectRepository}/wiki/Release-notes-for-Bloxstrap-v{currentVer}");
|
||||||
|
Loading…
Reference in New Issue
Block a user