Fossil SCM

When doing a verbose sync/pull/push, also print total uncompressed bytes sent/received, to match displayed statistics for each round trip.

danield 2021-07-13 15:21 trunk
Commit 9abbd35b8e77f1b1b7d32a6a969398f4e08b08581fbb4efd3f0cacfe3fd1bb73
1 file changed +8
+8
--- src/xfer.c
+++ src/xfer.c
@@ -1852,10 +1852,11 @@
18521852
int size; /* Size of a config value or uvfile */
18531853
int origConfigRcvMask; /* Original value of configRcvMask */
18541854
int nFileRecv; /* Number of files received */
18551855
int mxPhantomReq = 200; /* Max number of phantoms to request per comm */
18561856
const char *zCookie; /* Server cookie */
1857
+ i64 nUncSent, nUncRcvd; /* Bytes sent and received (before compression) */
18571858
i64 nSent, nRcvd; /* Bytes sent and received (after compression) */
18581859
int cloneSeqno = 1; /* Sequence number for clones */
18591860
Blob send; /* Text we are sending to the server */
18601861
Blob recv; /* Reply we got back from the server */
18611862
Xfer xfer; /* Transfer data */
@@ -1913,10 +1914,11 @@
19131914
blob_zero(&send);
19141915
blob_zero(&recv);
19151916
blob_zero(&xfer.err);
19161917
blob_zero(&xfer.line);
19171918
origConfigRcvMask = 0;
1919
+ nUncSent = nUncRcvd = 0;
19181920
19191921
/* Send the send-private pragma if we are trying to sync private data */
19201922
if( syncFlags & SYNC_PRIVATE ){
19211923
blob_append(&send, "pragma send-private\n", -1);
19221924
}
@@ -2152,10 +2154,11 @@
21522154
xfer.nGimmeSent = 0;
21532155
xfer.nIGotSent = 0;
21542156
xfer.nPrivIGot = 0;
21552157
21562158
lastPctDone = -1;
2159
+ nUncSent += blob_size(&send);
21572160
blob_reset(&send);
21582161
blob_appendf(&send, "pragma client-version %d %d %d\n",
21592162
RELEASE_VERSION_NUMBER, MANIFEST_NUMERIC_DATE,
21602163
MANIFEST_NUMERIC_TIME);
21612164
rArrivalTime = db_double(0.0, "SELECT julianday('now')");
@@ -2606,10 +2609,11 @@
26062609
xfer.nFileRcvd, xfer.nDeltaRcvd + xfer.nDanglingFile);
26072610
}else{
26082611
fossil_print(zBriefFormat /*works-like:"%d%d%d"*/,
26092612
nRoundtrip, nArtifactSent, nArtifactRcvd);
26102613
}
2614
+ nUncRcvd += blob_size(&recv);
26112615
blob_reset(&recv);
26122616
nCycle++;
26132617
26142618
/* If we received one or more files on the previous exchange but
26152619
** there are still phantoms, then go another round.
@@ -2671,10 +2675,14 @@
26712675
26722676
fossil_force_newline();
26732677
fossil_print(
26742678
"%s done, sent: %lld received: %lld ip: %s\n",
26752679
zOpType, nSent, nRcvd, g.zIpAddr);
2680
+ if( syncFlags & SYNC_VERBOSE ){
2681
+ fossil_print(
2682
+ "Uncompressed sent: %lld received: %lld\n", nUncSent, nUncRcvd);
2683
+ }
26762684
transport_close(&g.url);
26772685
transport_global_shutdown(&g.url);
26782686
if( nErr && go==2 ){
26792687
db_multi_exec("DROP TABLE onremote; DROP TABLE unk;");
26802688
manifest_crosslink_end(MC_PERMIT_HOOKS);
26812689
--- src/xfer.c
+++ src/xfer.c
@@ -1852,10 +1852,11 @@
1852 int size; /* Size of a config value or uvfile */
1853 int origConfigRcvMask; /* Original value of configRcvMask */
1854 int nFileRecv; /* Number of files received */
1855 int mxPhantomReq = 200; /* Max number of phantoms to request per comm */
1856 const char *zCookie; /* Server cookie */
 
1857 i64 nSent, nRcvd; /* Bytes sent and received (after compression) */
1858 int cloneSeqno = 1; /* Sequence number for clones */
1859 Blob send; /* Text we are sending to the server */
1860 Blob recv; /* Reply we got back from the server */
1861 Xfer xfer; /* Transfer data */
@@ -1913,10 +1914,11 @@
1913 blob_zero(&send);
1914 blob_zero(&recv);
1915 blob_zero(&xfer.err);
1916 blob_zero(&xfer.line);
1917 origConfigRcvMask = 0;
 
1918
1919 /* Send the send-private pragma if we are trying to sync private data */
1920 if( syncFlags & SYNC_PRIVATE ){
1921 blob_append(&send, "pragma send-private\n", -1);
1922 }
@@ -2152,10 +2154,11 @@
2152 xfer.nGimmeSent = 0;
2153 xfer.nIGotSent = 0;
2154 xfer.nPrivIGot = 0;
2155
2156 lastPctDone = -1;
 
2157 blob_reset(&send);
2158 blob_appendf(&send, "pragma client-version %d %d %d\n",
2159 RELEASE_VERSION_NUMBER, MANIFEST_NUMERIC_DATE,
2160 MANIFEST_NUMERIC_TIME);
2161 rArrivalTime = db_double(0.0, "SELECT julianday('now')");
@@ -2606,10 +2609,11 @@
2606 xfer.nFileRcvd, xfer.nDeltaRcvd + xfer.nDanglingFile);
2607 }else{
2608 fossil_print(zBriefFormat /*works-like:"%d%d%d"*/,
2609 nRoundtrip, nArtifactSent, nArtifactRcvd);
2610 }
 
2611 blob_reset(&recv);
2612 nCycle++;
2613
2614 /* If we received one or more files on the previous exchange but
2615 ** there are still phantoms, then go another round.
@@ -2671,10 +2675,14 @@
2671
2672 fossil_force_newline();
2673 fossil_print(
2674 "%s done, sent: %lld received: %lld ip: %s\n",
2675 zOpType, nSent, nRcvd, g.zIpAddr);
 
 
 
 
2676 transport_close(&g.url);
2677 transport_global_shutdown(&g.url);
2678 if( nErr && go==2 ){
2679 db_multi_exec("DROP TABLE onremote; DROP TABLE unk;");
2680 manifest_crosslink_end(MC_PERMIT_HOOKS);
2681
--- src/xfer.c
+++ src/xfer.c
@@ -1852,10 +1852,11 @@
1852 int size; /* Size of a config value or uvfile */
1853 int origConfigRcvMask; /* Original value of configRcvMask */
1854 int nFileRecv; /* Number of files received */
1855 int mxPhantomReq = 200; /* Max number of phantoms to request per comm */
1856 const char *zCookie; /* Server cookie */
1857 i64 nUncSent, nUncRcvd; /* Bytes sent and received (before compression) */
1858 i64 nSent, nRcvd; /* Bytes sent and received (after compression) */
1859 int cloneSeqno = 1; /* Sequence number for clones */
1860 Blob send; /* Text we are sending to the server */
1861 Blob recv; /* Reply we got back from the server */
1862 Xfer xfer; /* Transfer data */
@@ -1913,10 +1914,11 @@
1914 blob_zero(&send);
1915 blob_zero(&recv);
1916 blob_zero(&xfer.err);
1917 blob_zero(&xfer.line);
1918 origConfigRcvMask = 0;
1919 nUncSent = nUncRcvd = 0;
1920
1921 /* Send the send-private pragma if we are trying to sync private data */
1922 if( syncFlags & SYNC_PRIVATE ){
1923 blob_append(&send, "pragma send-private\n", -1);
1924 }
@@ -2152,10 +2154,11 @@
2154 xfer.nGimmeSent = 0;
2155 xfer.nIGotSent = 0;
2156 xfer.nPrivIGot = 0;
2157
2158 lastPctDone = -1;
2159 nUncSent += blob_size(&send);
2160 blob_reset(&send);
2161 blob_appendf(&send, "pragma client-version %d %d %d\n",
2162 RELEASE_VERSION_NUMBER, MANIFEST_NUMERIC_DATE,
2163 MANIFEST_NUMERIC_TIME);
2164 rArrivalTime = db_double(0.0, "SELECT julianday('now')");
@@ -2606,10 +2609,11 @@
2609 xfer.nFileRcvd, xfer.nDeltaRcvd + xfer.nDanglingFile);
2610 }else{
2611 fossil_print(zBriefFormat /*works-like:"%d%d%d"*/,
2612 nRoundtrip, nArtifactSent, nArtifactRcvd);
2613 }
2614 nUncRcvd += blob_size(&recv);
2615 blob_reset(&recv);
2616 nCycle++;
2617
2618 /* If we received one or more files on the previous exchange but
2619 ** there are still phantoms, then go another round.
@@ -2671,10 +2675,14 @@
2675
2676 fossil_force_newline();
2677 fossil_print(
2678 "%s done, sent: %lld received: %lld ip: %s\n",
2679 zOpType, nSent, nRcvd, g.zIpAddr);
2680 if( syncFlags & SYNC_VERBOSE ){
2681 fossil_print(
2682 "Uncompressed sent: %lld received: %lld\n", nUncSent, nUncRcvd);
2683 }
2684 transport_close(&g.url);
2685 transport_global_shutdown(&g.url);
2686 if( nErr && go==2 ){
2687 db_multi_exec("DROP TABLE onremote; DROP TABLE unk;");
2688 manifest_crosslink_end(MC_PERMIT_HOOKS);
2689

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button