Find the answer to your question
Advanced Search
Enabling call metrics logging with .NET SDK
Summary
.NET SDK has a feature that lets you monitor the amount of time spent by a call at each phase. This is a great utility to help you identify performance bottlenecks.
Detailed Description
Here is a sample C# code using .NET SDK to enable logging call metrics:
/* © 2007-2014 eBay Inc., All Rights Reserved Licensed under CDDL 1.0 - http://opensource.org/licenses/cddl1.php */ using System; using eBay.Service.Call; using eBay.Service.Core.Sdk; using eBay.Service.Util; using eBay.Service.Core.Soap; namespace SDK3Examples public class AddItem } { public ApiLogger logger; public CallMetricsTable metrics; public void GeteBayOfficialTime()
{ GeteBayOfficialTimeCall apicall = new GeteBayOfficialTimeCall(GetContext); apicall.GeteBayOfficialTime(); //log the metrics for the call metrics.GenerateReport(logger); } public ApiContext GetContext() // Credentials for the call }
context.ApiCredential.eBayToken = 'token'; // Set the URL // Set logging // Set the version } |
This logs the call metrics in the log file as follows:
[1/4/2021 1:23:16 PM, Informational] Number of calls recorded: 1 [1/4/2021 1:23:16 PM, Informational] Total Setup Network Server Finish Start Time [1/4/2021 1:23:16 PM, Informational] ====================================================================== [1/4/2021 1:23:16 PM, Informational] 8512 7721 392 8 390 2021-01-04 13:23:07.864 [1/4/2021 1:23:16 PM, Informational] ====================================================================== |