For full functionality of this site it is necessary to enable JavaScript.
Here are the instructions how to enable JavaScript in your web browser.

Knowledge base

Find the answer to your question

Advanced Search PView

Search terms
Search Type
Sort by

Enabling call metrics logging with .NET SDK version 485

  • Answer ID 862
  • Published 08/19/2014 09:31 AM
  • Updated 08/19/2014 09:31 AM
  • Permalink
Enabling call metrics logging with .NET SDK version 485

Enabling call metrics logging with .NET SDK version 485


.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. 

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 -

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);
  //log the metrics for the call


    public ApiContext GetContext()
       ApiContext context = new ApiContext();

  // 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
  context.SoapApiServerUrl = ''; 

  // Set logging
  context.ApiLogManager = newApiLogManager();
  context.ApiLogManager.ApiLoggerList.Add(new eBay.Service.Util.FileLogger('Messages.log', true, true, true));
  context.ApiLogManager.EnableLogging = true;
  logger = context.ApiLogManager.ApiLoggerList[0];

  // Set the version
  context.Version = '485';

 // Enable Call Metrics logging
 metrics = new CallMetricsTable();
 context.CallMetricsTable = metrics;
 context.EnableMetrics = true;





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

Additional Resources

How well did this answer your question?

Answers others found helpful

Print Email This Page Delicious Digg Facebook Reddit StumbleUpon Twitter