mirror of
https://github.com/bloxstraplabs/bloxstrap.git
synced 2025-04-19 00:51:30 -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;
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
const string LOG_IDENT = "App::OnStartup";
|
||||
|
@ -245,6 +245,9 @@ namespace Bloxstrap
|
||||
channel = value;
|
||||
}
|
||||
|
||||
if (channel != "production")
|
||||
App.SendStat("robloxChannel", channel);
|
||||
|
||||
ClientVersion clientVersion;
|
||||
|
||||
try
|
||||
@ -1055,8 +1058,7 @@ namespace Bloxstrap
|
||||
|
||||
if (ex.GetType() == typeof(ChecksumFailedException))
|
||||
{
|
||||
if (App.Settings.Prop.EnableAnalytics)
|
||||
_ = App.HttpClient.GetAsync($"https://bloxstraplabs.com/metrics/post?key=packageDownloadState&value=httpFail");
|
||||
App.SendStat("packageDownloadState", "httpFail");
|
||||
|
||||
Frontend.ShowConnectivityDialog(
|
||||
Strings.Dialog_Connectivity_UnableToDownload,
|
||||
@ -1088,11 +1090,8 @@ namespace Bloxstrap
|
||||
}
|
||||
}
|
||||
|
||||
if (statIsRetrying && App.Settings.Prop.EnableAnalytics)
|
||||
{
|
||||
string stat = statIsHttp ? "httpSuccess" : "retrySuccess";
|
||||
_ = App.HttpClient.GetAsync($"https://bloxstraplabs.com/metrics/post?key=packageDownloadState&value={stat}");
|
||||
}
|
||||
if (statIsRetrying)
|
||||
App.SendStat("packageDownloadState", statIsHttp ? "httpSuccess" : "retrySuccess");
|
||||
}
|
||||
|
||||
private void ExtractPackage(Package package, List<string>? files = null)
|
||||
|
@ -92,6 +92,9 @@ namespace Bloxstrap
|
||||
WindowsRegistry.RegisterStudio();
|
||||
|
||||
App.Logger.WriteLine(LOG_IDENT, "Installation finished");
|
||||
|
||||
if (!IsImplicitInstall)
|
||||
App.SendStat("installAction", "install");
|
||||
}
|
||||
|
||||
private bool ValidateLocation()
|
||||
@ -340,6 +343,8 @@ namespace Bloxstrap
|
||||
WindowStyle = ProcessWindowStyle.Hidden
|
||||
});
|
||||
}
|
||||
|
||||
App.SendStat("installAction", "uninstall");
|
||||
}
|
||||
|
||||
public static void HandleUpgrade()
|
||||
@ -561,6 +566,8 @@ namespace Bloxstrap
|
||||
if (currentVer is null)
|
||||
return;
|
||||
|
||||
App.SendStat("installAction", "upgrade");
|
||||
|
||||
if (isAutoUpgrade)
|
||||
{
|
||||
Utilities.ShellExecute($"https://github.com/{App.ProjectRepository}/wiki/Release-notes-for-Bloxstrap-v{currentVer}");
|
||||
|
Loading…
Reference in New Issue
Block a user