Bug Fix and Performance Improvement on element metrics lookup during adding sample
The is a bug fix and great improvement on element metrics look up when adding a sample, without this fix, the element metrics list will grow for each sample added and used an O(n) lookup each time an sample is added. This is a waste of CPU and Memory and resulted in unnecessary large size payload when posting to the Cloud.