Diagnosis of relativistic electron beams using a free electron laser amplifier