Question

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.

SQL tab disabled in Glimpse HUD

Any idea how to configure this?

Was it helpful?

Solution

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:

enter image description here

OTHER TIPS

I'm no ServiceStack expert, but there are docs for getting it setup. Have you tried following these instructions?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top