Extensions
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Custom DB Query extension not providing the correct count

tdavison76
Participant

 

Hello,

I've created a Custom Extension that runs a SQL Query that just provides a "count".  This runs every 1 min, but, the returned count is not accurate.  It should be around 60+ per minute, but Dynatrace is showing single digit counts.  Also, it looks like it skips a minute occassionally.  I can run the query manually in SSMS and see the counts that I expect.

tdavison76_0-1784638524417.png

Here's the query:

select count(*) as [count]
from [Mercury].[dbo].[OrderShipmentActual] (nolock)
where [CreateDate] > dateadd(mi, -1, getdate());

 

Here's how the extension is configured:

tdavison76_1-1784638688093.png

Any idea how to resolve this and get the correct counts?

Thank you for any help on this one.

Tom

 

 

3 REPLIES 3

AntonioSousa
DynaMight Guru
DynaMight Guru

@tdavison76 ,

Looks like the missing points might be from timeouts. Normally the timeout is 10 seconds, so put something higher, and let's check afterwards.

Antonio Sousa

Hello Antonio, thank you for the help, I've modified the Query and Interval to be 5 min instead of 1.

tdavison76_0-1784643770707.png

 

Still seeing incorrect counts and looks like even more gaps.  e.g.  The below chart is showing a 25 count at 10:05, and the next count is only 2 and doesn't occur until 10:20am.  The SQL Query and 5 min intervals should be showing a count of 300+ every 5 min.

tdavison76_1-1784643985203.png

 

 

Thanks again for the help

 

 

@tdavison76 ,

You have a timeout of 30 seconds. It cannot be greater than the period, but if you have 5 minutes, try 300 seconds for the timeout.

Antonio Sousa

Featured Posts