@vladh powertop certainly seems like a good starting point if you want to try to calculate it online, but just using a power meter at the wall plug would probably be more realistic.
While you could collect resource usage stats on CPU and memory use, it would be difficult to factor in how much power they each consume.
@vladh this looks like a useful gadget for your purpose https://iotawatt.com/
Logs, dashboards, whatever...