Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6696619
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:21:46+00:00 2026-05-26T06:21:46+00:00

I have a load test for a WCF service, where we are trying out

  • 0

I have a load test for a WCF service, where we are trying out different compression libraries and configurations and we need to measure the total number of mb sent during a test. Is there a performance counter that measure the relative trafic pr. test. If so, how do I add it to my load test – it seems that only a fraction of the performance counters are visible – E.g. under the category “Web Service”, i don’t see the performance counter “Total Bytes Received” in VS Load test, but I can find it in PerfMon.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T06:21:47+00:00Added an answer on May 26, 2026 at 6:21 am

    In the load test expand Counter Sets > Expand applicable > Right Click on Counter Sets > Add Counters

    You can implement your own custom performance counter like so:

    using System;
    using System.Diagnostics;
    using System.Net.NetworkInformation;
    
    namespace PerfCounter
    {
    class PerfCounter
    {
        private const String categoryName = "Custom category";
        private const String counterName = "Total bytes received";
        private const String categoryHelp = "A category for custom performance counters";
        private const String counterHelp = "Total bytes received on network interface";
        private const String lanName = "Local Area Connection"; // change this to match your network connection
        private  const int sampleRateInMillis = 1000;
        private const int numberofSamples = 200000;
    
        private static NetworkInterface lan = null;
        private static PerformanceCounter perfCounter;
        private static long initialReceivedBytes;
    
        static void Main(string[] args)
        {
            setupLAN();
            setupCategory();
            createCounters();
            updatePerfCounters();
        }
    
        private static void setupCategory()
        {
            if (!PerformanceCounterCategory.Exists(categoryName))
            {
                CounterCreationDataCollection counterCreationDataCollection = new CounterCreationDataCollection();
                CounterCreationData totalBytesReceived = new CounterCreationData();
                totalBytesReceived.CounterType = PerformanceCounterType.NumberOfItems64;
                totalBytesReceived.CounterName = counterName;
                counterCreationDataCollection.Add(totalBytesReceived);
                PerformanceCounterCategory.Create(categoryName, categoryHelp, PerformanceCounterCategoryType.MultiInstance, counterCreationDataCollection);
            }
            else
                Console.WriteLine("Category {0} exists", categoryName);
        }
    
        private static void createCounters()
        {
            perfCounter = new PerformanceCounter(categoryName, counterName, false);
            perfCounter.RawValue = getTotalBytesReceived();
        }
    
        private static long getTotalBytesReceived()
        {
            return lan.GetIPv4Statistics().BytesReceived;
        }
    
        private static void setupLAN()
        {
            NetworkInterface[] interfaces = NetworkInterface.GetAllNetworkInterfaces();
            foreach (NetworkInterface networkInterface in interfaces)
            {
                if (networkInterface.Name.Equals(lanName))
                    lan = networkInterface;
            }
            initialReceivedBytes = lan.GetIPv4Statistics().BytesReceived;
        }
    
        private static void updatePerfCounters()
        {
            for (int i = 0; i < numberofSamples; i++)
            {
                perfCounter.RawValue = getTotalBytesReceived();
                Console.WriteLine("received: {0} bytes", perfCounter.RawValue - initialReceivedBytes);
                System.Threading.Thread.Sleep(sampleRateInMillis);
            }
        }
    }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a web service I'm trying to load test. I created a program
I need to load test a service I've developed but I need the data
I have a server component that I'm trying to load-test. All connections to the
For an application, I need to do a load test for a web service
I have a web service that I would like to load test by sending
I am trying to use the WCF Test Client to test a WCF service
I have a simple load test that is using one TestMethod on a quad
I have been asked to check how to load test a flex application. I've
I am newbie to Visual Studio 2010 test suite. I have created a load
I have been looking for a tool to load test my django application. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.