Altima won't go over 2,500 RPM's

We were driving on the Interstate when suddenly the car would not go over 2,500 rpm’s. We could go 70 mph downhill but dropped to 50 updhill. We got on to surface roads, and can to a stop sign when the problem corrected itself. This has happened four times, each time correcting itself when we went to slower speeds (what speed, we don’t know). The dealership checked the computer and there were no diagnositic codes so it showed no problem at all. Everyone is at a loss as to what the problem is.

What model year is this Altima? I am wondering if this is a problem with throttle by wire or TCS so the year would help narrow that down.

It is a 2008.