Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Coverage profiler
Message
From
15/10/2001 11:03:20
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00568508
Message ID:
00568530
Views:
32
This message has been marked as the solution to the initial question of the thread.
>>Hi!
>>
>>Nadya, just use "to \DDDD.log" so you will know where is that file. Switch off coverage profiling before you try to use the log file because it might be opened by VFP.
>>
>>In addition, it is hard to use coverage profiler (though I did not looked if VFP 7 have any improvements in it). Usually I get much more information manually - by importing that log file into a table and doing queries from it. To import, prepare a structure and use append from command as for a text file.
>
>Yes, I was thinking about it. Do you know the structure of this file?

It's in the help file.
But this may help also
*--------------------------------------------------------------------------
procedure cov()
	=Coverage('\tmp\log.log')
endproc
*--------------------------------------------------------------------------
procedure	Coverage(_file)
	local coverageFile
	coverageFile = 'coverage'
	Create cursor (coverageFile) ;
		(	duration	n(7,3), ;
		   	class		c(30), ;
		   	procedure	c(60), ;
		   	line		i, ;
		   	file		c(100)	;
		 )
		 
	APPEND FROM (_file) TYPE DELIMITED
	go top
	delete
	
	select	procedure, ;
			Class, ;
			line, ;
			count(*) as TimesCalled , ;
			sum(Duration)	as TotalTime ;
		from (CoverageFile) ;
		into cursor Statistics ;
	group by 1, 2, 3 ;
	union all ;
	select	'', ;
			'', ;
			0, ;
			1, ;
			sum(Duration) ;
		from (CoverageFile)
	
	select	*, ;
			TotalTime/TimesCalled as Average ;
		from Statistics ;
		into Cursor Summary
	
	select	* ;
		from Summary ;
		into Cursor TimesCalled ;
	order by TimesCalled Desc
	go top
	brow
	
	select	* ;
		from Summary ;
		into Cursor TotalTime ;
	order by TotalTime Desc
	go top
	brow
	
endproc
Gregory
Previous
Reply
Map
View

Click here to load this message in the networking platform