Home
Find the answer to your question
Enabling call metrics logging with .NET SDK version 485
Enabling call metrics logging with .NET SDK version 485
Summary
.NET SDK version 485 has a new 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.
/* © 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.ApiAccount.Developer = 'devID'; context.ApiCredential.ApiAccount.Application = 'appID'; context.ApiCredential.ApiAccount.Certificate = 'certID'; 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/2007 1:23:16 PM, Informational] Number of calls recorded: 1 [1/4/2007 1:23:16 PM, Informational] Total Setup Network Server Finish Start Time [1/4/2007 1:23:16 PM, Informational] ====================================================================== [1/4/2007 1:23:16 PM, Informational] 8512 7721 392 8 390 2007-01-04 13:23:07.864 [1/4/2007 1:23:16 PM, Informational] ====================================================================== |
Version Info
The code example above was based on the versions specified below:
API Schema Version | 485 |
.NET SDK Version | .NET SDK v485.0 full release |