Witnesses attending before the controller shall receive the same allowance as is received by witnesses attending before the courts of this Commonwealth. Such allowance shall be paid out of the county treasury, and where final judgment is given against any officer whose accounts are settled by the controller, shall be included in the costs assessed against such officer.
16 P.S. § 4928