You were pretty close to that. :)
In the Graphite web application, follow Graph Options -> Line Mode -> Stacked . If you use the API, add &areaMode=stacked to your URL.
This is a GUI setup to achieve what you want. To generate metrics, do -
asPercent( group( carbon.agents.ip-10-0-0-111-a.updateOperations, carbon.agents.ip-10-0-0-111-a.metricsReceived ), sumSeries( carbon.agents.ip-10-0-0-111-a.updateOperations, carbon.agents.ip-10-0-0-111-a.metricsReceived ) )
Here's how it works -
asPercent takes two arguments: a seriesList and a total . Here the group(...) is the first and sumSeries(...) last. Graphite compares each metric in a seriesList (which can be achieved with group() or with wildcards) with the sum and therefore calculates the percentages.
The good part is that total is optional, and if not sent, it is considered the sum of seriesList . That way, essentially, your score drops to -
asPercent( group( carbon.agents.ip-10-0-0-111-a.updateOperations, carbon.agents.ip-10-0-0-111-a.metricsReceived ) )

source share