Link to home
Start Free TrialLog in
Avatar of Mike Jacobs
Mike JacobsFlag for United Kingdom of Great Britain and Northern Ireland

asked on

VFP "COVERAGE" CONFUSION

I need help from someone familiar with VFP "Coverage"

Concerned with how long some of my forms take to load, I've rigged it such that, in development mode, on loading any form, it will ask if I want to set coverage on and, if so, it sets coverage to (formname).csv.

To review the results I suck the csv data into a COVERAGE.DBF table ordered by METHOD and run a report which itemises every method called, how long each one runs, how many times they're called and the total time spent running any given method.

All of which works like a charm and has helped me to refactor and streamline my software.

Today I hit a problem which I don't understand.

The form I'm trying to analyse is reported as having 49 calls to its LOAD method.

This made no sense, so I inserted a global counter as first line in the method. It reported, as I expected, just one call to the method.

What am I missing?
Avatar of Pavel Celba
Pavel Celba
Flag of Czechia image

Maybe just invalid count from the coverage output... Or the Load method from widely used form class...

Could you please post the Load method code and also the CSV containing these 49 calls?
Avatar of Mike Jacobs

ASKER

Partial retraction!

Been more than a year since I last ran this exercise and I'd forgotten (and misinterpreted) the meaning of the data column which actually refers to "line number" and has nothing to do with the number of times a method is called!  For that I simply need a counter for "Method". However, that correction still produces a result showing 31 calls to the load method.

Your question, however, reminded me that I was only reviewing totals. I'll revise the report to allow itemised calls and see if that throws any light on the problem. Watch this space...
ASKER CERTIFIED SOLUTION
Avatar of Olaf Doschke
Olaf Doschke
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Olaf, that's a very helpful summary of how it works and has helped me to understand what I'm seeing.

I'll now revisit by coverage logs with all that in mind and see if I can now figure out what's going on!
Gald it helped you. Just note, that it's not always helpful to group by the stack level, as I did. Since the log is simply chronological, It's a good idea as you already did to split logs per class or object or form or even per method, it just gets unwieldy, if you split up too much.

You can put keywords into the log by calling procedures with specific names like start and stop and of course, you can also log procedures you create on the fly by executing them via EXECSCRIPT, that can also give you lines to split a log file.

Bye, Olaf.