Beispiel #1
0
        public void AzureLoadTestSend()
        {
            var status = LogStatus.Stop;
            int count  = 0;

            Stopwatch   sw           = new Stopwatch();
            LogMan      lm           = new LogMan();
            QueueClient _queueClient = QueueClient.CreateFromConnectionString(_connectionString, _queueName);

            lm.WriteAzureLogStatus(LogStatus.Start);
            sw.Start();
            //
            try
            {
                for (int a = 1; a <= 50000; a++)
                {
                    _queueClient.Send(new BrokeredMessage(new AzureMessage
                    {
                        Id   = a,
                        Body = string.Format("{0} numarali mesaj.", a)
                    }));

                    Console.WriteLine(string.Format("{0} id numarali mesaj gonderildi. ", a));
                    lm.AzureLoadTestLog(a);
                    count = a;
                }
            }
            catch (Exception e)
            {
                lm.AzureLogException(e.InnerException.Message);
                status = LogStatus.Abondoned;
            }
            //
            sw.Stop();

            lm.AzureLogToFile(count, sw.Elapsed);
            lm.WriteAzureLogStatus(status);
        }