In all cases of forcible entry and detainer, forcible detainer, and unlawful detainer, the judge of the court of general sessions trying the cause shall be authorized and it shall be the judge's duty to ascertain the arrearage of rent, interest, and damages, if any, and render judgment therefor if the judge's judgment shall be that the plaintiff recover possession.