public static DiagnosticRunner Start <TEntity>(IMongoDbConnection connection, IEnumerable <CreateIndexModel <TEntity> > model) where TEntity : class
        {
            var runner = new DiagnosticRunner(connection);

            connection.DiagnosticListener.OnNext(new IndexDiagnosticCommand <TEntity>
            {
                CommandId    = runner.CommandId,
                CommandState = CommandState.Start,
                EntityType   = typeof(TEntity),
                IndexModel   = model
            });
            return(runner);
        }
        public static DiagnosticRunner Start <TEntity>(IMongoDbConnection connection, AggregateExecutionModel model) where TEntity : class
        {
            var runner = new DiagnosticRunner(connection);

            connection.DiagnosticListener.OnNext(new ReadDiagnosticCommand
            {
                CommandId    = runner.CommandId,
                CommandState = CommandState.Start,
                EntityType   = model.Serializer.ValueType,
                Query        = QueryHelper.GetQuery <TEntity>(model)
            });
            return(runner);
        }