Reputation: 1469
I'm running ServiceStack v4 under /api
in my MVC4 application. I'd like to have Glimpse profile my SQL queries. My SQL tab is disabled in the HUD.
Any idea how to configure this?
Upvotes: 0
Views: 373
Reputation: 1469
The solution I chose was to override the SqlServerOrmLiteDialectProvider.CreateDbConnection()
similar to this solution.
var dbFactory = new OrmLiteConnectionFactory(
"<connection string>",
SqlServerWithGlimpseDialectProvider.Instance);
public class SqlServerWithGlimpseDialectProvider
: SqlServerOrmLiteDialectProvider
{
public new static SqlServerWithGlimpseDialectProvider Instance = new SqlServerWithGlimpseDialectProvider();
public override IDbConnection CreateConnection(string connectionString, Dictionary<string, string> options)
{
return new GlimpseDbConnection(
base.CreateConnection(connectionString, options) as System.Data.SqlClient.SqlConnection);
}
}
SQL now profiling:
Upvotes: 3
Reputation: 9103
I'm no ServiceStack expert, but there are docs for getting it setup. Have you tried following these instructions?
Upvotes: 1