An inspector of boilers for every failure to perform his duties is guilty of a misdemeanor and, upon conviction thereof, shall be punished by a fine of not less than one hundred dollars nor more than one thousand dollars, or by imprisonment in the county jail for a period of not less than two months nor more than one year, or by both such fine and imprisonment.