i have a situation where i have to monitor the execution time of the webservices using logparer as i cannot run perfmon. this is becoz of some unreasonable demands of my client.
i have my query documneted but i want to replace u_ex110713.log with the dynamic file name as i want to constantly monitor the latest file. how do i make it happen. i am open to using dos batch file so i can schedule it and pipe the results to another batch which will alert if the threshold increases to 30 seconds.
select TO_STRING(TO_LOCALTIME(TO_TIMESTAMP(date, time)), 'yyyy-MM-dd HH:mm') as timestamps,
count(timestamps),avg(div(time-taken,1000)),max(div(time-taken,1000)),min(div(time-taken,1000))
from \\server.qc.cgo.ca\c$\inetpub\logs\LogFiles\W3SVC1\u_ex110713.log
group by timestamps
order by timestamps asc
Honestly, if I were in your place I'd just end up querying *ex*.log
in the directory, knowing that processes are in place to zip and delete logs on a monthly basis.
You could get the current system time and use it to create your FROM statement, but I'm afraid my knowledge isn't that great, so I'm not aware of a way to pull the system time in UTC (which, assuming you're using the IIS defaults, you would need for the file rollover).
That said, I'm not sure using the logs to trigger timing results is your best bet. Shouldn't this be built into the system itself?