How can I calculate the in-stock rate for my online store products?

Hi all,

I am looking for a solution to calculate in-stock rate of products on my store. In general, looking to either calculate a percent of products in stock or out of stock (# items in-stock / # total items), or percent of pageviews of in-stock product over total page views (in-stock page views / total page views).

Is there a tool within shopify, or an external app that helps solve this? Any help would be appreciated!

Thanks!