Forum Discussion

Tal_BenHaim_112's avatar
Tal_BenHaim_112
Icon for Nimbostratus rankNimbostratus
Dec 04, 2006

throughput rate

Hi,

 

 

How can I retreive statistics of the exact number of BPS

 

going through the interface connected to the ISP.

 

(I want to make a cross reference between the information I receive from that interface and the information collected from the POOLS.)

 

 

Thanks,

 

Tal

9 Replies

  • Rates are going to have to be calculated by your calling application. All of the statistics interfaces (in the case of pools it's with the LocalLB::Pool::get_statistics() method) are returned as either counters our totals. To turn counters into rates (ie, bps), you need to take a sample of two points and divide by the interval between the two (c2 - c1)/(t2 - t1). BTW, we've included the timestamp the data was sampled on in the returned statistics data structure.

     

     

    We do store some rate data in our performance counters and that data is available in csv format. This data is what is behind the performance graphs in the GUI. This isn't customizable and is total throughput across all of the virtuals which is probably not granular enough for what you are looking for. Take a look at the "Overview.Performance" menu item in the GUI for the graphs of that data. The methods for retrieving this CSV data is in the System::Statistics interface.

     

     

    Hope this helps...

     

     

    -Joe
  • Hi Joe,

     

     

    Could you provide us with more information of what we actually sea in the graphs. also, how come we sea a rate 60MBPs on the graph while the maximum capacity of our telecom lines is 30MBPs ?

     

     

    I already calculated the BPS on each POOL and it seems to work find.

     

    now I want to make a cross reference between the total BPS collected from the POOLS and total BPS collected from the interface to the ISP (F5 entry point).

     

     

    Does the function 'get_statistics' under Networking interfaces

     

    retreive this data?

     

     

    InterfaceStatistics get_statistics(

     

    in String[] interfaces

     

    );

     

     

    Thanks,

     

    Tal
  • Hello Joe,

     

     

    I followed your instructions and wrote an applictaion

     

    that calcultes the POOLS BPS snapshots ( (c2 - c1)/(t2 - t1) )

     

     

    I ran it and discovered that both the sample code (Distribution Monitor --> Monitor Traffic link)and my code get negative figures in some instances.

     

     

    why?

     

     

    Thanks,

     

    Tal

     

     

  • Hello Aaron,

     

     

    I wrote an application based on the sample code

     

    (DistributionMonitor) and added a form that represents

     

    throughput statistics for each customer using iControl

     

    (a customer can have more than one POOL).

     

    The table represents the snapshots of BPS and save them to a Data-Base (at the end of each day the application will save the maximal BPS for each Customer).

     

     

    (we need these statistics because we want to shape the traffic rates on the virtuals.)

     

     

    I have a few problems with the results I get.

     

    sometimes I see negative figures.

     

    I see negative values also when I run the sample code DistributionMonitor and link Monitor traffic for a specific pool ('Total Traffic' graph).

     

     

    the total BPS I collect from all POOLS seems to be lower than

     

    I expect.

     

     

    Therefore I want to retreive statistics of the exact number of BPS going through the interface connected to the ISP,

     

    to make a cross reference between the information I receive from that interface and the information collected from the POOLS.

     

    I need to be able to calculate snapshots of BPS.

     

    (in the same manner i calculted the POOLS BPS snapshots).

     

    can i retreive this using the sdk function

     

    'get_statistics' (under Networking.Interfaces) ?

     

     

    Can I retreive also pool statistics using SNMP?

     

    (soon I will go over the links you send me...)

     

     

     

    Thanks,

     

    Tal

     

     

     

     

  • Most likely your code (as well as the Distribution Monitor sample) are not correctly converting the UInt64 Structure to a valid 64 bit number. Odds are something is getting truncated there.

     

    Take a look at this thread for details on how to correctly convert the 64 bit number (assuming you are using VS.NET). Java, as far as I know doesn't support 64 bit numbers. If anyone knows a solution for supporting 64 bit values in Java, please let me know...

     

    http://devcentral.f5.com/Default.aspx?tabid=53&view=topic&forumid=1&postid=11286

     

    Click here

     

    -Joe
  • The Networking::Interfaces::get_statistics() will return the cumulative statistics for the requested interface (or interfaces).

     

     

    -Joe
  • Hi Joe,

     

     

    I read your solution for translating the Commom.ULong64 into

     

    .NET UInt64 type.

     

     

    but I don't understand what is wrong with the DistributionMonitor sample code.

     

    below is the code that retreives the requested statistic.

     

     

    public long findStatisticType(PoolMember.CommonStatistic[] stat_list, PoolMember.CommonStatisticType stat_type)

     

    {

     

    //The DataGrid does not support 64 bit integers

     

    // so this is cast to the lower 32 bits

     

     

    long value = 0;

     

    for(int i=0; i {

     

    if ( stat_type == stat_list[ i ].type )

     

    {

     

    value = stat_list[ i ].value.low;

     

    }

     

    }

     

    return value;

     

    }

     

     

    what is wrong with this code?

     

    how would you correct it?

     

     

    Thanks,

     

    Tal
  • That brings back memories...

     

     

    The Windows data grid that the DistributionMonitor code uses doesn't support 64 bit numbers which is what the is needed for high throughput situations. I made this consolation when I made the app but I guess I should have commented more thoroughly on the implications of only using the lower 32 bits of the statistics values.

     

     

    This code is only making use of the low 32bits of the 64bit Common::ULong64 structure returned. The reason you are getting negative numbers is that the low 32bits is getting flipped as the high 32bits is incremented (when you go over the 32 bit boundary the lower 32 bit number starts back at zero).

     

     

    The correct way to extract the values would be to use that method I pointed you to to get the correct value

     

     

    UInt64 build64(iControl.CommonULong64 ul64)
    {
      return ((UInt64)(UInt32)ul64.high) << 32 | ((UInt64)(UInt32)ul64.low);
    }
    public UInt64 findStatisticType(PoolMember.CommonStatistic[] stat_list,
       PoolMember.CommonStatisticType stat_type)
    {
      //The DataGrid does not support 64 bit integers
      // so this is cast to the lower 32 bits
      UInt64 value = 0;
      for(int i=0; i  {
        if ( stat_type == stat_list[ i ].type )
        {
          value = build64(stat_list[ i ].value);
        }
      }
      return value;
    }

     

     

    Don't go applying this to the distribution monitor example as the windows datagrid won't support the 64 bit numbers.

     

     

    -Joe
  •  

    Hi,

     

     

    Is there a way to retreive statistics of the exact number of BPS going through the interface connected to the ISP?