From 15e07f72d47f316083e6e4c100c199a2906b7723 Mon Sep 17 00:00:00 2001 From: Keivan Beigi Date: Fri, 20 Jan 2017 20:54:04 -0800 Subject: [PATCH] Better Runtime names --- .../EnvironmentInfo/IPlatformInfo.cs | 13 +++++++++++++ .../Instrumentation/Sentry/SentryTarget.cs | 4 ++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/NzbDrone.Common/EnvironmentInfo/IPlatformInfo.cs b/src/NzbDrone.Common/EnvironmentInfo/IPlatformInfo.cs index 9b40d82f0..be88df834 100644 --- a/src/NzbDrone.Common/EnvironmentInfo/IPlatformInfo.cs +++ b/src/NzbDrone.Common/EnvironmentInfo/IPlatformInfo.cs @@ -32,6 +32,19 @@ namespace NzbDrone.Common.EnvironmentInfo public static bool IsMono => Platform == PlatformType.Mono; public static bool IsDotNet => Platform == PlatformType.DotNet; + public static string PlatformName + { + get + { + if (IsDotNet) + { + return ".NET"; + } + + return "Mono"; + } + } + public abstract Version Version { get; } } } diff --git a/src/NzbDrone.Common/Instrumentation/Sentry/SentryTarget.cs b/src/NzbDrone.Common/Instrumentation/Sentry/SentryTarget.cs index 74cc391c3..b0b20eeee 100644 --- a/src/NzbDrone.Common/Instrumentation/Sentry/SentryTarget.cs +++ b/src/NzbDrone.Common/Instrumentation/Sentry/SentryTarget.cs @@ -43,7 +43,7 @@ namespace NzbDrone.Common.Instrumentation.Sentry _client.Tags.Add("osfamily", OsInfo.Os.ToString()); - _client.Tags.Add("runtime", PlatformInfo.Platform.ToString().ToLower()); + _client.Tags.Add("runtime", PlatformInfo.PlatformName); _client.Tags.Add("culture", Thread.CurrentThread.CurrentCulture.Name); _client.Tags.Add("branch", BuildInfo.Branch); _client.Tags.Add("version", BuildInfo.Version.ToString()); @@ -142,7 +142,7 @@ namespace NzbDrone.Common.Instrumentation.Sentry sentryEvent.Tags.Add("os_name", osName); sentryEvent.Tags.Add("os_version", $"{osName} {osVersion}"); - sentryEvent.Tags.Add("runtime_version", $"{PlatformInfo.Platform} {runTimeVersion}"); + sentryEvent.Tags.Add("runtime_version", $"{PlatformInfo.PlatformName} {runTimeVersion}"); _client.Capture(sentryEvent); }