I've had Sammy for about three years and today he suddenly isn't doing very well

Usually he eats with gusto but today he ignored the food and now he's acting weird. He's darting about the tank like he's agitated, and he swims up and then drops down like a weight. He lies down on his side then gets up and darts about, drops back down... and the cycle goes on. I tested the water, water params are fine (ammonia 0, nitrites 0, nitrates 5, ph 7.2). He's in a five gallon planted tank, Prime water conditioner, water changes every few days.

Anyone know what might be wrong?? I love this little guy so much