Hi Martin,
> What I am after is someone to tell how much data is been replicated and
> where we are in the process.
In CouchDB, the replicator status(*) provides:
- source_seq
- checkpointed_source_seq
The checkpointed_source_seq is originally at some value, typically
the value of the last replication's checkpointed_source_seq, which is
(in CouchDB) stored in a local variable inside the source database.
That value is updated as the documents are successfully replicated into
the target database. (The source_seq is also updated if new documents
are inserted in the source, at least for continuous replications.)
This gives you the total number of documents to transfer, that is
source_seq - original-checkpointed_source_seq
and the number of documents left to be transferred, i.e.
source_seq - checkpointed_source_seq
Divide the later by the former and you get a neat `progress` value.
Reading the docs [1] I suspect that you can get the equivalent of
`checkpointed_source_seq` in the `last_seq` value of the parameter of
the `change` event associated with a replication. (This would have to be
confirmed.) You might have to manually retrieve the `source_seq` from
the source.
S.
(*) e.g.
http://127.0.0.1:5984/_active_tasks
[1]
http://pouchdb.com/api.html#replication , under "Example Response"
--
tel:
+33643482771
http://stephane.shimaore.net/