Hi all -

I've landed some cleanup/formatting changes for the msgcompose:5 
variable's logfile output:

* It now displays in seconds, instead of milliseconds (but rounds 
accurately just as you would report the numbers officially).
* General cleanup, especially labeling the delta time, total time, etc.

It's not automatic, if you'd like to enable it, follow these instructions:

For all platforms, you'll need to edit your prefs.js file in your user 
directory (make sure you do this when Mozilla isn't running):

Add this line in:

user_pref("mailnews.logComposePerformance", true);

Then, follow these instructions for each platform:

    Windows 95/98:   Create "c:\tmp" for the log file to reside in if
    the directory does not exist. Insert the following lines into your
    autoexec.bat file:

        Set NSPR_LOG_MODULES=msgcompose:5
        Set NSPR_LOG_FILE=c:\tmp\[filename]

        The filename can be defined by you.  Reboot.

    WinNT: Use the Control Panel | System | Environment tool to set the
    PRLOG env variables.

        Variables: NSPR_LOG_MODULES   Value: msgcompose:5
        Variables: NSPR_LOG_FILE    Value: c:\tmp\[filename]

        Follow the remaining steps for Windows 95/98 above.

    Mac: Create a text file that contains the desired commands in a text
    editor such as BBEdit:

        ARGS: -mail
        ENV:NSPR_LOG_MODULES=msgcompose:5
        ENV:NSPR_LOG_FILE=[filename]

        The filename can be defined by you.  Save this file and drag and
        drop this file on the Netscape/Mozilla application icon.  The
        log file is created in the seamonkey folder.

    Unix (e.g., for csh shells):  Add the following lines to ~/.cshrc
    file of the csh shell:

        setenv NSPR_LOG_MODULES msgcompose:5
        setenv NSPR_LOG_FILE /u/[unix userlogin]/tmp/[filename]

        The filename can be defined by you.


- Stephen

http://bugzilla.mozilla.org/show_bug.cgi?id=99580

Title: Bug 99580 - Various cleanup ideas for msgcompose:5 logging.
Bugzilla version 2.15

This is Bugzilla: the Mozilla bug system. For more information about what Bugzilla is and what it can do, see mozilla.org's bug pages.

Bugzilla Bug 99580
  Various cleanup ideas for msgcompose:5 logging.
Bug List: (8 of 9) First Last Prev Next   Show list      Query page      Enter new bug
Bug#:99580   Platform: All DEC HP Macintosh PC SGI Sun Other   Reporter:[EMAIL PROTECTED] (Stephen Donner)
Product: Browser Browser Localizations Bugzilla Calendar CCK Derivatives Directory Documentation Grendel JSS MailNews mozilla.org MozillaClassic NSPR NSS PSM Rhino Tech Evangelism Webtools   OS: All Windows 3.1 Windows 95 Windows 98 Windows ME Windows 2000 Windows NT Windows XP Mac System 7 Mac System 7.5 Mac System 7.6.1 Mac System 8.0 Mac System 8.5 Mac System 8.6 Mac System 9.x MacOS X Linux BSDI FreeBSD NetBSD OpenBSD AIX BeOS HP-UX IRIX Neutrino OpenVMS OS/2 OSF/1 Solaris SunOS other   Add CC:
Component: Account Manager Address Book BiDi Hebrew & Arabic Composition Filters Internationalization LDAP Mail/News Integration Localization Mail Back End Mail Database Mail Window Front End MIME Movemail Networking - General Networking - IMAP Networking - News Networking - POP Networking - SMTP Offline Printing Profile Migration Search Security: General Simple MAPI Subscribe   Version: other   CC: [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED]
Remove selected CCs
Status: RESOLVED   Priority: -- P1 P2 P3 P4 P5  
Resolution: FIXED   Severity: blocker critical major normal minor trivial enhancement  
Assigned To: [EMAIL PROTECTED] (Stephen Donner)   Target Milestone: M3 M4 M5 M6 M7 M8 M9 M10 M11 M12 M13 M14 M15 M16 M17 M18 mozilla0.6 mozilla0.8 mozilla0.8.1 mozilla0.9 mozilla0.9.1 mozilla0.9.2 mozilla0.9.3 mozilla0.9.4 mozilla0.9.5 --- mozilla0.9.6 mozilla0.9.7 mozilla0.9.8 mozilla0.9.9 mozilla1.0 mozilla1.0.1 mozilla1.1 mozilla1.2 Future  
QA Contact:
URL:
Summary:
Status Whiteboard:
Keywords:

Attachment Type Modified Status Actions
Cleans up formatting a tiny bit patch 09/14/01 15:00 none Edit
Sample output so far text/plain 09/14/01 15:01 none Edit
Patch V2.0 patch 12/20/01 12:36 has-review
has-super-review
Edit
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 99580 depends on: Show dependency tree
Show dependency graph
Bug 99580 blocks:
Votes: 0    Show votes for this bug    Vote for this bug

Additional Comments:


Leave as RESOLVED FIXED
Reopen bug
Mark bug as VERIFIED
Mark bug as CLOSED

View Bug Activity   |   Format For Printing

Description: Opened: 2001-09-14 01:09

Here is a sample current log, with *my* comments as C++ style comments: 

0[a3deb0c]: 

// before we do the seperator below, we should make columns like "[process]: 
[total milliseconds] [function time in milliseconds]"

-------------------- 
0[a3deb0c]: [ 0][ 0] - Start opening the window, message size = 22518

// we should list the above '22518' bytes in kilobytes, I think

0[a3deb0c]: [ 1515][ 1515] - Start Initializing the compose window 
(ComposeLoad) 

0[a3deb0c]: [ 2364][ 849] - Done with the initialization (ComposeLoad). Waiting 
on editor to load about::blank

0[a3deb0c]: [ 2618][ 254] - Editor is done loading about::blank. Now let mime 
do its job 

// about: blank is 'new window time', so we should comment to that effect

0[a3deb0c]: [ 3509][ 891] - done with mime. Time to insert the body 
0[a3deb0c]: [ 3852][ 343] - Finished inserting data into the editor. The window 
is almost ready! 
0[a3deb0c]: [ 4644][ 792] - addressing widget, windows title and focus are now 
set. The window is finally ready


------- Additional Comment #1 From Stephen Donner 2001-09-14 01:10 -------
I should have a patch for this very soon.


------- Additional Comment #2 From Stephen Donner 2001-09-14 15:00 -------
Created an attachment (id=49387)
Cleans up formatting a tiny bit


------- Additional Comment #3 From Stephen Donner 2001-09-14 15:01 -------
Created an attachment (id=49388)
Sample output so far


------- Additional Comment #4 From Stephen Donner 2001-09-14 15:07 -------
The 2 things remaining that I'll need help with are:

1.  Either get rid of the process at the top of the output or get rid of it on
the left side of each output line.  We only need to know the process once, since
running multiple windows or replies starts the output on a new line \n and one
process ID per output module is fine.
2.  I really would like the milliseconds to be output instead in seconds. 
Instead of rounding, we should just do:

1234 (in ms) would become 1.23 seconds.

And I'd like to see that logged as:

[ 12.7][   0.064] - Done with the initialization (ComposeLoad). Waiting on editor
to load about:blank



------- Additional Comment #5 From Stephen Donner 2001-09-14 15:08 -------
I meant this line:

0[324410]: [ 1275][   64] - Done with the initialization (ComposeLoad). Waiting
on editor to load about:blank



------- Additional Comment #6 From Stephen Donner 2001-09-14 15:09 -------
Typo, I meant:

it would become:

[ 1.274][   0.064] - Done with the initialization (ComposeLoad). Waiting on editor
to load about:blank




------- Additional Comment #7 From Sheela Ravindran 2001-12-14 15:34 -------
Stephen,
Is this fixed or still not complete?


------- Additional Comment #8 From Stephen Donner 2001-12-14 15:39 -------
Sheela, nope, not yet.  Jean-Francois, do you object to anything in my patch?


------- Additional Comment #9 From Jean-Francois Ducarroz 2001-12-14 15:54 -------
(From update of attachment 49387)
be award than "This is new window time" is in fact the time for a new msg
compose window! it's a little bit more than a new window time in the generic
sense of it. R=ducarroz


------- Additional Comment #10 From Jean-Francois Ducarroz 2001-12-14 16:00 -------
if you want ot display the time in sec rather than millisec, change the line:

  PR_LOG(MsgComposeLogModule, PR_LOG_ALWAYS, ("[%5d][%5d] - %s\n", totalTime,
deltaTime, label));

to
  PR_LOG(MsgComposeLogModule, PR_LOG_ALWAYS, ("[%3.2f][%3.2f] - %s\n",
(double)totalTime/100.0, (double)deltaTime/100.0, label));

same for the printf line above and you might have to add a column in the header.
You are welcom to reassign this bug to yourself


------- Additional Comment #11 From Stephen Donner 2001-12-16 21:37 -------
Jean-Francois, can you help me declare the variables in C++?

I only know JS:

c:\moz_src\mozilla\mailnews\compose\src\nsMsgComposeService.cpp(531) : error
C2065: 'totalTime' : undeclared identifier
c:\moz_src\mozilla\mailnews\compose\src\nsMsgComposeService.cpp(531) : error
C2065: 'deltaTime' : undeclared identifier


------- Additional Comment #12 From Jean-Francois Ducarroz 2001-12-17 11:53 -------
Reassign to stephen. Seems a good exercise for him...


------- Additional Comment #13 From Stephen Donner 2001-12-20 12:36 -------
Created an attachment (id=62400)
Patch V2.0


------- Additional Comment #14 From Stephen Donner 2001-12-20 12:37 -------
New sample output

0[324470]: 
[process]: [totalTime][deltaTime]
--------------------
0[324470]: [0.01][0.01] - Start opening the window, message size = 1361
0[324470]: [0.80][0.80] - Start initializing the compose window (ComposeLoad)
0[324470]: [0.84][0.05] - Done with the initialization (ComposeLoad). Waiting 
on editor to load about:blank
0[324470]: [0.94][0.10] - Editor is done loading about:blank. This is New 
Compose window time.  Time for MIME.
0[324470]: [0.96][0.03] - Done with MIME. Now we're updating the UI elements
0[324470]: [1.06][0.10] - Addressing widget, window title and focus are now 
set, time to insert the body
0[324470]: [1.11][0.06] - Finished inserting data into the editor. The window 
is finally ready!


------- Additional Comment #15 From Stephen Donner 2001-12-20 12:38 -------
Jean-Francois, I think with your help yesterday, that this is ready to go.  Can 
I get another r=?  Thanks.


------- Additional Comment #16 From Jean-Francois Ducarroz 2001-12-20 21:22 -------
(From update of attachment 62400)
R=ducarroz


------- Additional Comment #17 From [EMAIL PROTECTED] 2001-12-21 14:06 -------
(From update of attachment 62400)
sr=mscott


------- Additional Comment #18 From Stephen Donner 2001-12-30 16:29 -------
C:\moz_src\mozilla\mailnews\compose\src>cvs commit -m "Bug 99580. 
Cleanup/formatting for msgcompose:5 logging.  [EMAIL PROTECTED],
[EMAIL PROTECTED]" nsMsgCompose.cpp
Checking in nsMsgCompose.cpp;
/cvsroot/mozilla/mailnews/compose/src/nsMsgCompose.cpp,v  <--  nsMsgCompose.cpp
new revision: 1.313; previous revision: 1.312
done

C:\moz_src\mozilla\mailnews\compose\src>cvs commit -m "Bug 99580. 
Cleanup/formatting for msgcompose:5 logging.  [EMAIL PROTECTED],
[EMAIL PROTECTED]" nsMsgComposeService.cpp
Checking in nsMsgComposeService.cpp;
/cvsroot/mozilla/mailnews/compose/src/nsMsgComposeService.cpp,v  <-- 
nsMsgComposeService.cpp
new revision: 1.61; previous revision: 1.60
done

Fixed.  Thanks for the help, Jean-Francois, and Mscott for the review.

Bug List: (8 of 9) First Last Prev Next   Show list      Query page      Enter new bug
This is Bugzilla: the Mozilla bug system. For more information about what Bugzilla is and what it can do, see mozilla.org's bug pages.
Actions: New | Query | bug # | Reports | My votes   Edit prefs , users | Log out [EMAIL PROTECTED]
Preset Queries: My bugs | Assigned Bugs | Resolved | Triage | Unconfirmed

Reply via email to