Calculating datasource size including replication

I want to calculate size for each datasource including the replication defined for the specific intervals.The http:/coordinator:port/druid/coordinator/v1/datasources/{name} gives the size of a datasource without replication.
Currently I am fetching the retention rules for each datasource and querying for the segement metadata of specific intervals and multiplying it with the replication factor.
I want to know if there is an easier way to do it.

Hey Sharath,

You can do this with system tables (

SELECT datasource, SUM(size * num_replicas) FROM sys.segments GROUP BY 1