How to get bytes sent/received for sync session? RRS feed

  • Question

  • maybe slightly off topic ... but how can i compute bytes sent/received over WCF during a sync?

    Can i get it from the SFx?

    I think i can get from WCF by getting values from NetworkAdapter before/after sync ... but i can't figure out how to know which network adapter was used for the sync?

    Wednesday, July 25, 2012 7:53 PM


All replies

  • have a look at this one: http://blogs.msdn.com/b/sync/archive/2010/09/24/how-to-sync-large-sql-server-databases-to-sql-azure.aspx

    look at the ChangesApplied code and see if you can modify to fit your requirements.

    • Marked as answer by P H T Friday, July 27, 2012 1:49 PM
    Thursday, July 26, 2012 3:54 AM
  • Thanks ... I can use the idea of Batches * BatchSize!

    It will not be as precise as I hoped WCF data would be ... but it will definitely put me in the ballpark (only as precise as BatchSize is configured ... large BatchSize=less precision).  Also, the example only processes data received ... if BatchSpooled and BatchApplied events do what it sounds like, I will probably use those events and compute both bytes sent and received.

    Friday, July 27, 2012 1:55 PM
  • I can't get a batch count ...

    I have my BatchSize set at 1024 and I can monitor the batching directory during a sync and do see batch files coming through.

    I subscribed to the BatchSpooled and BatchApplied events but they never get fired.  I subscribed to SyncProgress event which does get fired ... but DbSyncProgressEventArgs.BatchCount is always 0.  I could use ChangesApplied (as answered above) to count batches received if I had an equivalent way to count batches being sent.

    Any ideas on why the framework is not seeing batches (reports BatchCount=0 and does not fire batch related events)?

    Tuesday, July 31, 2012 1:57 PM
  • Which provider and where are you subscribing to the events?
    Tuesday, July 31, 2012 2:01 PM
  • SqlCeSyncProvider

    I have a method ConfigureProvider that is called when the sync button is pressed - it sets up all events.

    (also ... how/where can I use "DbSyncContext returnedContext = new DbSyncContext();" to see if is recognized as batched?)

    • Edited by P H T Tuesday, July 31, 2012 2:48 PM
    Tuesday, July 31, 2012 2:05 PM