By using a plug in energy meter (for example like this one) it is possible to get a very approximate idea of the capacity of your e-bike battery. For example it may be rated at 500Wh but e-bike batteries degrade over time and can also develop faults that will affect their capacity.
Firstly make sure your e-bike battery is empty by using it on your e-bike until power has run out.
Now recharge it as normal to full but use a plug in power meter to measure the number of Wh taken from start to finish (ie as soon as the battery is full).
Not all the electricity shown as consumed by the meter will be going into the battery cells. For example some will be lost by the inefficiencies of the transformer that drops the voltage down from mains 240V to whatever your e-bike battery requires.
All transformers vary but a very approximate working assumption is that 80% of the electricity from the power socket will end up in your battery. So to find out the extremely approximate capacity of your battery just multiply the Wh consumed on the plug in meter by 0.8 to give you a rough idea of its health.
It is a good idea to repeat this exercise several times to get an average reading.