0

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
junkone
  • 1,159
  • 17
  • 34

1 Answers1

1

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?

James Skemp
  • 7,386
  • 9
  • 58
  • 95
  • unfortunately, this is the only way i can look at my log files – junkone Aug 01 '11 at 14:30
  • http://stackoverflow.com/questions/5485853/how-to-create-a-folder-with-name-as-current-date-in-batch-bat-files/5486137#5486137 seems to have away to piggyback off of JavaScript to create a date/time. http://stackoverflow.com/questions/5485853/how-to-create-a-folder-with-name-as-current-date-in-batch-bat-files/5491434#5491434 suggests a way to do it without. At that point it's just a matter of pulling the characters you want to build the file name: http://blueonionsoftware.com/blog.aspx?p=40656a9d-021b-4061-b296-36ad5211f4b2 – James Skemp Aug 02 '11 at 00:33