Ejemplo n.º 1
0
        public static InfluxTelemetry generateRandomData(RSACryptoManager cm, bool validData, bool validSig)
        {
            List <string> lst  = new List <string>();
            Random        r    = new Random();
            int           rInt = r.Next(100, 999);

            lst.Add("weather,location=us-midwest temperature=" + rInt + " 1465839830100400" + rInt);
            lst.Add("weather,location=us-east temperature=" + rInt + " 1465839830100400" + rInt);

            string payload = string.Join("", lst);

            return(validData?
                   new InfluxTelemetry()
            {
                NodeId = _nodeId, Payload = lst, Signature = validSig ? cm.signData(payload) : ""
            } :
                   new InfluxTelemetry()
            {
                NodeId = "", Signature = validSig ? cm.signData(payload) : ""
            });
        }