コード例 #1
0
        static void Main(string[] args)
        {
            if (Settings.Instance is null)
            {
                Console.WriteLine("go and edit settings.json");
                return;
            }
            DataBaseEventStore eventStore     = new DataBaseEventStore(Settings.Instance.Database);
            EventProcessor     eventProcessor = new EventProcessor(eventStore);

            System.Diagnostics.Stopwatch watch = System.Diagnostics.Stopwatch.StartNew();
            Cache.SetProcessor(eventProcessor);
            foreach (var @event in eventStore.GetAll())
            {
                eventProcessor.Replay(@event);
            }
            Console.WriteLine(watch.Elapsed);

            watch.Restart();
            for (int i = 0; i < 12_000; i++)
            {
                var player = Player.Create(eventProcessor, i + 2354323);
                player.AddMark(eventProcessor, Enumerable.Range(13512, 10));
            }
            Console.WriteLine(watch.Elapsed);

            Cache.PlayerCache.ToString();
        }
コード例 #2
0
ファイル: Cache.cs プロジェクト: wot-tools/marks-app-backend
 public static void SetProcessor(EventProcessor processor)
 {
     processor.EventStored += (sender, e) => PlayEvent(e.Event);
 }