Witnesses attending before the controller or auditors 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 or auditor, shall be included in the costs assessed against such officer.
16 P.S. § 1728