Beispiel #1
0
        // Sends one data record
        public void SendRecord(IProducerToConsumerAdpt adpt, string uuid, string receiver_addr, CustomLogger log)
        {
            JObject record = recordGenerator.GenerateRecord();

            log.RawLog(LogLevel.INFO, $"[Producer] Generated Data Record: {record}");
            adpt.Send(record, uuid, receiver_addr); //TODO: Uncomment me to test connection with consumer!
            this.Amount--;
        }
Beispiel #2
0
        public JObject GenerateRecord()
        {
            JObject rec = Generator.GenerateRecord();

            //Console.WriteLine($"Record: {rec.ToString()}");
            if (random.NextDouble() < this.ErrorRate)
            {
                return(ApplyError(rec));
            }
            else
            {
                return(rec);
            }
        }