In-process monitoring of porosity in additive manufacturing using optical emission spectroscopy