How to get ip sla average rtt by snmp

The router config is:
ip sla 2700
udp-jitter 10.1.2.3 16400 source-ip 10.3.2.1
tos 64
vrf cust1
frequency 300
The output of sh ip sla stat 2700 includes:
RTT Values:
    Number Of RTT: 10        RTT Min/Avg/Max: 3/3/6 milliseconds
We need to get the average rtt value via snmp but the mib seems to only contain the min and max value in rttMonLatestJitterOperRTTMin and rttMonLatestJitterOperRTTMax.
Is there a way to get the average value too which can't be calculated without knowing the rtts of every single packet?

The router config is:
ip sla 2700
udp-jitter 10.1.2.3 16400 source-ip 10.3.2.1
tos 64
vrf cust1
frequency 300
The output of sh ip sla stat 2700 includes:
RTT Values:
    Number Of RTT: 10        RTT Min/Avg/Max: 3/3/6 milliseconds
We need to get the average rtt value via snmp but the mib seems to only contain the min and max value in rttMonLatestJitterOperRTTMin and rttMonLatestJitterOperRTTMax.
Is there a way to get the average value too which can't be calculated without knowing the rtts of every single packet?

Similar Messages

  • UCCE 7.5 how to get BHCA and Average Call Handle time?

    Hi everybody,
    I'm trying to do an audit of the existing UCCE system.
    Can someone please tell me how to get the BHCA and Average Call Handle time for agent?
    I did a SQL query against the CallTypeHalfHour table for all the entering Call Type but I'm not sure that's the right BHCA.
    Thanks in advance,
    Best Regards,

    Hi again Geoff,
    Before closing this thread, I'm curious about your query against TCD for average handle time.
    Here's mine using Skill_Group_Half_Hour
    SELECT
        SUM(HandledCallsTalkTimeToHalf) AS TalkTime,
        SUM(IncomingCallsOnHoldTimeToHalf) AS HoldTime,
        SUM(CallsHandledToHalf) AS HandledCalls,
          AHT =
                CASE
                WHEN SUM(CallsHandledToHalf) > 0 THEN (SUM(HandledCallsTalkTimeToHalf) +SUM(IncomingCallsOnHoldTimeToHalf)) / SUM(CallsHandledToHalf)
                ELSE 0
                END
    FROM t_Skill_Group_Half_Hour
    WHERE DateTime between '02/01/11 00:00' and '02/28/11 23:30'
    Besides, can you please also tell me how to get the Average Waiting Time (time before get answered by an agent) ?
    Thank you in advance, Geoff,
    Best Regards,

  • How to get XLate out of ASA with SNMP

    Hi All,
    We recently replaced out trusty old 3660 NAT router with a pair of ASA5520's. Our service desk used to be able to pull the NAT translations out of the router using SNMP. (CISCO-IETF-NAT-MIB:ciscoIetfNatMIB)
    We would like to do that same on the ASA, which obviously means we need to pull out the xlate. I have so far been unable to figure out how to do this, can anyone help?
    We are running Version 8.0(2)
    Many Thanks,
    Nick

    Hmmm, this was going to be my fall-back option, but I'm not looking forward to this as I'll have to figure out some way of having the syslogs go into an SQL database so that I've got a real-time translation table that I can query.
    Is anyone aware of whether getting the Xlates out of a PIX/ASA using SNMP is possible?

  • How can I get max, min & average (hours with minutes) of fast 30 days data

    Table name:
    run_log
    TYPE VARCHAR2(10),
    SUBTYPE VARCHAR2(10),
    PROGRAM VARCHAR2(100),
    STATUS VARCHAR2(20),
    START_TIME      DATE,
    END_TIME      DATE
    How can I get max, min & average (hours with minutes) of fast 30 days data ?

    Hi,
    you have to use analytical functions:
    SELECT start_day,
           round(AVG(daily_avg)
                 over(ORDER BY start_day ASC RANGE BETWEEN INTERVAL '30' DAY preceding AND INTERVAL '0' DAY following)) AS moving_avg,
           round(MAX(daily_max)
                 over(ORDER BY start_day ASC RANGE BETWEEN INTERVAL '30' DAY preceding AND INTERVAL '0' DAY following)) AS moving_max,
           round(MIN(daily_min)
                 over(ORDER BY start_day ASC RANGE BETWEEN INTERVAL '30' DAY preceding AND INTERVAL '0' DAY following)) AS moving_min
      FROM (SELECT trunc(t.start_time) start_day,
                   AVG((t.end_time - t.start_time) * 24 * 60 * 60) AS daily_avg,
                   MAX((t.end_time - t.start_time) * 24 * 60 * 60) AS daily_max,
                   MIN((t.end_time - t.start_time) * 24 * 60 * 60) AS daily_min
              FROM run_log
             GROUP BY trunc(t.start_time)) t
    ORDER BY 1 DESCAnalytical functions are described in the Oracle doc "Data Warehousing Guide".
    Regards,
    Carsten.

  • How to get Material Master Moving average price into Purchase Order

    Hi,
    How to get Material master moving average price into purchase order instead of Purchase Info record.
    Thanks,
    Sridhar

    Hi,
            I  cannot understand whether it is necessary .
           How about as following step?
                 1. create Purcahse requisition
                                Price come form moving average price in material master.
                 2. Create Purchase order reference Purchase  requisition
                                There is a setting  from the unit price of P/R onto the unit price of P/O.
      Regards,
         Gaito

  • How to get Moving Average Price ( MAP ) & Standered Price in BW

    Hi all,
    I want to get the Moving Average Price ( MAP) & Standered price in BW Report.So that please suggest me
    1. which Cube I have to use &
    2.  which datasource having that Moving Average Price ( VERPR) Field.
    If having other Procedure to calculate Moving Average Price in BW .
    please give me these details.
    Thanks,
    kiran

    Hi Kiran,
    0IC_C03 Cube can be used to bring the fields you require.
    Please search forum post by Anil Kumar, link is not available  thats why i am copying the text here.
    You need to enhance the Standard DS of Infoobject 0MAT_PLANT and Infoobject 0MAT_PLANT to include these 2 fields.
    And you need to enahance the 0IC_C03 cube to include 0MAT_PLANT and need to complete the mapping in all 3 Update rules for this added Infoobject.
    And you need to upload the attribute data of 0MAT_PLANT as full upload every day.
    In the reports , you need to dependent on Formula varibles with replacement path with standard price an MAP price attributes of 0MAT_PLANT. So if you go with these formula variables with replacement path, you should take 0MAT_PLANT characterstic into rows as a prerequiste.
    If you want to avoid this prerequisite, then take a look on How to calculate with attributes values.
    Other wise you need to do the calculations at 0MAT_PLANT level by a base query after every upload,and the result should be stored in TODS by APD .And then you can final report with out 0MAT_PLANT in rows upon this ODS.
    please see this links
    Re: 2lis_03_um and MBEW- STPRS
    Re: How to get Moving Average Prince and Standard Price in BW (inventory cube).
    Hope this Helps.
    Thanks
    CK

  • How to get average number of emails per day?

    Hi,
    I need figures on the mail activity (whether inbound ir outbound). I have implemented the imslog.pl. Does this output from imslog.pl answer my question:
    Message load by day (dequeues):
    Date # of dequeues
    16-May-2006 8813
    the # of dequeues is the same as the number of outbound messages (mails that are sent by my mail server)?
    How to get the enqueued stats?
    thanks,

    Hi Linda,
    Email statistics are a tricky thing. Before attempting to collate statistics for any kind of reporting you need to strictly define what you wish to collect and how to define an 'email'.
    For example, if a single email is destined for 10 addresses, is this 1 email or 10. From a virus-scanning point-of-view it's one email, but from a storage perspective it can be 10 (single message store makes this even more complex) and from a delivery-to-external host it can be 5 (assuming 5 distinct email domains).
    For email activity, you can separate this into a few categories (this will also depend on your email infrastructure):
    a. Inbound external email (tcp_local enqueue)
    b. Inbound internal/external email from internal staff (tcp_submit/tcp_auth enqueue)
    c. Inbound internal email (tcp_intranet enqueue)
    d. Outbound external email (tcp_local dequeue)
    e. Local account delivered email (ims-ms dequeue)
    f. Local host delivered email (tcp_intranet dequeue)
    These statistics are all currently available in the imslog.pl output.
    Hopefully I haven't caused more confusion. I find though for reporting it is best to have these definitions clear from the beginning, especially if you are looking for trends over-time.
    Regards,
    Shane.

  • How to get Moving Average Prince and Standard Price in BW (inventory cube).

    Hi All,
    Could anyone please suggest us how to get Moving Avg. Price and Standard Price for 0ic_c03 cube, i had gone through 0CO_PC_ACT_05 and 0CO_PC_ACT_02 datasource but it is not going to solve our purpose.
    In SDN i had gone through few links and understood that we have to work on 0MAT_PLANT info object but i hav't not found how to work on this, though i found few SAP notes which are related to MAP. (869892, 819464, 863644).
    Probably some one might worked on these MAP and Std. Price, if you could share your work which us that will be a greate help.
    Highly appreciated if you share the code and steps how to work on MAP and Std. Price.
    Thanks in Advance.
    Akash

    Hi,
    You need to enhance the Standard DS of Infoobject 0MAT_PLANT and Infoobject 0MAT_PLANT  to include these 2 fields.
    And you need to enahance the 0IC_C03 cube to include  0MAT_PLANT and need to complete the mapping in all 3 Update rules for this added Infoobject.
    <b>And you need to upload the attribute data of 0MAT_PLANT as full upload every day.</b>
    In the reports , you need to dependent on Formula varibles with replacement path with standard price an MAP price attributes of  0MAT_PLANT. So if you go with these formula variables with replacement path, you should take 0MAT_PLANT characterstic into rows as a prerequiste.
    If you want to  avoid this prerequisite, then take a look on How to calculate with attributes values.
    Other wise you need to do the calculations at 0MAT_PLANT level by a base query after every upload,and the result should be stored in TODS by APD .And then you can final report with out 0MAT_PLANT in rows upon this ODS.
    You can see my contact details in my business card.
    With rgds,
    Anil Kumar Sharma .P
    Message was edited by:
            Anil Kumar Sharma

  • How to get the Grand Total in Module pool Screen

    Hi Frds.
         How to get the Grand Total in Module pool Screen
    Example i have 10 different materials
    for each matarial has different moving . But in my case matarials is doesnt matter here
    10 material Moving Average price to do Frand total and display in one column...
    Please Help me out Frds.
    Regards,
    Kabil

    Hi
    You need to calculate the total in a module of PAI (or PBO) event:
    PROCESS PAI.
       LOOP.....
       ENDLOOP.
      MODULE CALCULATE_TOTAL.
      MODULE CALCULATE_TOTAL.
        GRAND_TOTAL = 0.
         LOOP AT ITAB,
            GRAND_TOTAL = GRAND_TOTAL + ITAB-PWB.
        ENDLOOP.
    ENDMODULE.
    In this way the grand total will be calculated as soon as the user presses enter or another command.
    You can't insert the calculation in the loop of table control, because this loop runs the visible lines only, so it's better to calculate the total out of those loop,

  • How to get total,maximum,mimumum no. of cases for this report

    Description:     Reason For Contact For Customer - This report will provide the total number of cases created for a particular Reason For Contact for a particular Customer with a valid Business Code. This report will also provide the Maximum, Minimum and Average number of cases created for a particular Reason For Contact for that particular type of Customer. This report will take From Date, To Date, Agent Group and Business Code as inputs and generates the report on the screen. All the input criteria will be mandatory.
    See the attachment for the Report.
    NOTE :1) FOR TOTAL,WE HAVE COUNT NUMBER OF CASES CREATED for a particular Reason For Contact for a particular Customer with a valid Business Code
      2) FOR Maximum, Minimum and Average CONSIDER number of cases created for a particular Reason For Contact for that particular type of Customer.
       For this report,I am using 5 tables. In the table ScaseParty  i have C_Bus_Code,C_cust_type coulumns are there.
      I am taking Input Criteria For Business code(ie c_bus_code).suppose business code is 'F0106',I have to get how many cases(means records) are there for a particular Reason For Contact for that Business Code.I AM GETTING THE TOTAL BUT
    for getting maximum,minimum,average , i have to check the C_cust_type For that Business code ,after that I have to take all the business codes for that C_Cust_Type and with in the business codes ,i have to take the maximum number of cases which business code have for that particular Reason for contact For that particular customer type.
    Eg: Reason for contact  Businesscode   customer type   
         Delivery Timing     0306            1        
         Delivery Timing     0306            1
         Delivery Timing     0310            1
         Delivery Timing     0310            1
         Delivery Timing     0310            1  
         Delivery Timing     0310            1  
       In this way i want the result
        Maximum =4 since, for reason for contact(delivery timing) for that customer type(customer type =1),the maximum no. of cases are 4 bcz, business code = 0310 comes 4 times.
    Minimum =2 bcz, business code = 0306 comes 2 times.
       The Problems i am facing
    1)  Since i have taken the input criteria Business code = 'f0106' ,the data filters in the where condition and the getting the number of cases exist for that business code(f0106) for that Contact of Reason data only.But i have to take all the business code exists for that Particular type of customer for that Particular reason for contact for getting the max,min,avg.
      I can't handle max,min,avg in one report since it checks total cases for that Business code only.
      SO,I THINK I HAVE TO INVOKE A SUBREPORT PASSING THE C_CUST_TYPE,iSN'T IT????
    2) iF I TAKE THESE THINGS IN SUB REPORT,HOW CAN I find out the maximum number of case with in the business codes for reason for contact for that particular customer type.
      CONSIDER THE ABOVE EXAMPLES, I AM GETTING 3 CASES FOR CODE = 0306 N 2 RECORDS FOR CODE= 0310 ,hOW CAN I GET mAXIMUM cASES ie 3  BY COMPARING THESE TWO CODES FOR THE DELIVERY TIMING  .  IS THERE ANY FUNCTION??????
    In which way i have to handle this report.
      Regards,
      Vijay
      mail : [email protected]

    Hi Vijay,
    The most efficient way to acheive what you want will be to create a stored procedure or command object in which you have a subquery that calculate your maximum, minimum and average values.
    If you are looking at a solution within Crystal Reports without having to write a SQL Query, then as you said, you can use a subreport that will returns the cases created for a particular Reason For Contact for that particular type of Customer.
    ( You will need to link the subreport to filter the data down )
    Then you can calculate the minimum values in the subreport by using the Minimum function and manually counting the values in a variable, the formula will look like:
    WhilePrintingRecords;
    Shared NumberVar MyMinimum;
    If Minimum({Business Code}) = {Business Code} Then
       MyMinimum := MyMinimum + 1;
    Insert the formula in the details section of the subreport.
    This will count the number of time the minimum Business Code appears in the subreport.
    You can create a similar formula for the maximum values by using the Maximum function.
    As for the average, you can create a summary that counts the number of of Business Code, divided by the distinct count of Business Code, so it will give you the average. The formula will look like:
    WhilePrintingRecords;
    Shared NumberVar MyAverage;
    MyAverage :=
    ( If DistinctCount({Business Code}) <> 0 Then
         Count({Business Code}) / DistinctCount({Business Code}))
    Then you can display the above shared variables on your main report.
    Hope this help!
    Regards,
    Patrick

  • How to get IDOC #, If I know the sales order #? I tried in SE37 with*NEIGH*

    Hi Experts,
    I hv a sales order #, say, my_order.........its created from a IDOC via FM of IDOC_INPUT_ORDERS and message is ORDERS.
    So, let me know that, If I know the slaes order #, my_order, How to get its associated IDOC #?
    In SE37, I searched with key word NEIGHBOUR .........but, did not find any result!!
    thanq

    i went to WE05, and did looked all, in the 60days!!
    thanq

  • How to get keys of a particular type

    Following are my objects:
    DepartmentKey - primary key is departmentName, a String
    Department
    EmployeeKey - primary key is employeeId, an integer
    Employee
    I have 5 DepartmentKey-Department key-value entries in a cache and 2000 EmployeeKey-Employee key-value entries in the same cache.
    How do I get all the DepartmentKeys from the cache? In general, how to get keys of a particular type (class name)?
    Thanks
    Ghanshyam

    I guess I am deeply off track regarding the general approach towards storing items in the cache.
    Following is my problem domain:
    A Merchant is any establishment that accepts credit cards. (It could be the local Subway down the street or Macy's, etc.). A Transaction is a credit card transaction.
    public class Merchant implements Serializable{
    private String merchantId; // primary key
    private double averageTxnAmount;
    private double totalTxnAmount;
    private long totalTxnCount;
    public class Transaction implements Serializable{
    private String merchantId; // merchant that originated the txn
    private double amount;
    private Timestamp txnTime;
    private String txnType; // sale, return, etc.
    public class MerchantKey implements Serializable, KeyAssociation{
    private String merchantId;
    public Object getAssociatedKey{
    return merchantId;
    public class TransactionKey implements Serializable, KeyAssociation{
    private String merchantId;
    private Timestamp txnTime;
    private double amount;
    public Object getAssociatedKey{
    return merchantId;
    I want to update a merchant's average txn amount as transactions come in.
    Let's say I have a million merchants in a partitioned cache cluster spread across some machines.
    Transactions come into the cluster quite rapidly, say tens in a second. The process that inserts the transaction into the cluster must also update the merchant to which the transaction belongs, as follows:
    Transaction t = ...
    cache.put(tKey, t); // store the transaction into the cache
    MerchantKey mKey = new MerchantKey(txn.getMerchantId());
    Merchant m = (Merchant)cache.get(mKey);
    // update the merchant's avg txn amt
    m.setAverageTxnAmount((txn.getAmount() + m.getTotalTxnAmount())/m.getTotalTxnCount() + 1);
    m.setTotalCount(m.getTotalCount() + 1);
    // store the updated merchant back into cache
    cache.put(mKey, m);
    OR
    Transaction t = ...
    cache.put(tKey, t); // store the transaction into the cache
    MerchantKey mKey = new MerchantKey(txn.getMerchantId());
    Merchant m = (Merchant)cache.get(mKey);
    MerchantUpdater agent = new MerchantUpdater(t);
    cache.invoke(mKey, agent);
    public class MerchantUpdater implements AbstractProcessor{
    public Object process(Entry entry){
    Merchant m = (Merchant)entry.getValue();
    // update m's avg txn amt, total count using t
    entry.setValue(m);
    The basic idea is to store all merchants and all transactions (which could be tens of millions in a day) for a day in memory and to update the merchant objects as transactions come in throughout the day. The above example shows updating just the merchant's average txn amount, but in reality, it could be updating a number of things about the merchant.
    Am I using the api in the right spirit or is my approach seriously whacked? Can you please comment?
    Thanks
    Ghanshyam

  • How to get the current schema name

    Hi,
    Can anybody please tell me how to get the current schema name, there is some inbuilt function for this,but i am not getting that. Please help me.
    Thanks
    Jogesh

    ok folks, I found the answer at Tom's as usual.
    http://asktom.oracle.com/tkyte/who_called_me/index.html
    I rewrote it into a function for kicks. just pass the results of DBMS_UTILITY.FORMAT_CALL_STACK to this function and you will get back the owner of the code making the call as well some extra goodies like the name of the code and the type of code depending on the parameter. This ignores the AUTHID CURRENT_USER issues which muddles the schemaid. Quick question, does the average user always have access to DBMS_UTILITY.FORMAT_CALL_STACK or does this get locked down on some systems?
    cheers,
    paul
    create or replace
    FUNCTION SELF_EXAM (
       p_call_stack VARCHAR2,
       p_type VARCHAR2 DEFAULT 'SCHEMA'
    ) RETURN VARCHAR2
    AS
       str_stack   VARCHAR2(4000);
       int_n       PLS_INTEGER;
       str_line    VARCHAR2(255);
       found_stack BOOLEAN DEFAULT FALSE;
       int_cnt     PLS_INTEGER := 0;
       str_caller  VARCHAR2(30);
       str_name    VARCHAR2(30);
       str_owner   VARCHAR2(30);
       str_type    VARCHAR2(30);
    BEGIN
       str_stack := p_call_stack;
       -- Loop through each line of the call stack
       LOOP
         int_n := INSTR( str_stack, chr(10) );
         EXIT WHEN int_cnt = 3 OR int_n IS NULL OR int_n = 0;
         -- get the line
         str_line := SUBSTR( str_stack, 1, int_n - 1 );
         -- remove the line from the stack str
         str_stack := substr( str_stack, int_n + 1 );
         IF NOT found_stack
         THEN
            IF str_line like '%handle%number%name%'
            THEN
               found_stack := TRUE;
            END IF;
         ELSE
            int_cnt := int_cnt + 1;
             -- cnt = 1 is ME
             -- cnt = 2 is MY Caller
             -- cnt = 3 is Their Caller
             IF int_cnt = 1
             THEN
                str_line := SUBSTR( str_line, 22 );
                dbms_output.put_line('->' || str_line);
                IF str_line LIKE 'pr%'
                THEN
                   int_n := LENGTH('procedure ');
                ELSIF str_line LIKE 'fun%'
                THEN
                   int_n := LENGTH('function ');
                ELSIF str_line LIKE 'package body%'
                THEN
                   int_n := LENGTH('package body ');
                ELSIF str_line LIKE 'pack%'
                THEN
                   int_n := LENGTH('package ');
                ELSIF str_line LIKE 'anonymous%'
                THEN
                   int_n := LENGTH('anonymous block ');
                ELSE
                   int_n := null;
                END IF;
                IF int_n IS NOT NULL
                THEN
                   str_type := LTRIM(RTRIM(UPPER(SUBSTR( str_line, 1, int_n - 1 ))));
                 ELSE
                   str_type := 'TRIGGER';
                 END IF;
                 str_line  := SUBSTR( str_line, NVL(int_n,1) );
                 int_n     := INSTR( str_line, '.' );
                 str_owner := LTRIM(RTRIM(SUBSTR( str_line, 1, int_n - 1 )));
                 str_name  := LTRIM(RTRIM(SUBSTR( str_line, int_n + 1 )));
              END IF;
           END IF;
       END LOOP;
       IF UPPER(p_type) = 'NAME'
       THEN
          RETURN str_name;
       ELSIF UPPER(p_type) = 'SCHEMA.NAME'
       OR    UPPER(p_type) = 'OWNER.NAME'
       THEN
          RETURN str_owner || '.' || str_name;
       ELSIF UPPER(p_type) = 'TYPE'
       THEN
          RETURN str_type;
       ELSE
          RETURN str_owner;
       END IF;
    END SELF_EXAM;

  • How to get sql server performance counters using query?

    Hai i want to see my sql server performance counters like, Full Scans/sec,  Buffer
    Cache Hit Ratio,  Database Transactions/sec, User
    Connections, Average Latch Wait Time (ms), Lock
    Waits/sec, Lock Timeouts/sec, Number
    of Deadlocks/sec, Total Server Memory, SQL
    Re-Compilations/sec, User Settable Query. If any one know how to get it by using query means, please help me.
    Thanks in advance

    Hello,
    Below is query created by Jonathan Kehayias for measuring Perfom counters using DMV sys.dm_os_performance_counter.
    You can download book from below link
    https://www.simple-talk.com/books/sql-books/troubleshooting-sql-server-a-guide-for-the-accidental-dba/
    DECLARE @CounterPrefix NVARCHAR(30)
    SET @CounterPrefix = CASE WHEN @@SERVICENAME = 'MSSQLSERVER'
    THEN 'SQLServer:'
    ELSE 'MSSQL$' + @@SERVICENAME + ':'
    END ;
    -- Capture the first counter set
    SELECT CAST(1 AS INT) AS collection_instance ,
    [OBJECT_NAME] ,
    counter_name ,
    instance_name ,
    cntr_value ,
    cntr_type ,
    CURRENT_TIMESTAMP AS collection_time
    INTO #perf_counters_init
    FROM sys.dm_os_performance_counters
    WHERE ( OBJECT_NAME = @CounterPrefix + 'Access Methods'
    AND counter_name = 'Full Scans/sec'
    OR ( OBJECT_NAME = @CounterPrefix + 'Access Methods'
    AND counter_name = 'Index Searches/sec'
    OR ( OBJECT_NAME = @CounterPrefix + 'Buffer Manager'
    AND counter_name = 'Lazy Writes/sec'
    OR ( OBJECT_NAME = @CounterPrefix + 'Buffer Manager'
    AND counter_name = 'Page life expectancy'
    OR ( OBJECT_NAME = @CounterPrefix + 'General Statistics'
    AND counter_name = 'Processes Blocked'
    OR ( OBJECT_NAME = @CounterPrefix + 'General Statistics'
    AND counter_name = 'User Connections'
    OR ( OBJECT_NAME = @CounterPrefix + 'Locks'
    AND counter_name = 'Lock Waits/sec'
    OR ( OBJECT_NAME = @CounterPrefix + 'Locks'
    AND counter_name = 'Lock Wait Time (ms)'
    OR ( OBJECT_NAME = @CounterPrefix + 'SQL Statistics'
    AND counter_name = 'SQL Re-Compilations/sec'
    OR ( OBJECT_NAME = @CounterPrefix + 'Memory Manager'
    AND counter_name = 'Memory Grants Pending'
    OR ( OBJECT_NAME = @CounterPrefix + 'SQL Statistics'
    AND counter_name = 'Batch Requests/sec'
    OR ( OBJECT_NAME = @CounterPrefix + 'SQL Statistics'
    AND counter_name = 'SQL Compilations/sec'
    -- Wait on Second between data collection
    WAITFOR DELAY '00:00:01'
    -- Capture the second counter set
    SELECT CAST(2 AS INT) AS collection_instance ,
    OBJECT_NAME ,
    counter_name ,
    instance_name ,
    cntr_value ,
    cntr_type ,
    CURRENT_TIMESTAMP AS collection_time
    INTO #perf_counters_second
    FROM sys.dm_os_performance_counters
    WHERE ( OBJECT_NAME = @CounterPrefix + 'Access Methods'
    AND counter_name = 'Full Scans/sec'
    OR ( OBJECT_NAME = @CounterPrefix + 'Access Methods'
    AND counter_name = 'Index Searches/sec'
    OR ( OBJECT_NAME = @CounterPrefix + 'Buffer Manager'
    AND counter_name = 'Lazy Writes/sec'
    OR ( OBJECT_NAME = @CounterPrefix + 'Buffer Manager'
    AND counter_name = 'Page life expectancy'
    OR ( OBJECT_NAME = @CounterPrefix + 'General Statistics'
    AND counter_name = 'Processes Blocked'
    OR ( OBJECT_NAME = @CounterPrefix + 'General Statistics'
    AND counter_name = 'User Connections'
    OR ( OBJECT_NAME = @CounterPrefix + 'Locks'
    AND counter_name = 'Lock Waits/sec'
    OR ( OBJECT_NAME = @CounterPrefix + 'Locks'
    AND counter_name = 'Lock Wait Time (ms)'
    OR ( OBJECT_NAME = @CounterPrefix + 'SQL Statistics'
    AND counter_name = 'SQL Re-Compilations/sec'
    OR ( OBJECT_NAME = @CounterPrefix + 'Memory Manager'
    AND counter_name = 'Memory Grants Pending'
    OR ( OBJECT_NAME = @CounterPrefix + 'SQL Statistics'
    AND counter_name = 'Batch Requests/sec'
    OR ( OBJECT_NAME = @CounterPrefix + 'SQL Statistics'
    AND counter_name = 'SQL Compilations/sec'
    -- Calculate the cumulative counter values
    SELECT i.OBJECT_NAME ,
    i.counter_name ,
    i.instance_name ,
    CASE WHEN i.cntr_type = 272696576
    THEN s.cntr_value - i.cntr_value
    WHEN i.cntr_type = 65792 THEN s.cntr_value
    END AS cntr_value
    FROM #perf_counters_init AS i
    JOIN #perf_counters_second AS s
    ON i.collection_instance + 1 = s.collection_instance
    AND i.OBJECT_NAME = s.OBJECT_NAME
    AND i.counter_name = s.counter_name
    AND i.instance_name = s.instance_name
    ORDER BY OBJECT_NAME
    -- Cleanup tables
    DROP TABLE #perf_counters_init
    DROP TABLE #perf_counters_second
    Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers

  • How do I calculate the average of ONLY the populated fields?

    I'm working on an Adobe form to streamline the process of summarizing course evaluations.  To protect the anonymity of the students, instructors with 10 or fewer students are given a typed summary of the evaluation results.  On the first half of the evaluation, the students are asked to rate a series of statements from 1-5.  Three of these are highlighted on the summary form with the average response. 
    I've already set up the form with 10 unique boxes for each question and an 11th box which calculates the average.  Each field is named according to the question number and the student's "number" (I arbitrarily gave each student a number so that each field would be unique):
    i.e. #1. Questionquestionquestion.  Q1S1  Q1S2  Q1S3  Q1S4  Q1S5  Q1S6  Q1S7  Q1S8  Q1S9  Q1S10  1AVG
    The problem, of course, is that no matter how many students were actually in the class, the AVG field will always be calculated based on a group of 10...which isn't accurate or fair to the instructor.  I thought about just changing the form and removing the unused fields from the equation each time I make up a new summary, but the point of creating a form was to make it as quick and easy as possible to bang these things out... Plus, some of my coworkers might be using the form from time to time and I'd have to explain what they have to do and if they don't have Adobe Acrobat then they can't actually make the changes and blah blah blah...it just gets ridiculous really quickly!
    So anyway, I tried reading some other posts for similar questions in an attempt to figure out a custom calculation script for myself, but I just couldn't focus on it.
    I was hoping someone could explain how to write a custom calculation script that will omit any fields which are left blank... Or, even better...is anyone willing to write it for me?  At least just an example of the first guy, cause I could probably figure out how to get all the other ones from there.
    Thanks.

    In formcalc the function Avg will calculate the average of only the fields with a value in them. So you would would put in the calcuate event of the average field:
    $ = Avg(Q1S1,Q1S2,Q1S3,Q1S4, etc)

Maybe you are looking for

  • Can we assemble XFA and Flatten pdfs?

    Hi, I am not sure if assembler can create a XFA + Flatten pdf to a XFA form. I want to assemble a pdf1 (xfa)  with pdf2 (flatten) to produce a pdf3. Pdf3 should not be completely xfa or flatten, so that i can submit pdf3 on hit of button and extract

  • TomTom failing to load

    I have TomTom Westen Europe on my iPhone and it is now failing to load. I get the splash screen for 20 seconds or so then it just goes back to the normal menu. I have tried reloading my iPhone and reloading TomTom but nothing seems to work. I have a

  • Turn a light on.

    Can actionscript pass a number to a preloaded .dll file in the format      longinteger.longinteger. I need to turn lights on at various points while a flash video is playing.

  • Tables in XI

    Hi, I need list of tables in XI in which XI stores the details of the messages processed. I want to search on basis of reciver interface, sender interface, date and time. Any help is appreciated. Thanks, Prateek

  • How can SMO retrieve the SQL messages from ExecuteNonQuery(SQLFile)

    I have a vb.net app that uses SMO to execute SQL files with the ExecuteNonQuery(SQLFile). The ExecuteNonQuery(SQLFile) is in a TRY CATCH and I catch SQLException, SMOException, and general Exception. When my SQL file has an error, such as a table nam