public void RecordEventMetricReflectionDataRangeTest() { UserEventObject myDataObject = new UserEventObject("Data Range Test"); //warm up the object just to get rid of first hit performance EventMetric.Register(myDataObject); EventMetric.Write(myDataObject); //and we're going to write out a BUNCH of samples Trace.TraceInformation("Starting reflection data range test"); DateTime curTime = DateTime.Now; //We have to limit ourselves to 32000 samples to stay within short. for (short curSample = 0; curSample < 32000; curSample++) { //we have a LOT of numbers we need to set to increment this object. myDataObject.SetValues(curSample, 32000); //sets all of the numerics //and write it out again just for kicks EventMetric.Write(myDataObject); } TimeSpan duration = DateTime.Now - curTime; Trace.TraceInformation("Completed reflection data range test in {0} milliseconds for 32,000 samples", duration.TotalMilliseconds); Log.Verbose(LogWriteMode.WaitForCommit, "Test.Agent.Metrics.EventMetric.Attributes", "Event Metrics performance test flush", null); }
public void PrettySampleDataOverTimeTest() { UserEventObject myDataObject = new UserEventObject("Pretty Data"); EventMetric.Register(myDataObject); //do a set of 20 samples with a gap between each. for (short curSample = 0; curSample < 20; curSample++) { myDataObject.SetValues(curSample); EventMetric.Write(myDataObject); //now sleep for a little to make a nice gap. This has to be >> 16 ms to show a reasonable gap. Thread.Sleep(200); } }