My answer for the post Battery Monitor for Ubuntu ... contains a script and installation/configuration details to show the charging and discharging rates of the battery.
This displays a graphical dialogue at configured points showing the battery status as depicted in the picture below:

The script notification_battery_discharge.sh has lines that write such information to a log file every minute. The lines currently in the script are commented out which we need to un-comment to log charging/discharging percentage at every minute. The script currently lacks a mechanism to check the size of the log, and log rotation in case the log file becomes very large.
Uncomment the writes to the log files so that the lines look like:
echo "$(date +%H:%M:%S) :: Discharging :: __RATE_OF_DISCHARGE_PER_MIN=$__RATE_OF_DISCHARGE_PER_MIN , __RATE_OF_DISCHARGE_PER_HOUR=$__RATE_OF_DISCHARGE_PER_HOUR" >> "$__FILE_LOG"
and,
echo "$(date +%H:%M:%S) :: Charging :: __RATE_OF_CHARGING_PER_MIN=$__RATE_OF_DISCHARGE_PER_MIN , __RATE_OF_CHARGING_PER_HOUR=$__RATE_OF_DISCHARGE_PER_HOUR" >> "$__FILE_LOG"
A portion of the log for my device looks like:
14:24:47 :: Charging :: __RATE_OF_CHARGING_PER_MIN=.538 , __RATE_OF_CHARGING_PER_HOUR=32.307
14:25:47 :: Charging :: __RATE_OF_CHARGING_PER_MIN=.571 , __RATE_OF_CHARGING_PER_HOUR=34.285
14:26:47 :: Charging :: __RATE_OF_CHARGING_PER_MIN=.533 , __RATE_OF_CHARGING_PER_HOUR=32.000
14:27:47 :: Charging :: __RATE_OF_CHARGING_PER_MIN=.500 , __RATE_OF_CHARGING_PER_HOUR=30.000
14:28:47 :: Charging :: __RATE_OF_CHARGING_PER_MIN=.529 , __RATE_OF_CHARGING_PER_HOUR=31.764
14:29:47 :: Discharging :: __RATE_OF_DISCHARGE_PER_MIN=0 , __RATE_OF_DISCHARGE_PER_HOUR=0
14:30:47 :: Discharging :: __RATE_OF_DISCHARGE_PER_MIN=0 , __RATE_OF_DISCHARGE_PER_HOUR=0
14:31:47 :: Discharging :: __RATE_OF_DISCHARGE_PER_MIN=.500 , __RATE_OF_DISCHARGE_PER_HOUR=30.000
14:32:47 :: Discharging :: __RATE_OF_DISCHARGE_PER_MIN=.333 , __RATE_OF_DISCHARGE_PER_HOUR=20.000
14:33:47 :: Discharging :: __RATE_OF_DISCHARGE_PER_MIN=.250 , __RATE_OF_DISCHARGE_PER_HOUR=15.000
14:34:47 :: Discharging :: __RATE_OF_DISCHARGE_PER_MIN=.400 , __RATE_OF_DISCHARGE_PER_HOUR=24.000
14:35:47 :: Discharging :: __RATE_OF_DISCHARGE_PER_MIN=.333 , __RATE_OF_DISCHARGE_PER_HOUR=20.000
(The log could show current battery percentage and date, but I chose not to.)
When the status toggles between charging/discharging, for a couple of minutes, a garbage charging/discharging message gets logged (and displayed in the dialogue) which is a shortcoming. The rates gets more accurate as time passes.