milliwatt-hour meter
Assuming the supply voltage will be constant for this test, if you convert the current to a voltage, follow that with a low pass filter, then sample well above Nyquist for the filter, you need only perform numerical integration of the voltage samples (by summing, trapezoid, Simpson's Rule etc.). Easy-peasy. The faster you sample in relation to the LPF cutoff frequency the less sophisticated your integration algorithm need be for a given accuracy.  

The LPF will smear out over time any sharp pulses of current, but as long as the DC gain is 1 it will not affect the average mAh calculation. So if you have a LPF cutoff of (say) 100Hz, you could sample at 1kHz, do simple trapezoidal integration and get a nice number ramping upward as the device runs. 

The only gotcha I can think of is that the bit width of the integration number (or mantissa if it's a float or double) should be equal to the number of significant bits in the current measurement + log2(sample rate) + log2(seconds in your test). 

So if you're measuring the current to 12 bits, and taking measurements at 1kHz for 1 hour, you'd need 12 + 10 + 12 = 34 bits, so a double precision float would be required or a 64-bit integer.