C# TelemetryClient.TrackTrace方法代码示例(c#telemetryclient.tracktrace使用的例子)

本文整理汇总了C#中Microsoft.ApplicationInsights.TelemetryClient.TrackTrace方法的典型用法代码示例。如果您正苦于以下问题:C# TelemetryClient.TrackTrace方法的具体用法?C# TelemetryClient.TrackTrace怎么用?C# TelemetryClient.TrackTrace使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Microsoft.ApplicationInsights.TelemetryClient的用法示例。


C# TelemetryClient.TrackTrace方法代码示例(c#telemetryclient.tracktrace使用的例子)

在下文中一共展示了TelemetryClient.TrackTrace方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Index

 public ActionResult Index()
        {
            var tc = new TelemetryClient();
            tc.TrackTrace("I made it to the home page", SeverityLevel.Error);

            return View();
        }
开发者ID:skalpin,项目名称:appinsightsdemo,代码行数:7,代码来源:HomeController.cs

示例2: Get

 // GET api/values/5
        public string Get(int id)
        {
            var client = new TelemetryClient();
            client.TrackTrace("trace");

            return "value";
        }
开发者ID:SergeyKanzhelev,项目名称:BO,代码行数:8,代码来源:ValuesController.cs

示例3: Index

 public ActionResult Index()
        {
            ViewBag.Title = "Home Page";

            var client = new TelemetryClient();
            client.TrackTrace("trace");

            return View();
        }
开发者ID:SergeyKanzhelev,项目名称:BO,代码行数:9,代码来源:HomeController.cs

示例4: UpdateSettings

 public async Task UpdateSettings(string trainArguments = null, float? initialExplorationEpsilon = null, bool? isExplorationEnabled = null)
        {
            var token = Request.Headers["Authorization"];
            if (token != ConfigurationManager.AppSettings[ApplicationMetadataStore.AKPassword])
                throw new UnauthorizedAccessException();

            var telemetry = new TelemetryClient();
            try
            {
                telemetry.TrackTrace($"UpdateSettings(trainArguments={trainArguments}, initialExplorationEpsilon={initialExplorationEpsilon}, isExplorationEnabled={isExplorationEnabled})");

                string azureStorageConnectionString = ConfigurationManager.AppSettings[ApplicationMetadataStore.AKConnectionString];
                var storageAccount = CloudStorageAccount.Parse(azureStorageConnectionString);
                var blobClient = storageAccount.CreateCloudBlobClient();
                var settingsBlobContainer = blobClient.GetContainerReference(ApplicationBlobConstants.SettingsContainerName);

                var blob = settingsBlobContainer.GetBlockBlobReference(ApplicationBlobConstants.LatestClientSettingsBlobName);
                ApplicationClientMetadata clientMeta;
                if (await blob.ExistsAsync())
                    clientMeta = JsonConvert.DeserializeObject<ApplicationClientMetadata>(await blob.DownloadTextAsync());
                else
                    clientMeta = new ApplicationClientMetadata();

                if (trainArguments != null)
                    clientMeta.TrainArguments = trainArguments;

                if (initialExplorationEpsilon != null)
                    clientMeta.InitialExplorationEpsilon = (float)initialExplorationEpsilon;

                if (isExplorationEnabled != null)
                    clientMeta.IsExplorationEnabled = (bool)isExplorationEnabled;

                await blob.UploadTextAsync(JsonConvert.SerializeObject(clientMeta));
            }
            catch (Exception e)
            {
                telemetry.TrackException(e);
            }
        }
开发者ID:GalOshri,项目名称:mwt-ds-management-center,代码行数:39,代码来源:AutomationController.cs

示例5: Main

 static void Main(string[] args)
        {
            if (args.Length == 1)
            {
                TelemetryClient client = new TelemetryClient(TelemetryConfiguration.Active);
                client.TrackTrace("One trace is sent to make sure that SDK is initialized.");

                string param = args[0];

                switch (param)
                {
                    case "unhandled" :
                        GenerateUnhandledException();
                        break;
                    case "unobserved" :
                        GenerateUnobservedException(client);
                        break;
                }
            }
            else
                throw new ArgumentException("One parameter is required");
        }
开发者ID:gregjhogan,项目名称:ApplicationInsights-server-dotnet,代码行数:22,代码来源:Program.cs

示例6: ReportLog

 /// <summary>
 /// Reports a log event to telemetry.
 /// </summary>
 /// <param name="eventName"></param>
 /// <param name="metric"></param>
 public void ReportLog(object component, string message, SeverityLevel level = SeverityLevel.Information)
 {
     TelemetryClient client = new TelemetryClient();
     client.TrackTrace($"[{component.GetType().Name}] {message}", level);
 }
开发者ID:Arthur-Lee,项目名称:Baconit,代码行数:10,代码来源:TelemetryManager.cs

示例7: TrackWhenChannelIsNullWillThrowInvalidOperationException

 public void TrackWhenChannelIsNullWillThrowInvalidOperationException()
        {
            var config = new TelemetryConfiguration();
            config.InstrumentationKey = "Foo";
            var client = new TelemetryClient(config);

            Assert.Throws<InvalidOperationException>(() => client.TrackTrace("test trace"));
        }
开发者ID:ZeoAlliance,项目名称:ApplicationInsights-dotnet,代码行数:8,代码来源:TelemetryClientTest.cs

示例8: TrackUsesInstrumentationKeyFromConfigurationWhenTheInstrumenationKeyIsEmpty

 public void TrackUsesInstrumentationKeyFromConfigurationWhenTheInstrumenationKeyIsEmpty()
        {
            ITelemetry sentTelemetry = null;
            var channel = new StubTelemetryChannel { OnSend = telemetry => sentTelemetry = telemetry };
            var configuration = new TelemetryConfiguration { TelemetryChannel = channel };
            var client = new TelemetryClient(configuration);
            var observe = client.Context.InstrumentationKey;

            string expectedKey = Guid.NewGuid().ToString();
            configuration.InstrumentationKey = expectedKey;
            Assert.DoesNotThrow(() => client.TrackTrace("Test Message"));

            Assert.Equal(expectedKey, sentTelemetry.Context.InstrumentationKey);
        }
开发者ID:ZeoAlliance,项目名称:ApplicationInsights-dotnet,代码行数:14,代码来源:TelemetryClientTest.cs

示例9: TrackDoesNotInitializeInstrumentationKeyWhenItWasSetExplicitly

 public void TrackDoesNotInitializeInstrumentationKeyWhenItWasSetExplicitly()
        {
            var configuration = new TelemetryConfiguration { TelemetryChannel = new StubTelemetryChannel(), InstrumentationKey = Guid.NewGuid().ToString() };
            var client = new TelemetryClient(configuration);

            var expectedKey = Guid.NewGuid().ToString();
            client.Context.InstrumentationKey = expectedKey;
            client.TrackTrace("Test Message");

            Assert.Equal(expectedKey, client.Context.InstrumentationKey);
        }
开发者ID:ZeoAlliance,项目名称:ApplicationInsights-dotnet,代码行数:11,代码来源:TelemetryClientTest.cs

本文标签属性:

示例:示例英文

代码:代码转换器

TelemetryClient:TelemetryClient

TrackTrace:tracktrace国际货运单号查询系统

上一篇:锁锁是什么电视剧?(《流金岁月》中锁锁的结局是什么样的?)(《流金岁月》中锁锁的结局是什么样的?)
下一篇:C# HtmlNode.ChildNodesRecursive方法代码示例(c#htmlnode.childnode.childnode.childnodesrecursive怎么用)

为您推荐