public void TestProfiledSqlQuery()
		{
			var profiled = new GlimpseDbConnection(_connection);
			var result = profiled.QuerySql<int>("SELECT @p --GLIMPSE", new { p = 1 }).First();

			Assert.AreEqual((int)1, result);
		}
		public void TestProfiledStoredProcWithParameters()
		{
			using (var connection = _connectionStringBuilder.OpenWithTransaction())
			{
				connection.ExecuteSql("CREATE PROC InsightTestProcGlimpse (@Value int = 5) AS SELECT Value=@Value");

				var profiled = new GlimpseDbConnection(connection);
				var result = profiled.Query<int>("InsightTestProcGlimpse", new { Value = 1 }).First();

				Assert.AreEqual((int)1, result);
			}
		}
        public GlimpseDbTransaction(DbTransaction transaction, GlimpseDbConnection connection)
        {
            InnerTransaction = transaction;
            InnerConnection = connection;
            TransactionId = Guid.NewGuid();

            if (MessageBroker != null && TimerStrategy != null)
            {
                timerTimeSpan = TimerStrategy.Start();

                MessageBroker.Publish(
                    new TransactionBeganMessage(connection.ConnectionId, TransactionId, transaction.IsolationLevel)
                    .AsTimedMessage(timerTimeSpan));
            }
        }
        public GlimpseDbTransaction(DbTransaction transaction, GlimpseDbConnection connection)
        {
            InnerTransaction = transaction;
            InnerConnection  = connection;
            TransactionId    = Guid.NewGuid();

            if (MessageBroker != null && TimerStrategy != null)
            {
                timerTimeSpan = TimerStrategy.Start();

                MessageBroker.Publish(
                    new TransactionBeganMessage(connection.ConnectionId, TransactionId, transaction.IsolationLevel)
                    .AsTimedMessage(timerTimeSpan));
            }
        }
        public void TestBulkCopyWithInterface()
        {
            const int ItemCount = 10;

            // build test data
            InsightTestData[] array = new InsightTestData[ItemCount];
            for (int j = 0; j < ItemCount; j++)
                array[j] = new InsightTestData() { Int = j };

            var profiled = new GlimpseDbConnection((DbConnection)Connection());

            using (var i = profiled.OpenWithTransactionAs<ICanBulkCopy>())
            {
                i.BulkCopy("BulkCopyData", array);
            }
        }
 public GlimpseDbTransaction(DbTransaction transaction, GlimpseDbConnection connection, IMessageBroker messageBroker, IExecutionTimer timerStrategy)
     : this(transaction, connection)
 {
     MessageBroker = messageBroker;
     TimerStrategy = timerStrategy;
 }
Example #7
0
 public GlimpseDbCommand(DbCommand innerCommand, GlimpseDbConnection connection, IMessageBroker messageBroker, IExecutionTimer timerStrategy)
     : this(innerCommand, connection)
 {
     MessageBroker = messageBroker;
     TimerStrategy = timerStrategy;
 }
Example #8
0
 public GlimpseDbCommand(DbCommand innerCommand, GlimpseDbConnection connection)
     : this(innerCommand)
 {
     InnerConnection = connection;
 }
Example #9
0
 public GlimpseDbCommand(DbCommand innerCommand, GlimpseDbConnection connection, IMessageBroker messageBroker, IExecutionTimer timerStrategy)
     : this(innerCommand, connection)
 {
     MessageBroker = messageBroker;
     TimerStrategy = timerStrategy;
 }
Example #10
0
 public GlimpseDbCommand(DbCommand innerCommand, GlimpseDbConnection connection)
     : this(innerCommand)
 {
     InnerConnection = connection;
 }
 public GlimpseDbTransaction(DbTransaction transaction, GlimpseDbConnection connection, IMessageBroker messageBroker, IExecutionTimer timerStrategy)
     : this(transaction, connection)
 {
     MessageBroker = messageBroker;
     TimerStrategy = timerStrategy;
 }