Exemple #1
0
        public string GetCompareUrl(TestRun run, Options options)
        {
            var compare = new CompareJson()
            {
                ST_FLT = Math.Round(run.FloatSingleThreaded.Value, 2),
                MT_FLT = Math.Round(run.FloatMultiThreaded.Value, 2),
                ST_INT = Math.Round(run.IntSingleThreaded.Value, 2),
                MT_INT = Math.Round(run.IntMultiThreaded.Value, 2),
            };

            var json = "";

            json = ObjectToJson(compare);

            var prms = inapp_param + Device.RuntimePlatform +
                       "&" + yd_param + json +
                       "&" + cnt_param + run.NumberOfRepeats +
                       "&" + flt_64b_param + (options.Float64Bit ? "1" : "0") +
                       "&" + int_64b_param + (options.Int64Bit ? "1" : "0") +
                       "&" + flt_thrd_param + options.FloatThreads +
                       "&" + int_thrd_param + options.IntThreads +
                       "&" + GetEnvParams();

            prms = TrimQueryString(prms);

            return(cpdt_web_url + "?" + prms);
        }
        public string GetCompareUrl(TestSession session)
        {
            var compare = new CompareJson()
            {
                seqWrite  = Math.Round(session.SeqWrite, 2),
                seqRead   = Math.Round(session.SeqRead, 2),
                randWrite = Math.Round(session.RandWrite, 2),
                randRead  = Math.Round(session.RandRead, 2),
                memCopy   = Math.Round(session.MemCopy / 1024, 2),
                free      = Math.Round((double)session.FreeSpaceBytes / 1024 / 1024 / 1024, 1),
                total     = Math.Round((double)session.TotalSpaceBytes / 1024 / 1024 / 1024, 1),
                size      = Math.Round((double)session.FileSizeBytes / 1024 / 1024 / 1024, 1),
                drive     = session.DriveName
            };

            var json = "";

            var mem = new MemoryStream();
            var ser = new DataContractJsonSerializer(typeof(CompareJson));

            ser.WriteObject(mem, compare);
            mem.Position = 0;
            var sr = new StreamReader(mem);

            json = sr.ReadToEnd();

            json = Uri.EscapeDataString(json);

            var prms = inapp_param + Device.RuntimePlatform +
                       "&" + yd_param + json +
                       "&" + buf_param + (session.WriteBuffering ? "1" : "0") +
                       "&" + cach_param + (session.MemCache ? "1" : "0") +
                       "&" + GetParams();

            prms = TrimQueryString(prms);

            return(cpdt_web_url + "?" + prms);
        }