in servicestack using miniprofiler configured store profiles using sqlserverstorage. profiles being recorded database 'miniprofilers' table without issue. there viewer render data (especially json) miniprofilers table?
this sample shows how sqlserverstorage being initialized. method called apphost.cs on configure:
private void enableprofiling(string profilerconnection) { using (var conn = new sqlconnection(profilerconnection)) { conn.open(); var miniprofilerstableexists = conn.executescalar<int>("select case when exists((select * information_schema.tables table_name = 'miniprofilers')) 1 else 0 end"); if (miniprofilerstableexists != 1) conn.execute(sqlserverstorage.tablecreationscript); } profiler.settings.storage = new sqlserverstorage(profilerconnection); }
in html page (just before </head>) add following line
@servicestack.miniprofiler.profiler.renderincludes().asraw() in application_start (global.asax) add following lines
profiler.settings.popuprenderposition = renderposition.left; profiler.settings.sqlformatter = new sqlserverformatter(); it display tiny tab @ top left corner of page in can click reveal more information.
Comments
Post a Comment