public void LogControllerBenchmark(IControllerInfo controllerInfo)
 {
     using (var sqlConnection = new SqlConnection(ConnectionString))
     {
         sqlConnection.Open();
         using (var sqlCommand = new SqlCommand())
         {
             sqlCommand.Connection  = sqlConnection;
             sqlCommand.CommandType = CommandType.Text;
             sqlCommand.CommandText = @"
                 INSERT INTO perf.controllerlog (keyid, controller, action, executiontime, rendertime, widgetinstanceid)
                     VALUES (@keyid, @controller, @action, @executiontime, @rendertime, @widgetinstanceid)";
             sqlCommand.Parameters.AddWithValue("@keyid", controllerInfo.Keyid);
             sqlCommand.Parameters.AddWithValue("@controller", controllerInfo.ControllerName);
             sqlCommand.Parameters.AddWithValue("@action", controllerInfo.ActionName);
             sqlCommand.Parameters.AddWithValue("@executiontime", controllerInfo.ExecutionTime);
             sqlCommand.Parameters.AddWithValue("@rendertime", controllerInfo.RenderTime);
             sqlCommand.Parameters.AddWithValue("@widgetinstanceid", controllerInfo.WidgetInstanceId ?? (object)DBNull.Value);
             sqlCommand.ExecuteNonQuery();
         }
     }
 }
 public void LogControllerBenchmark(IControllerInfo controllerInfo)
 {
     using (var sqlConnection = new SqlConnection(ConnectionString))
     {
         sqlConnection.Open();
         using (var sqlCommand = new SqlCommand())
         {
             sqlCommand.Connection = sqlConnection;
             sqlCommand.CommandType = CommandType.Text;
             sqlCommand.CommandText = @"
                 INSERT INTO perf.controllerlog (keyid, controller, action, executiontime, rendertime, widgetinstanceid)
                     VALUES (@keyid, @controller, @action, @executiontime, @rendertime, @widgetinstanceid)";
             sqlCommand.Parameters.AddWithValue("@keyid", controllerInfo.Keyid);
             sqlCommand.Parameters.AddWithValue("@controller", controllerInfo.ControllerName);
             sqlCommand.Parameters.AddWithValue("@action", controllerInfo.ActionName);
             sqlCommand.Parameters.AddWithValue("@executiontime", controllerInfo.ExecutionTime);
             sqlCommand.Parameters.AddWithValue("@rendertime", controllerInfo.RenderTime);
             sqlCommand.Parameters.AddWithValue("@widgetinstanceid", controllerInfo.WidgetInstanceId ?? (object)DBNull.Value);
             sqlCommand.ExecuteNonQuery();
         }
     }
 }
Exemple #3
0
 public void Register(IControllerInfo controllerInfo)
 {
     _defaultControllers[controllerInfo.ServiceName] = controllerInfo;
 }
Exemple #4
0
 /// <summary>
 /// Установить владельца
 /// </summary>
 public virtual void SetOwner(IControllerInfo owner)
 {
     Owner = owner;
 }