Using an Arduino board, some customised circuitry, an excellent analogue to digital converted and some high-speed optocouplers you can make this version of a mains power monitor unit. The reason for the external ADC is to allow for faster data conversions (which are returned via the SPI bus) and true AC voltage measurement accuracy via a reference voltage. Finally the power data is returned to a PC to be sent to cosm (or other data analysis tools). For example:
As the author notes, be careful when working with mains power - and also be aware of the regulatory requirements in your jurisdition. However to get started including notes, theory, schematics and Arduino code please visit the project page here.