Peak times in a day for web transactions

I need to create a chart to show peak time in a day for web transactions.

so I write a query like this but it gives a timestamp of starting of the interval but not the peak time.

select * FROM (select max(some) FROM (SELECT rate(count(*), 1 minute) AS some FROM Transaction FACET appName TIMESERIES AUTO SINCE 1 DAY)).

Can someone please help with this Thanks.

Hi, @kboggavarapu: You may use the following query to get the maximum number of transactions that occurred during a minute of the previous day:

SELECT max(transactionsPerMinute) 
FROM (
  SELECT rate(count(*), 1 minute) AS transactionsPerMinute 
  FROM Transaction 
  FACET appName
) WHERE appName = 'Your Application' 
SINCE 1 day ago

I don’t know of any way to get the time when it occurred. Here are a couple of alternatives:

SELECT count(*) 
FROM Transaction 
WHERE appName = 'Your Application' 
SINCE 1 day ago 
TIMESERIES 1 hour 
EXTRAPOLATE 

That will give you a chart showing the number of transactions per hour, and you can visually see the high point. Or:

SELECT count(*) 
FROM Transaction 
WHERE appName = 'Your Application' 
SINCE 1 day ago 
FACET hourOf(timestamp) 
EXTRAPOLATE 

You can display the result as a bar chart, and see which hour had the highest number of transactions.

1 Like