Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TimeStamp in the every line output gbak.exe utility [CORE1999] #2436

Closed
firebird-automations opened this issue Jul 17, 2008 · 22 comments
Closed

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Oleg Matveyev (o_matveev)

Block progress on DNET633

Attachments:
core_1999_25.zip

Votes: 5

Hi, All.
For the best analyze time of database restore, very helpful show date and time in every line output gbak:

17.07.2008 14:16:01 gbak: activating and creating deferred index RDB$PRIMARY1
17.07.2008 14:18:10 gbak: activating and creating deferred index RDB$FOREIGN319
17.07.2008 14:19:15 gbak: committing metadata
17.07.2008 14:20:24 gbak:finishing, closing, and going home

P.S. Output optionaly, by switch -pi (performance info) for gbak.exe

Commits: c2fd343 8b684a4 be4c021 b77bf19 FirebirdSQL/fbt-repository@72c1dcc FirebirdSQL/fbt-repository@a5aa2b2 FirebirdSQL/fbt-repository@b104c93 FirebirdSQL/fbt-repository@12ae8ef

====== Test Details ======

Note: failing of this test can be evidence of regression in fixed CORE4897.

@firebird-automations
Copy link
Collaborator Author

Modified by: Oleg Matveyev (o_matveev)

priority: Major [ 3 ] => Minor [ 4 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: Oleg Matveyev (o_matveev)

Version: 2.0.4 [ 10211 ]

Version: 2.1.0 [ 10041 ]

Version: 2.1 RC2 [ 10250 ]

Version: 2.5 Initial [ 10260 ]

Version: 2.1 RC1 [ 10201 ]

Version: 1.5.5 [ 10220 ]

Version: 2.1 Beta 2 [ 10190 ]

Version: 2.0.3 [ 10200 ]

Version: 2.0.2 [ 10130 ]

Version: 2.1 Beta 1 [ 10141 ]

Version: 2.1 Alpha 1 [ 10150 ]

Version: 2.0.1 [ 10090 ]

Version: 1.5.4 [ 10100 ]

Version: 2.0.0 [ 10091 ]

Version: 1.0.3 [ 10006 ]

Version: 2.1.1 [ 10223 ]

Version: 2.5 Alpha 1 [ 10224 ]

Version: 2.5 Beta 1 [ 10251 ]

Version: 2.1.2 [ 10270 ]

Version: 1.5.6 [ 10225 ]

Version: 2.0.5 [ 10222 ]

Version: 2.5.0 [ 10221 ]

Version: 3.0.0 [ 10048 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: Oleg Matveyev (o_matveev)

Version: 2.0.4 [ 10211 ] =>

Version: 2.1.0 [ 10041 ] =>

Version: 2.1 RC2 [ 10250 ] =>

Version: 2.5 Initial [ 10260 ] =>

Version: 2.1 RC1 [ 10201 ] =>

Version: 1.5.5 [ 10220 ] =>

Version: 2.1 Beta 2 [ 10190 ] =>

Version: 2.0.3 [ 10200 ] =>

Version: 2.1 Beta 1 [ 10141 ] =>

Version: 2.1 Alpha 1 [ 10150 ] =>

Version: 2.0.1 [ 10090 ] =>

Version: 1.5.4 [ 10100 ] =>

Version: 2.0.0 [ 10091 ] =>

Version: 1.0.3 [ 10006 ] =>

Version: 2.1.1 [ 10223 ] =>

Version: 2.5 Alpha 1 [ 10224 ] =>

Version: 2.5 Beta 1 [ 10251 ] =>

Version: 2.1.2 [ 10270 ] =>

Version: 1.5.6 [ 10225 ] =>

Version: 2.0.5 [ 10222 ] =>

Version: 2.5.0 [ 10221 ] =>

Version: 2.0.2 [ 10130 ] =>

@firebird-automations
Copy link
Collaborator Author

Modified by: Oleg Matveyev (o_matveev)

Version: 3.0.0 [ 10048 ] =>

@firebird-automations
Copy link
Collaborator Author

Commented by: @cincuranet

-pi isn't probably the right name. I would rather see something like "show timestamps" or -st. Or just "timestamps" -ts".

@firebird-automations
Copy link
Collaborator Author

Commented by: Valdir Marcos (valdir_marcos)

Could you also calculate the time spent (Finish Timestamp - Start Timestamp) as the last information printed?
Could you extend those information to the other FB utilities like gfix, gstat, isql, nbackup, etc?

All those timestamp information would be very helpful.

@firebird-automations
Copy link
Collaborator Author

Commented by: Brenden Walker (braindead)

Just chiming in that we (DRB Systems Inc) would like to see this enhancement implemented.

@firebird-automations
Copy link
Collaborator Author

Modified by: @hvlad

assignee: Vlad Khorsun [ hvlad ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @hvlad

gbak verbose output with runtime statistics

gbak now could show some runtime statistics in its verbose output. New command-
line switch STATISTICS is added to define which statistics items should be
used. Currently there are support for four items is implemented:
time total - time spend since start of gbak process
time delta - time spend since previous output line
page reads - number of pages read since previous output line
page writes - number of pages write since previous output line.

Mandatory string parameter of STATISTICS switch is used to specify necessary
stats items. Every stats item is identified by its own characters:
T - time total
D - time delta
R - page reads
W - page writes.

Order and case of characters in parameter value is not important, i.e. "TDRW"
and "WdrT" is the same. If verbose output was not specified (i.e. nor VERBOSE
nor VERBINT is not present), STATISTICS will have no effect. Both time items
shows time in seconds with milliseconds (3 digits after decimal point). Other
items shown as whole numbers.

For users convenience, two special lines in verbose output is added:
- line with stats headers (only specified items are present), printed before
other lines with statistics:

gbak: time delta reads writes

- line with total statistics, printed after end of main process:

gbak: 46\.684 0\.002 171 82442 total statistics

In this line both time items have the same meaning as in other lines but
read\write items show summary values.

New feature is fully supported at Services API. New SPB item is introduced:

#⁠define isc\_spb\_bkp\_stat                 15

and its synonim

#⁠define isc\_spb\_res\_stat				isc\_spb\_bkp\_stat

Usage
isc_spb_bkp_stat, <len>, <string>
isc_spb_res_stat, <len>, <string>

where
<len> is 2-bytes length of following string parameter, and
<string> is 1-4 bytes string with one character per stats item.

fbsvcmgr utility also updated and supports new SPB tags.

Examples:
a) gbak usage screen with description of new switch
-ST(ATISTICS) TDRW show statistics:
T time from start
D delta time
R page reads
W page writes

b) show total time since gbak start
-STATISTICS T

c) show delta time and page reads
-STATISTICS DR

d) show all stat items
-STATISTICS TDRW

e) sample of gbak output

firebird>gbak -v -stat tdrw -r a.fbk a.fdb
gbak:opened file a.fbk
gbak: time delta reads writes
gbak: 0.173 0.173 0 0 transportable backup -- data in XDR format
gbak: 0.175 0.002 0 0 backup file is compressed
gbak: 0.177 0.001 0 0 backup version is 10
gbak: 0.270 0.092 0 650 created database a.fdb, page_size 8192 bytes
gbak: 0.273 0.002 0 2 started transaction
...
gbak: 18.661 0.002 0 0 restoring data for table TEST1
gbak: 18.698 0.036 0 0 10000 records restored
...
gbak: 25.177 0.036 0 0 1770000 records restored
gbak: 25.220 0.042 0 1633 1780000 records restored
...
gbak: 38.702 0.002 0 0 restoring privilege for user SYSDBA
gbak: 38.707 0.004 22 0 creating indexes
gbak: 45.015 6.308 82 38394 activating and creating deferred index T2_VAL
...
gbak: 46.682 0.008 4 13 finishing, closing, and going home
gbak: 46.684 0.002 171 82442 total statistics
gbak:adjusting the ONLINE and FORCED WRITES flags

@firebird-automations
Copy link
Collaborator Author

Modified by: @hvlad

status: Open [ 1 ] => Open [ 1 ]

Target: 3.0 RC 1 [ 10584 ]

Fix Version: 3.0 RC 1 [ 10584 ]

Component: API / Client Library [ 10040 ]

Component: Engine [ 10000 ]

Component: SVCMGR [ 10141 ]

Planning Status: Considered for inclusion

@firebird-automations
Copy link
Collaborator Author

Commented by: @hvlad

Depending on users feedback it could be backported into v2.5

@firebird-automations
Copy link
Collaborator Author

Modified by: @hvlad

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Resolved [ 5 ]

QA Status: Deferred

Test Details: Restore using FBSVCMGR can produce broken logs! Can`t implement test until CORE4897 will be fixed.

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Resolved [ 5 ]

QA Status: Deferred => Done successfully

Test Details: Restore using FBSVCMGR can produce broken logs! Can`t implement test until CORE4897 will be fixed. => Note: failing of this test can be evidence of regression in fixed CORE4897.

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Resolved [ 5 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Closed [ 6 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @cincuranet

Link: This issue block progress on DNET633 [ DNET633 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @hvlad

Backported into v2.5.5

@firebird-automations
Copy link
Collaborator Author

Modified by: @hvlad

Fix Version: 2.5.5 [ 10670 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @pavel-zotov

> Vlad Khorsun added a comment - 27/Oct/15 11:25 AM
> Backported into v2.5.5

It seems that FBSVCMGR of 2.5.5 does not understand 'res_stat tdrw' as command arguments.

command #⁠1

C:\MIX\firebird\fb25\bin\fbsvcmgr localhost:service_mgr user SYSDBA password masterkey action_restore bkp_file C:/MIX/firebird/QA/fbt-repo/tmp/tmp_core_1999_25.fbk dbname C:/MIX/firebird/QA/fbt-repo/tmp/tmp_core_1999_25.fd1 res_replace verbose

STDOUT: <runs OK, producing verbose output of restoring process>.
STDERR: empty.

command #⁠2

C:\MIX\firebird\fb25\bin\fbsvcmgr localhost:service_mgr user SYSDBA password masterkey action_restore bkp_file C:/MIX/firebird/QA/fbt-repo/tmp/tmp_core_1999_25.fbk dbname C:/MIX/firebird/QA/fbt-repo/tmp/tmp_core_1999_25.fd1 res_replace verbose res_stat tdrw

STDERR: unrecognized service parameter block

Checked on Firebird Trace utility version WI-V2.5.5.26949 Firebird 2.5
Test .fbk is in attached .zip file

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

Attachment: core_1999_25.zip [ 12833 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @hvlad

Fixed, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment