Measuring charge amount in electroplating, or measuring actual battery capacity can be done with integrator. Special requirement for this integrator is that it should has no leakage for long term operation, ranging for hours to several days. Using a voltage-to-frequency converter and a counter can solve this problem, here is the block diagram of the system:

The counting values is equal to the integration of the input signal, and since the value is held by a counter, a very long running time has no problem. The integrated value will have no leakage even for days of operation. As long as the power supply is available, the counter will hold the integration value indefinitely. [System’s block diagram source: Microchip Application Note]