Пример #1
0
        public static async Task<long> SendMultipleTestEventsAsync(int howMany, SplunkLogger logger)
        {
          Stopwatch timer = new Stopwatch();
            timer.Start();

            for (int i = 1; i <= howMany; i++) {
                string time = timer.ElapsedMilliseconds.ToString();
                await logger.LogAsync ("This is test event " + i + " out of " + howMany + 
                    ".  It has been " + time + " millis since requests started.");
            }
            timer.Stop();
            return timer.ElapsedMilliseconds;
        }
Пример #2
0
        public static async Task <long> SendMultipleTestEventsAsync(int howMany, SplunkLogger logger)
        {
            Stopwatch timer = new Stopwatch();

            timer.Start();

            for (int i = 1; i <= howMany; i++)
            {
                string time = timer.ElapsedMilliseconds.ToString();
                await logger.LogAsync("This is test event " + i + " out of " + howMany +
                                      ".  It has been " + time + " millis since requests started.");
            }
            timer.Stop();
            return(timer.ElapsedMilliseconds);
        }
Пример #3
0
		async private Task SendRandomEvents(SplunkLogger spl)
		{
			Stopwatch timer = new Stopwatch ();
			timer.Start ();
			Random r = new Random();
			while (true)
			{
				int waitTimeMillis = r.Next(250, 1500);
				await Task.Delay(waitTimeMillis);

				int numEvents = r.Next (1,10);
				for (int i = 1; i <= numEvents; i++) {
					await spl.LogAsync ("This is event " + i + " out of " + numEvents + ", sent " +
						timer.ElapsedMilliseconds + " milliseconds after application started");
				}
			}
		}