Saving terminals records to .csv file

For the above latency sample code can you please advise what should be the variables. I have tried to add as below to a .csv file
input_variable = [cNvDsFrameLatencyInfo]
but the output will give “<cdata ‘NvDsFrameLatencyInfo[2]’ owning 48 bytes>” not each plugin latency as in terminal
The full frame latency worked well but i need as well to extract each plugin latency to .csv file