Browse Source

Fixed debug output on query execution.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@5032 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 16 years ago
parent
commit
65fe90ceb2
  1. 11
      src/AddIns/Misc/Profiler/Controller/Data/Linq/SQLiteQueryProvider.cs
  2. 5
      src/AddIns/Misc/Profiler/Controller/ExtensionMethods.cs
  3. 2
      src/AddIns/Misc/Profiler/Frontend/Controls/QueryView.xaml.cs

11
src/AddIns/Misc/Profiler/Controller/Data/Linq/SQLiteQueryProvider.cs

@ -162,6 +162,17 @@ namespace ICSharpCode.Profiler.Controller.Data.Linq @@ -162,6 +162,17 @@ namespace ICSharpCode.Profiler.Controller.Data.Linq
return expression.ToString();
}
/// <summary>
/// Optimizes the query without executing it.
/// Used for unit tests.
/// </summary>
public Expression OptimizeQuery(Expression inputExpression)
{
Expression partiallyEvaluatedExpression = PartialEvaluator.Eval(inputExpression, CanBeEvaluatedStatically);
Expression expression = new ConvertToQueryAstVisitor(new QueryExecutionOptions()).Visit(partiallyEvaluatedExpression);
return new OptimizeQueryExpressionVisitor().Visit(expression);
}
public override object Execute(Expression inputExpression)
{
Stopwatch watch = Stopwatch.StartNew();

5
src/AddIns/Misc/Profiler/Controller/ExtensionMethods.cs

@ -105,8 +105,11 @@ namespace ICSharpCode.Profiler.Controller @@ -105,8 +105,11 @@ namespace ICSharpCode.Profiler.Controller
if (logOutput == null)
throw new ArgumentNullException("logOutput");
logOutput.WriteLine("The query did not use LINQ-to-Profiler.");
IQueryable<CallTreeNode> query = items as IQueryable<CallTreeNode>;
if (query != null)
return query.WithQueryLog(logOutput);
logOutput.WriteLine("The query did not use LINQ-to-Profiler.");
return items;
}

2
src/AddIns/Misc/Profiler/Frontend/Controls/QueryView.xaml.cs

@ -292,7 +292,7 @@ namespace ICSharpCode.Profiler.Controls @@ -292,7 +292,7 @@ namespace ICSharpCode.Profiler.Controls
{
try {
if (compiler.Compile()) {
var data = compiler.ExecuteQuery(provider, rangeStart, rangeEnd);
IEnumerable<CallTreeNode> data = compiler.ExecuteQuery(provider, rangeStart, rangeEnd);
#if DEBUG
data = data.WithQueryLog(Console.Out);
#endif

Loading…
Cancel
Save