i have played around miniprofiler recently. works fine in our application, , have found interesting things we're working on.
however, have use case, need make custom injection record, can set duration.
in picture below, can see "hack" i've made show right now, i'd show correctly:
my situation
i consuming third party api. every single page has lot of calls, , called different views.
the api has .net client, has delegate that's called after it's dine:
private static void logapirequest(string httpmethod, string url, timespan duration)
the issue method used logging, i'd inject duration here.
any idea how it? :-)
if understood well, surround api's calls following code:
apiclient thirdpartyclient = new apiclient(); using (profiler.step("calling third party api methods")) { thirdpartyclient.methodx(); }
or, using custom categories:
apiclient thirdpartyclient = new apiclient(); using(miniprofiler.current.customtiming("3rd party api","api.methody") { thirdpartyclient.methody(); }