Look for the national semi app note AN-265 (Linear Applications book), for a watt-watt-hour meter