cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Not a customer? Start a free trial

Click the Start a free trial link to start a 15-day SaaS trial of our product and join our community as a trial user. If you are an existing customer do not start a free trial.

AppDynamics customers and established members should click the sign in button to authenticate.

Business iQ (Analytics)

Bucketing Series with Math calculation (percentage)

SOLVED
Ade.Suryadiana
Creator

Bucketing Series with Math calculation (percentage)

Hello,

I am struggling to convert total number of metric value from number into percentage of total value, in this case is browser type -- and it should be shown in time series bucket function,

 

At the moment, I am able to show based on number using following queries in time series (see attached picture)

  •  SELECT series(eventTimestamp, '1m'), count(browser) AS "Firefox" FROM browser_records WHERE browser = "Firefox"
  • SELECT series(eventTimestamp, '1m'), count(browser) AS "Non-Firefox" FROM browser_records WHERE browser != "Firefox"
  • SELECT series(eventTimestamp, '1m'), count(*) AS "Total" FROM browser_records

Browser_Usage.jpg

 

However, I am unable to convert it into percentage (%).


I know there is filter function e.g. :

SELECT 100*filter(count(*), browser = "Firefox") / count(*) AS "% Firefox" FROM browser_records

or

SELECT 100*filter(count(*), browser != "Firefox") / count(*) AS "% Non-Firefox" FROM browser_records

 

BUT it will only return single value, not in time series as I expected.

 

 Browser_Usage_Percentage.jpg

How to combine series bucketing function and filter function to get percentage number browser in time series?

Anyone has experience before?

By replying you agree to the Terms and Conditions of the AppDynamics Community.
Bucketing Series with Math calculation (percentage)
2 REPLIES 2
Hiroki.Ito
AppDynamics Team

Hi @Ade.Suryadiana,

 

Thank you for posting to the community.

 

I believe you are just missing series(eventTimestamp, '1m') for percentage query.
Could you try queries like the following?

 

SELECT series(eventTimestamp, '1m'), 100*filter(count(*), browser = "Firefox") / count(*) AS "% Firefox" FROM browser_records
SELECT series(eventTimestamp, '1m'), 100*filter(count(*), browser != "Firefox") / count(*) AS "% Non-Firefox" FROM browser_records

 

Best Regards,
Hiroki


Found something helpful? Click the Accept as Solution button to help others find answers faster.
Liked something? Click the Thumbs Up button.
Ade.Suryadiana
Creator

Thank you @Hiroki.Ito , it works.