Skip to content

Commit

Permalink
report Mono runtime version
Browse files Browse the repository at this point in the history
  • Loading branch information
fandrei committed Jun 28, 2013
1 parent bd329e7 commit 7fd6f45
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions AppMetrics.Client/Tracker.cs
Expand Up @@ -3,6 +3,7 @@
using System.Diagnostics;
using System.Globalization;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading;

Expand Down Expand Up @@ -309,6 +310,10 @@ void ReportSystemInfo()

Log("System_ClrVersion", Environment.Version.ToString());

if (IsUnderMono)
{
Log("System_MonoRuntimeVersion", GetMonoRuntimeVersion());
}

if (!IsUnderMono)
{
Expand Down Expand Up @@ -420,6 +425,18 @@ static bool IsUnderMono
}
}

static string GetMonoRuntimeVersion()
{
var type = Type.GetType("Mono.Runtime");
if (type != null)
{
MethodInfo displayName = type.GetMethod("GetDisplayName", BindingFlags.NonPublic | BindingFlags.Static);
if (displayName != null)
return (string)(displayName.Invoke(null, null));
}
return "";
}

public string Url { get; private set; }
public string ApplicationKey { get; private set; }
public string SessionId { get; private set; }
Expand Down

0 comments on commit 7fd6f45

Please sign in to comment.