out on (one's) feet
1. Near to the point of collapse or losing consciousness (as due to exhaustion or injury) while still remaining on one's feet; just short of being asleep or unconscious. Doctors in training are expected to endure an unbelievable amount of stress and exhaustion. Surely it is counterproductive forcing them to attend each of their patients while they're out on their feet.
2. All but or as good as defeated; still functioning, but past the point of usefulness or productivity. The company has managed to remain open, but truth be told, it's really been out on its feet for the last year.