Clarify/document EnergyMeter interface
Created by: cdleonard
I wrote a EnergyMeter implementation for an in-house power measurement board and I don't know if I did it correctly. Since the board is not going to be available externally it wouldn't be useful to post it as a patch. Existing implementations don't apply: my meter has a microcontroller connected via a separate usb/serial and outputs human-readable text that I parse with regexps.
It would help to expand the documentation on the EnergyMeter class. I read https://github.com/ARM-software/lisa/wiki/Energy-Meters-Requirements but still had trouble with the following:
- It's not clear what report() should return.
- I returned milijoules in the channel dict. Other implementations also seem to returning energy (not power), but maybe returning joules as floats is important?
- I returned None as EnergyReport data_frame. What does this affect?
- sample() seems to be returning a dict of dict with "last"/"delta"/"total" since last call and values seem to be joules again. I did not implement this, what does it affect?
- Maybe I should have implemented a devlib.Instrument? I see no obvious benefit.
I'm not sure if this is the proper medium to ask these questions.