public SetProperty ( string name, string property ) : void | ||
name | string | |
property | string | |
return | void |
static void Main(string[] args) { // Initialise metrics with a new TextLogEmitter var metrics = new Metrics(new TextLogEmitter("output.csv")); metrics.SetProperty("My property", "test"); // Create some dummy metrics data for (var i = 0; i < 10; i++) { metrics.Entry("Test int entry", i); } metrics.SetProperty("Second property", "true"); metrics.Event("An event occurred"); metrics.Entry("Test string entry", "foo"); Console.WriteLine("Metrics output written to output.csv"); }
static void Main(string[] args) { var httpService = new SimpleHttpService(); var postUrl = "http://localhost:3000/emit"; // Create the metrics with batching. var metrics = new Metrics(new HttpJsonPostEmitter(postUrl, httpService), 5); // Create some dummy metrics data metrics.SetProperty("Metrics entry", "test"); for (var i = 0; i < 10; i++) { metrics.Entry("Test int entry", i); } metrics.SetProperty("Second property", "true"); metrics.Event("An event occurred"); metrics.Entry("Test string entry", "foo"); // Flush the metrics before in case there are still queued metrics. metrics.Flush(); Console.WriteLine("Sent metrics data to " + postUrl); }