Skip to content

Commit

Permalink
MB-6753 Provide the timestamp of TAP backfill start
Browse files Browse the repository at this point in the history
This stat is used to debug when the backfill is scheduled.

Change-Id: I50713f00419c6d20ff023c2b4ce0e0eb1fe96b70
Reviewed-on: http://review.couchbase.org/21148
Reviewed-by: Chisheng Hong <chisheng@couchbase.com>
Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Tested-by: Chisheng Hong <chisheng@couchbase.com>
  • Loading branch information
chiyoung authored and Peter Wansch committed Sep 28, 2012
1 parent fdecb33 commit 274f6bd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/stats.org
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,7 @@ another colon. For example, if your client is named, =slave1=, the
| | from disk for this connection | P |
| backfill_completed | true if all items from backfill is | P |
| | successfully transmitted to the client | P |
| backfill_start_timestamp | Timestamp of backfill start | P |
| reconnects | Number of reconnects from this client. | P |
| backfill_age | The age of the start of the backfill. | P |
| ack_seqno | The current tap ACK sequence number. | P |
Expand Down
5 changes: 4 additions & 1 deletion src/tapconnection.cc
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,8 @@ TapProducer::TapProducer(EventuallyPersistentEngine &theEngine,
isSeqNumRotated(false),
numNoops(0),
tapFlagByteorderSupport(false),
specificData(NULL)
specificData(NULL),
backfillTimestamp(0)
{
evaluateFlags();
queue = new std::list<queued_item>;
Expand Down Expand Up @@ -1255,6 +1256,7 @@ void TapProducer::addStats(ADD_STAT add_stat, const void *c) {
addStat("pending_backfill", isPendingBackfill_UNLOCKED(), add_stat, c);
addStat("pending_disk_backfill", diskBackfillCounter > 0, add_stat, c);
addStat("backfill_completed", isBackfillCompleted_UNLOCKED(), add_stat, c);
addStat("backfill_start_timestamp", backfillTimestamp, add_stat, c);

addStat("queue_memory", getQueueMemory(), add_stat, c);
addStat("queue_fill", getQueueFillTotal(), add_stat, c);
Expand Down Expand Up @@ -1757,6 +1759,7 @@ void TapProducer::scheduleBackfill_UNLOCKED(const std::vector<uint16_t> &vblist)
if (new_vblist.size() > 0) {
doRunBackfill = true;
backfillCompleted = false;
backfillTimestamp = ep_real_time();
}
}

Expand Down
2 changes: 2 additions & 0 deletions src/tapconnection.hh
Original file line number Diff line number Diff line change
Expand Up @@ -1161,6 +1161,8 @@ private:

//! EP-engine specific item info
uint8_t *specificData;
//! Timestamp of backfill start
time_t backfillTimestamp;

DISALLOW_COPY_AND_ASSIGN(TapProducer);
};
Expand Down

0 comments on commit 274f6bd

Please sign in to comment.