1 Reply Latest reply on Mar 17, 2017 5:39 AM by yaquaholic

    SWQL: How to get response time for the last hour (Custom Query)

    rhanft

      I'm starting out with SWQL, no real experience with SQL. How would I average the last hour of response time? (Code below is how far I got :b, I'm quite new to this language):....

       

       

      SELECT Caption, ResponseTime

       

      FROM Orion.Nodes

       

      WHERE Caption like '%lalala%'

        • Re: SWQL: How to get response time for the last hour (Custom Query)
          yaquaholic

          The Nodes table isn't a time based table and the last response is only the last time that this node responded, so there is only one value in this table.

          You need to find a table with DateTime column in, and as you are after response times, the interface tables may be a good place to start.

           

          Try something iike:

           

          SELECT n.Caption, AVG(rt.AvgResponseTime)

          FROM Orion.ResponseTime rt

          INNER JOIN Orion.Nodes n ON n.NodeID = rt.NodeID

          WHERE n.Caption LIKE '%lalala%'

               AND  rt.DateTime > Addhour(-1, rt.DateTime)

          2 of 2 people found this helpful