Measuring and monitoring power consumption in networks