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?

Était-ce utile?

La 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

Autres conseils

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

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top