We are facing some problem in recording multiple sampled metric values. We followed the example as given in the documentation
The WriteSample method is recording data for the first call only and is failing to record data for the subsequent calls. Not sure if it is a bug or a flaw in our logic. Could you please provide us a detailed working example?
Samples are automatically timestamped when you call WriteSample (they are presumed to reflect the value at that time). When we display them in the UI they are typically aggregated to a time interval - like 15 seconds. So, you aren't typically seeing each raw sample. Therefore, if you write several samples very close together they will show on a chart as a single sample.
This re sampling of data for display is an important feature to make sure metrics can be meaningfully compared. Consider tracking the average duration of an operation - if you display it over 15 seconds but there is a sample twice a second it needs to determine what combined sample value would be if it had been sampled at the slower interval. That way as you increase the sampling period in the display it smooths out short term aberrations.