diff --git a/Libraries/DeskMetrics/DeskMetrics.XML b/Libraries/DeskMetrics/DeskMetrics.XML index 43fcb8222..57410ddbb 100644 --- a/Libraries/DeskMetrics/DeskMetrics.XML +++ b/Libraries/DeskMetrics/DeskMetrics.XML @@ -19,61 +19,6 @@ GetProcessorFrequency Screen resolution GetComponentName - - - Field OS Service Pack - - - - - GetProcessorFrequency Framework ApplicationVersion GetComponentName - - - - - GetProcessorFrequency OS Archicteture GetComponentName - - - - - GetProcessorFrequency OS ApplicationVersion GetComponentName - - - - - GetProcessorFrequency Java version GetComponentName - - - - - GetProcessorFrequency and Set Framework ApplicationVersion - - - - - GetProcessorFrequency and Set OS Archicteture - - - - - GetProcessorFrequency and Set OS ApplicationVersion - - - - - GetProcessorFrequency and Set Frameworl Service Pack - - - - - GetProcessorFrequency and Set Java ApplicationVersion - - - - - GetProcessorFrequency and Set OS Service Pack - - Starts the application tracking. @@ -159,6 +104,61 @@ The log message + + + Field OS Service Pack + + + + + GetProcessorFrequency Framework ApplicationVersion GetComponentName + + + + + GetProcessorFrequency OS Archicteture GetComponentName + + + + + GetProcessorFrequency OS ApplicationVersion GetComponentName + + + + + GetProcessorFrequency Java version GetComponentName + + + + + GetProcessorFrequency and Set Framework ApplicationVersion + + + + + GetProcessorFrequency and Set OS Archicteture + + + + + GetProcessorFrequency and Set OS ApplicationVersion + + + + + GetProcessorFrequency and Set Frameworl Service Pack + + + + + GetProcessorFrequency and Set Java ApplicationVersion + + + + + GetProcessorFrequency and Set OS Service Pack + + Starts the application tracking. @@ -244,5 +244,35 @@ The log message + + + Indicates if the Start() has been called and a session is active. + + + + + Currently active session. will be null if no sessions are active. + + + + + DeskmMtrics Application ID + + + + + Version of application being tracked. + + + + + Checks if application events are tracked. + + + + + Anonymous identifier of the user being tracked. + + diff --git a/Libraries/DeskMetrics/DeskMetrics.dll b/Libraries/DeskMetrics/DeskMetrics.dll index 65423299d..e870399bb 100644 Binary files a/Libraries/DeskMetrics/DeskMetrics.dll and b/Libraries/DeskMetrics/DeskMetrics.dll differ diff --git a/Libraries/DeskMetrics/DeskMetrics.pdb b/Libraries/DeskMetrics/DeskMetrics.pdb index 9c9453dde..4d451b897 100644 Binary files a/Libraries/DeskMetrics/DeskMetrics.pdb and b/Libraries/DeskMetrics/DeskMetrics.pdb differ diff --git a/NzbDrone.Core/CentralDispatch.cs b/NzbDrone.Core/CentralDispatch.cs index a6a6d0142..04779a7b3 100644 --- a/NzbDrone.Core/CentralDispatch.cs +++ b/NzbDrone.Core/CentralDispatch.cs @@ -20,11 +20,14 @@ namespace NzbDrone.Core public class CentralDispatch { private static readonly Logger Logger = LogManager.GetCurrentClassLogger(); + private readonly EnviromentProvider _enviromentProvider; public StandardKernel Kernel { get; private set; } public CentralDispatch() { + _enviromentProvider = new EnviromentProvider(); + Logger.Debug("Initializing Kernel:"); Kernel = new StandardKernel(); @@ -42,7 +45,7 @@ namespace NzbDrone.Core { Logger.Info("Initializing Database..."); - var appDataPath = new EnviromentProvider().GetAppDataPath(); + var appDataPath = _enviromentProvider.GetAppDataPath(); if (!Directory.Exists(appDataPath)) Directory.CreateDirectory(appDataPath); var connection = Kernel.Get(); @@ -57,7 +60,7 @@ namespace NzbDrone.Core private void InitAnalytics() { - var deskMetricsClient = new DeskMetricsClient(Kernel.Get().UGuid, AnalyticsProvider.DESKMETRICS_ID, new EnviromentProvider().Version); + var deskMetricsClient = new DeskMetricsClient(Kernel.Get().UGuid, AnalyticsProvider.DESKMETRICS_ID, _enviromentProvider.Version); Kernel.Bind().ToConstant(deskMetricsClient); Kernel.Get().Checkpoint(); } @@ -107,6 +110,7 @@ namespace NzbDrone.Core Kernel.Bind().To().InSingletonScope(); Kernel.Bind().To().InSingletonScope(); Kernel.Bind().To().InSingletonScope(); + Kernel.Bind().To().InSingletonScope(); Kernel.Get().Initialize(); Kernel.Get().StartTimer(30); @@ -129,7 +133,7 @@ namespace NzbDrone.Core { try { - var pid = new EnviromentProvider().NzbDroneProcessIdFromEnviroment; + var pid = _enviromentProvider.NzbDroneProcessIdFromEnviroment; Logger.Debug("Attaching to parent process ({0}) for automatic termination.", pid); diff --git a/NzbDrone.Core/Jobs/CheckpointJob.cs b/NzbDrone.Core/Jobs/CheckpointJob.cs new file mode 100644 index 000000000..b5ca4082c --- /dev/null +++ b/NzbDrone.Core/Jobs/CheckpointJob.cs @@ -0,0 +1,39 @@ +using System; +using System.Linq; +using Ninject; +using NzbDrone.Core.Model.Notification; +using NzbDrone.Core.Providers; + +namespace NzbDrone.Core.Jobs +{ + public class CheckpointJob : IJob + { + private readonly AnalyticsProvider _analyticsProvider; + + [Inject] + public CheckpointJob(AnalyticsProvider analyticsProvider) + { + _analyticsProvider = analyticsProvider; + } + + public CheckpointJob() + { + + } + + public string Name + { + get { return "Checkpoint Job"; } + } + + public TimeSpan DefaultInterval + { + get { return TimeSpan.FromDays(1); } + } + + public void Start(ProgressNotification notification, int targetId, int secondaryTargetId) + { + _analyticsProvider.Checkpoint(); + } + } +} \ No newline at end of file diff --git a/NzbDrone.Core/NzbDrone.Core.csproj b/NzbDrone.Core/NzbDrone.Core.csproj index 947b5fb1c..a88c0925a 100644 --- a/NzbDrone.Core/NzbDrone.Core.csproj +++ b/NzbDrone.Core/NzbDrone.Core.csproj @@ -226,6 +226,7 @@ + diff --git a/NzbDrone.Core/Providers/AnalyticsProvider.cs b/NzbDrone.Core/Providers/AnalyticsProvider.cs index cac031e81..face22241 100644 --- a/NzbDrone.Core/Providers/AnalyticsProvider.cs +++ b/NzbDrone.Core/Providers/AnalyticsProvider.cs @@ -23,16 +23,16 @@ namespace NzbDrone.Core.Providers public virtual void Checkpoint() { - if (_deskMetricsClient.Started) - { - _deskMetricsClient.Stop(); - } - if (EnviromentProvider.IsNewInstall) { _deskMetricsClient.RegisterInstall(); } + if (_deskMetricsClient.Started) + { + _deskMetricsClient.Stop(); + } + _deskMetricsClient.Start(); } } diff --git a/NzbDrone.Web/Content/2011.3.1115/telerik.metro.min.css b/NzbDrone.Web/Content/2011.3.1115/telerik.metro.min.css index a4f69f630..1eae27886 100644 --- a/NzbDrone.Web/Content/2011.3.1115/telerik.metro.min.css +++ b/NzbDrone.Web/Content/2011.3.1115/telerik.metro.min.css @@ -92,4 +92,4 @@ .t-window-actions .t-state-hover,.t-editor-button .t-state-hover{border-color:#fff;background-color:transparent} .t-editor-button .t-state-active{border-color:#fff;background-color:#57b5df} /*rounded corners and shadows*/.t-button,div.t-window,.t-window-titlebar,div.t-window-content,.t-window-titlebar .t-state-hover,.t-tabstrip-items .t-item,.t-panelbar .t-tabstrip-items .t-item,.t-pager .t-state-active,.t-pager .t-state-hover,.t-grid .t-filter-options,.t-grouping-header .t-group-indicator,.t-treeview .t-state-hover,.t-treeview .t-state-selected,.t-colorpicker .t-selected-color,.t-editor-button .t-state-hover,.t-editor-button .t-state-active,.t-drag-clue,.t-tooltip,.t-dropzone,.t-upload-files,.t-progress,.t-progress-status,.t-tile{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0} -.t-popup,.t-menu .t-group,div.t-window,.t-imagebrowser .t-image{-moz-box-shadow:0;-webkit-box-shadow:0;box-shadow:0} \ No newline at end of file +.t-popup,.t-menu .t-group,div.t-window,.t-imagebrowser .t-image{-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none} \ No newline at end of file