Sunnyvale's top public safety officer is retiring after eight years of service.