08 Oct 2024 03:56 PM - edited 08 Oct 2024 03:58 PM
Hello,
I do have log containing response of each transaction and also quantity of item ordered in the same transaction.
order.id | quantity | response.time.ms |
AB_987 | 29 | 10000 |
Out of those logs I'm building metrics.
What is the best way of building a visual timeseries distribution based on response time and amount of items?
(I'd like to observe if based on amount of item ordered the response time goes high on avg).
Regards
Solved! Go to Solution.
08 Oct 2024 11:49 PM
Hi @y_buccellato , you can try something similar to response time by request count? Use line chart for response time and bar for quantity in your case .Hope I understood your query correctly.
timeseries response_time = avg(dt.service.request.response_time), request_count = sum(dt.service.request.count)
09 Oct 2024 07:02 AM
Thank you, this was also an option which I had thought of but the real implementation looks more in the way Fin suggested
09 Oct 2024 12:24 AM
Hey @y_buccellato,
Based on what you're trying to find out you could try using the makeTimeseries command along with binning the order quantity to see if you can find trends that way.
In my example below each timeseries is grouped by the number of items in an order. For example the first group, the blue line, are orders with numbers of items between 0 and 49. The next group, white, is comprised of orders with items between 50 and 99. And so on. This can be modified to suite your needs, you could bin them into smaller groups if the maximum number of items is 50 or 100 or something like that you might bin by 5 or 10.
My example raw data looks like below.
Alternatively you could use makeTimeseries but just split by order quantity if the range of items in orders is fairly low and the number of total orders is high enough to create a nice timeseries.
Hope this helps!
09 Oct 2024 06:44 AM
Thank you for your time.
You first example is kinda perfect. And you made me think: maybe while processing the data in a pipeline I can create a log field item.number.category ( less then X, between X and Y, more than Y) and this way the field can later on become a dimension (that doesn’t grow too much) for a possible metric so I make users visualise metrics and not consume logs.
10 Oct 2024 04:02 PM
Just a small detail here - in the legend: is there any way to not show Bin 0 and then Bin 10; instead showing Bin from 0 to 9, bin from 10 to 19, etc.. ?
Regards
10 Oct 2024 06:39 PM
I think you could use the filterOut command or you can remove them from the visualization tab.
13 Oct 2024 11:00 PM
You would take the field you've put the bin amount into and use some string modifications to change it. As seen below I used concat to add " - #" to the end of each bin amount to show the range.