Beispiel #1
0
        static void ProcessMeasurements(object state)
        {
            while (true)
            {
                List <Measurement> measurements = new List <Measurement>();

                Measurement measurement;

                for (int i = 1; i <= MeasurementCount; i++)
                {
                    measurement = new Measurement
                    {
                        Key       = MeasurementKey.LookUpOrCreate("DEVARCHIVE", (uint)i),
                        Value     = Random.Between(-65535.0D, 65536.0D),
                        Timestamp = DateTime.UtcNow.Ticks
                    };

                    measurements.Add(measurement);
                }

                publisher.QueueMeasurementsForProcessing(measurements);

                Thread.Sleep(33);
            }
        }