private DependencyTableStore()
 {
     this.WebRequestCacheHolder       = new CacheBasedOperationHolder("aisdkwebrequests", 100 * 1000);
     this.SqlRequestCacheHolder       = new CacheBasedOperationHolder("aisdksqlrequests", 100 * 1000);
     this.WebRequestConditionalHolder = new ObjectInstanceBasedOperationHolder <DependencyTelemetry>();
     this.SqlRequestConditionalHolder = new ObjectInstanceBasedOperationHolder <DependencyTelemetry>();
 }
        private DependencyTableStore()
        {
#if !NET40
            this.WebRequestCacheHolder = new CacheBasedOperationHolder();
            this.SqlRequestCacheHolder = new CacheBasedOperationHolder();
#endif
            this.WebRequestConditionalHolder = new ObjectInstanceBasedOperationHolder();
            this.SqlRequestConditionalHolder = new ObjectInstanceBasedOperationHolder();
        }
Example #3
0
        internal DesktopDiagnosticSourceHttpProcessing(TelemetryConfiguration configuration, CacheBasedOperationHolder telemetryTupleHolder, bool setCorrelationHeaders, ICollection <string> correlationDomainExclusionList, bool injectLegacyHeaders, bool enableW3CHeaders)
            : base(configuration, SdkVersionUtils.GetSdkVersion("rdd" + RddSource.DiagnosticSourceDesktop + ":"), null, setCorrelationHeaders, correlationDomainExclusionList, injectLegacyHeaders, enableW3CHeaders)
        {
            if (telemetryTupleHolder == null)
            {
                throw new ArgumentNullException("telemetryTupleHolder");
            }

            this.telemetryTable = telemetryTupleHolder;
        }
Example #4
0
        internal FrameworkHttpProcessing(TelemetryConfiguration configuration, CacheBasedOperationHolder telemetryTupleHolder, bool setCorrelationHeaders, ICollection <string> correlationDomainExclusionList, bool injectLegacyHeaders)
            : base(configuration, SdkVersionUtils.GetSdkVersion("rdd" + RddSource.Framework + ":"), null, setCorrelationHeaders, correlationDomainExclusionList, injectLegacyHeaders, false)
        {
            if (telemetryTupleHolder == null)
            {
                throw new ArgumentNullException("telemetryTupleHolder");
            }

            this.applicationInsightsUrlFilter = new ApplicationInsightsUrlFilter(configuration);
            this.TelemetryTable = telemetryTupleHolder;
        }
Example #5
0
        public void TestItemExpiration()
        {
            long id = 911911;

            using (var cacheInstance = new CacheBasedOperationHolder("testcache", 100))
            {
                cacheInstance.Store(id, this.telemetryTuple);
                Assert.AreEqual(this.telemetryTuple, cacheInstance.Get(id));

                // Sleep for 1 secs which is more than the cache expiration time of 100 set above.
                Thread.Sleep(1000);
                var value = cacheInstance.Get(id);
                Assert.IsNull(value, "item must be expired and removed from the cache");
            }
        }
Example #6
0
        /// <summary>
        /// Initializes a new instance of the <see cref="FrameworkSqlProcessing"/> class.
        /// </summary>
        internal FrameworkSqlProcessing(TelemetryConfiguration configuration, CacheBasedOperationHolder telemetryTupleHolder)
        {
            if (configuration == null)
            {
                throw new ArgumentNullException(nameof(configuration));
            }

            this.TelemetryTable  = telemetryTupleHolder ?? throw new ArgumentNullException(nameof(telemetryTupleHolder));
            this.telemetryClient = new TelemetryClient(configuration);

            // Since dependencySource is no longer set, sdk version is prepended with information which can identify whether RDD was collected by profiler/framework

            // For directly using TrackDependency(), version will be simply what is set by core
            string prefix = "rdd" + RddSource.Framework + ":";

            this.telemetryClient.Context.GetInternalContext().SdkVersion = SdkVersionUtils.GetSdkVersion(prefix);
        }
Example #7
0
        /// <summary>
        /// Initializes a new instance of the <see cref="FrameworkSqlProcessing"/> class.
        /// </summary>
        internal FrameworkSqlProcessing(TelemetryConfiguration configuration, CacheBasedOperationHolder telemetryTupleHolder)
        {
            if (configuration == null)
            {
                throw new ArgumentNullException("configuration");
            }

            if (telemetryTupleHolder == null)
            {
                throw new ArgumentNullException("telemetryHolder");
            }

            this.TelemetryTable  = telemetryTupleHolder;
            this.telemetryClient = new TelemetryClient(configuration);

            // Since dependencySource is no longer set, sdk version is prepended with information which can identify whether RDD was collected by profiler/framework

            // For directly using TrackDependency(), version will be simply what is set by core
            this.telemetryClient.Context.GetInternalContext().SdkVersion = string.Format(CultureInfo.InvariantCulture, "rdd{0}: {1}", RddSource.Framework, SdkVersionUtils.GetAssemblyVersion());
        }
Example #8
0
 public void TestInitialize()
 {
     this.telemetryTuple            = new Tuple <DependencyTelemetry, bool>(new DependencyTelemetry(), true);
     this.cacheBasedOperationHolder = new CacheBasedOperationHolder("testcache", 100);
 }
 internal FrameworkSqlEventListener(TelemetryConfiguration configuration, CacheBasedOperationHolder telemetryTupleHolder)
 {
     this.SqlProcessingFramework = new FrameworkSqlProcessing(configuration, telemetryTupleHolder);
 }
 internal FrameworkSqlEventListener(TelemetryConfiguration configuration, CacheBasedOperationHolder telemetryTupleHolder, bool collectCommandText)
 {
     this.SqlProcessingFramework = new FrameworkSqlProcessing(configuration, telemetryTupleHolder);
     this.collectCommandText     = collectCommandText;
 }