public bool IsInteresting(DataItemConfiguration configuration = null)
        {
            if (configuration == null)
            {
                return(true);
            }
            if (!configuration.Enabled)
            {
                return(false);
            }

            if (!configuration.Time.Enabled || ElapsedMilliseconds.GetValueOrDefault(-1) < configuration.Time.MinimumMilliseconds)
            {
                ElapsedMilliseconds = null;
            }

            if (!configuration.Size.Enabled || DataSize.GetValueOrDefault(-1) < configuration.Size.MinimumBytes)
            {
                DataSize = null;
            }

            if (configuration.Database == null || NHStatistics?.IsInteresting(configuration.Database) != true)
            {
                NHStatistics = null;
            }

            var isInteresting =
                (
                    ElapsedMilliseconds.HasValue || DataSize.HasValue || NHStatistics != null
                );

            return(isInteresting);
        }
        public bool IsInteresting(ActionConfiguration configuration = null)
        {
            if (configuration == null)
            {
                return(true);
            }
            if (!configuration.Enabled)
            {
                return(false);
            }

            if (UsageStatistics?.IsInteresting(configuration) == false)
            {
                UsageStatistics = null;
            }
            if (NHStatistics?.IsInteresting(configuration.Database) == false)
            {
                NHStatistics = null;
            }

            return(UsageStatistics?.IsInteresting(configuration) == true || NHStatistics?.IsInteresting(configuration.Database) == true);
        }
 public ActionStatistics()
 {
     UsageStatistics = new UsageStatistics();
     NHStatistics    = new NHStatistics();
 }