Fossil SCM
When doing a verbose sync/pull/push, also print total uncompressed bytes sent/received, to match displayed statistics for each round trip.
Commit
9abbd35b8e77f1b1b7d32a6a969398f4e08b08581fbb4efd3f0cacfe3fd1bb73
Parent
ee07556688c6c93…
1 file changed
+8
+8
| --- src/xfer.c | ||
| +++ src/xfer.c | ||
| @@ -1852,10 +1852,11 @@ | ||
| 1852 | 1852 | int size; /* Size of a config value or uvfile */ |
| 1853 | 1853 | int origConfigRcvMask; /* Original value of configRcvMask */ |
| 1854 | 1854 | int nFileRecv; /* Number of files received */ |
| 1855 | 1855 | int mxPhantomReq = 200; /* Max number of phantoms to request per comm */ |
| 1856 | 1856 | const char *zCookie; /* Server cookie */ |
| 1857 | + i64 nUncSent, nUncRcvd; /* Bytes sent and received (before compression) */ | |
| 1857 | 1858 | i64 nSent, nRcvd; /* Bytes sent and received (after compression) */ |
| 1858 | 1859 | int cloneSeqno = 1; /* Sequence number for clones */ |
| 1859 | 1860 | Blob send; /* Text we are sending to the server */ |
| 1860 | 1861 | Blob recv; /* Reply we got back from the server */ |
| 1861 | 1862 | Xfer xfer; /* Transfer data */ |
| @@ -1913,10 +1914,11 @@ | ||
| 1913 | 1914 | blob_zero(&send); |
| 1914 | 1915 | blob_zero(&recv); |
| 1915 | 1916 | blob_zero(&xfer.err); |
| 1916 | 1917 | blob_zero(&xfer.line); |
| 1917 | 1918 | origConfigRcvMask = 0; |
| 1919 | + nUncSent = nUncRcvd = 0; | |
| 1918 | 1920 | |
| 1919 | 1921 | /* Send the send-private pragma if we are trying to sync private data */ |
| 1920 | 1922 | if( syncFlags & SYNC_PRIVATE ){ |
| 1921 | 1923 | blob_append(&send, "pragma send-private\n", -1); |
| 1922 | 1924 | } |
| @@ -2152,10 +2154,11 @@ | ||
| 2152 | 2154 | xfer.nGimmeSent = 0; |
| 2153 | 2155 | xfer.nIGotSent = 0; |
| 2154 | 2156 | xfer.nPrivIGot = 0; |
| 2155 | 2157 | |
| 2156 | 2158 | lastPctDone = -1; |
| 2159 | + nUncSent += blob_size(&send); | |
| 2157 | 2160 | blob_reset(&send); |
| 2158 | 2161 | blob_appendf(&send, "pragma client-version %d %d %d\n", |
| 2159 | 2162 | RELEASE_VERSION_NUMBER, MANIFEST_NUMERIC_DATE, |
| 2160 | 2163 | MANIFEST_NUMERIC_TIME); |
| 2161 | 2164 | rArrivalTime = db_double(0.0, "SELECT julianday('now')"); |
| @@ -2606,10 +2609,11 @@ | ||
| 2606 | 2609 | xfer.nFileRcvd, xfer.nDeltaRcvd + xfer.nDanglingFile); |
| 2607 | 2610 | }else{ |
| 2608 | 2611 | fossil_print(zBriefFormat /*works-like:"%d%d%d"*/, |
| 2609 | 2612 | nRoundtrip, nArtifactSent, nArtifactRcvd); |
| 2610 | 2613 | } |
| 2614 | + nUncRcvd += blob_size(&recv); | |
| 2611 | 2615 | blob_reset(&recv); |
| 2612 | 2616 | nCycle++; |
| 2613 | 2617 | |
| 2614 | 2618 | /* If we received one or more files on the previous exchange but |
| 2615 | 2619 | ** there are still phantoms, then go another round. |
| @@ -2671,10 +2675,14 @@ | ||
| 2671 | 2675 | |
| 2672 | 2676 | fossil_force_newline(); |
| 2673 | 2677 | fossil_print( |
| 2674 | 2678 | "%s done, sent: %lld received: %lld ip: %s\n", |
| 2675 | 2679 | zOpType, nSent, nRcvd, g.zIpAddr); |
| 2680 | + if( syncFlags & SYNC_VERBOSE ){ | |
| 2681 | + fossil_print( | |
| 2682 | + "Uncompressed sent: %lld received: %lld\n", nUncSent, nUncRcvd); | |
| 2683 | + } | |
| 2676 | 2684 | transport_close(&g.url); |
| 2677 | 2685 | transport_global_shutdown(&g.url); |
| 2678 | 2686 | if( nErr && go==2 ){ |
| 2679 | 2687 | db_multi_exec("DROP TABLE onremote; DROP TABLE unk;"); |
| 2680 | 2688 | manifest_crosslink_end(MC_PERMIT_HOOKS); |
| 2681 | 2689 |
| --- 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 |