File tree Expand file tree Collapse file tree 5 files changed +58
-2
lines changed
FirebirdSql.Data.FirebirdClient.Tests
FirebirdSql.Data.FirebirdClient Expand file tree Collapse file tree 5 files changed +58
-2
lines changed Original file line number Diff line number Diff line change @@ -69,6 +69,7 @@ void BackupPart()
69
69
backupSvc . Options = FbBackupFlags . IgnoreLimbo ;
70
70
backupSvc . BackupFiles . Add ( new FbBackupFile ( backupName , 2048 ) ) ;
71
71
backupSvc . Verbose = true ;
72
+ backupSvc . Statistics = FbBackupRestoreStatistics . TotalTime | FbBackupRestoreStatistics . TimeDelta ;
72
73
73
74
backupSvc . ServiceOutput += ServiceOutput ;
74
75
@@ -82,6 +83,7 @@ void RestorePart()
82
83
restoreSvc . Options = FbRestoreFlags . Create | FbRestoreFlags . Replace ;
83
84
restoreSvc . PageSize = FbTestsSetup . PageSize ;
84
85
restoreSvc . Verbose = true ;
86
+ restoreSvc . Statistics = FbBackupRestoreStatistics . TotalTime | FbBackupRestoreStatistics . TimeDelta ;
85
87
restoreSvc . BackupFiles . Add ( new FbBackupFile ( backupName , 2048 ) ) ;
86
88
87
89
restoreSvc . ServiceOutput += ServiceOutput ;
Original file line number Diff line number Diff line change @@ -452,7 +452,7 @@ internal static class IscCodes
452
452
public const int isc_spb_bkp_factor = 6 ;
453
453
public const int isc_spb_bkp_length = 7 ;
454
454
public const int isc_spb_bkp_skip_data = 8 ;
455
-
455
+ public const int isc_spb_bkp_stat = 15 ;
456
456
public const int isc_spb_bkp_ignore_checksums = 0x01 ;
457
457
public const int isc_spb_bkp_ignore_limbo = 0x02 ;
458
458
public const int isc_spb_bkp_metadata_only = 0x04 ;
@@ -472,7 +472,9 @@ internal static class IscCodes
472
472
public const int isc_spb_res_page_size = 10 ;
473
473
public const int isc_spb_res_length = 11 ;
474
474
public const int isc_spb_res_access_mode = 12 ;
475
-
475
+ public const int isc_spb_res_fix_fss_data = 13 ;
476
+ public const int isc_spb_res_fix_fss_metadata = 14 ;
477
+ public const int isc_spb_res_stat = isc_spb_bkp_stat ;
476
478
public const int isc_spb_res_metadata_only = isc_spb_bkp_metadata_only ;
477
479
public const int isc_spb_res_deactivate_idx = 0x0100 ;
478
480
public const int isc_spb_res_no_shadow = 0x0200 ;
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ public sealed class FbBackup : FbService
28
28
public int Factor { get ; set ; }
29
29
public string SkipData { get ; set ; }
30
30
public FbBackupFlags Options { get ; set ; }
31
+ public FbBackupRestoreStatistics Statistics { get ; set ; }
31
32
32
33
public FbBackup ( string connectionString = null )
33
34
: base ( connectionString )
@@ -57,6 +58,7 @@ public void Execute()
57
58
if ( ! string . IsNullOrEmpty ( SkipData ) )
58
59
StartSpb . Append ( IscCodes . isc_spb_bkp_skip_data , SkipData ) ;
59
60
StartSpb . Append ( IscCodes . isc_spb_options , ( int ) Options ) ;
61
+ StartSpb . Append ( IscCodes . isc_spb_bkp_stat , Statistics . BuildConfiguration ( ) ) ;
60
62
61
63
Open ( ) ;
62
64
StartTask ( ) ;
Original file line number Diff line number Diff line change
1
+ /*
2
+ * The contents of this file are subject to the Initial
3
+ * Developer's Public License Version 1.0 (the "License");
4
+ * you may not use this file except in compliance with the
5
+ * License. You may obtain a copy of the License at
6
+ * https://github.com/FirebirdSQL/NETProvider/blob/master/license.txt.
7
+ *
8
+ * Software distributed under the License is distributed on
9
+ * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either
10
+ * express or implied. See the License for the specific
11
+ * language governing rights and limitations under the License.
12
+ *
13
+ * All Rights Reserved.
14
+ */
15
+
16
+ //$Authors = Jiri Cincura ([email protected] )
17
+
18
+ using System ;
19
+ using System . Text ;
20
+
21
+ namespace FirebirdSql . Data . Services
22
+ {
23
+ [ Flags ]
24
+ public enum FbBackupRestoreStatistics
25
+ {
26
+ TotalTime = 0b0001 ,
27
+ TimeDelta = 0b0010 ,
28
+ PageReads = 0b0100 ,
29
+ PageWrites = 0b1000 ,
30
+ }
31
+
32
+ internal static class Ext
33
+ {
34
+ public static string BuildConfiguration ( this FbBackupRestoreStatistics statistics )
35
+ {
36
+ var sb = new StringBuilder ( ) ;
37
+ if ( statistics . HasFlag ( FbBackupRestoreStatistics . TotalTime ) )
38
+ sb . Append ( "T" ) ;
39
+ if ( statistics . HasFlag ( FbBackupRestoreStatistics . TimeDelta ) )
40
+ sb . Append ( "D" ) ;
41
+ if ( statistics . HasFlag ( FbBackupRestoreStatistics . PageReads ) )
42
+ sb . Append ( "R" ) ;
43
+ if ( statistics . HasFlag ( FbBackupRestoreStatistics . PageWrites ) )
44
+ sb . Append ( "W" ) ;
45
+ return sb . ToString ( ) ;
46
+ }
47
+ }
48
+ }
Original file line number Diff line number Diff line change @@ -42,6 +42,7 @@ public int? PageSize
42
42
public bool ReadOnly { get ; set ; }
43
43
public string SkipData { get ; set ; }
44
44
public FbRestoreFlags Options { get ; set ; }
45
+ public FbBackupRestoreStatistics Statistics { get ; set ; }
45
46
46
47
public FbRestore ( string connectionString = null )
47
48
: base ( connectionString )
@@ -72,6 +73,7 @@ public void Execute()
72
73
if ( ! string . IsNullOrEmpty ( SkipData ) )
73
74
StartSpb . Append ( IscCodes . isc_spb_res_skip_data , SkipData ) ;
74
75
StartSpb . Append ( IscCodes . isc_spb_options , ( int ) Options ) ;
76
+ StartSpb . Append ( IscCodes . isc_spb_res_stat , Statistics . BuildConfiguration ( ) ) ;
75
77
76
78
Open ( ) ;
77
79
StartTask ( ) ;
You can’t perform that action at this time.
0 commit comments