Пример #1
0
            public static async Task Main(string[] args)
            {
                var benchParameters = ParseArguments(args, out string url, out int workers);

                using (var tsb = new TimeSeriesBench(url, workers))
                {
                    tsb.Initialize(benchParameters);

                    await tsb.BenchmarkInsert();

                    await Task.Delay(10_000); // cooldown

                    await tsb.BenchmarkQuery();

                    Console.WriteLine();
                }
            }
Пример #2
0
            private static async Task LocalTest()
            {
                var url     = "http://localhost:8080";
                var workers = 8;

                var now   = new DateTime(2020, 4, 20);
                var test1 = new BenchParameters
                {
                    Documents             = 100,
                    TimeSeriesPerDocument = 1,
                    ValuesPerTimeSeries   = 1,
                    Start      = now.AddMonths(-1),
                    End        = now,
                    IntervalMs = 10_000
                };

                var test2 = new BenchParameters
                {
                    Documents             = 100,
                    TimeSeriesPerDocument = 1,
                    ValuesPerTimeSeries   = 10,
                    Start      = now.AddMonths(-1),
                    End        = now,
                    IntervalMs = 10_000
                };

                var test3 = new BenchParameters
                {
                    Documents             = 4000,
                    TimeSeriesPerDocument = 1,
                    ValuesPerTimeSeries   = 10,
                    Start      = now.AddDays(-3),
                    End        = now,
                    IntervalMs = 10_000
                };

                var test4 = new BenchParameters
                {
                    Documents             = 100_000,
                    TimeSeriesPerDocument = 1,
                    ValuesPerTimeSeries   = 10,
                    Start      = now.AddHours(-3),
                    End        = now,
                    IntervalMs = 10_000
                };

                var test5 = new BenchParameters
                {
                    Documents             = 1_000_000,
                    TimeSeriesPerDocument = 1,
                    ValuesPerTimeSeries   = 10,
                    Start      = now.AddMinutes(-3),
                    End        = now,
                    IntervalMs = 10_000
                };

                var tests = new[] { test1, test2, test3, test4, test5 };

                //foreach (var test in tests)
                {
                    using (var tsb = new TimeSeriesBench(url, workers))
                    {
                        tsb.Initialize(test3);

                        await tsb.BenchmarkInsert();

                        await Task.Delay(10_000); // cooldown

                        await tsb.BenchmarkQuery();

                        Console.WriteLine();
                    }
                }
            }