[SERVER-26111] log initial sync stats as iso dates instead of time_t integers Created: 14/Sep/16  Updated: 06/Dec/22

Status: Backlog
Project: Core Server
Component/s: Replication
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Eric Milkie Assignee: Backlog - Replication Team
Resolution: Unresolved Votes: 0
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Replication
Participants:

 Description   

Current format:
initialSyncStart: new Date(1473864986956),
Proposed format:
initialSyncStart: 2016-09-14T10:56:26.000+0000,

Full line:

[js_test:role_management_commands_sharded_wc_1] 2016-09-14T14:56:41.356+0000 c20763| 2016-09-14T14:56:41.355+0000 I REPL     [initial sync] Initial Sync Statistics: { failedInitialSyncAttempts: 0, maxFailedInitialSyncAttempts: 10, initialSyncStart: new Date(1473864986956), initialSyncEnd: new Date(1473865001355), initialSyncElapsedMillis: 14399, initialSyncAttempts: [ { durationMillis: 805, status: "OK", syncSource: "localhost:20762" } ], fetchedMissingDocs: 0, appliedOps: 0, databases: { databasesCloned: 1, admin: { collections: 1, clonedCollections: 1, start: new Date(1473865000553), end: new Date(1473865001353), elapsedMillis: 800, admin.system.version: { documents: 1, indexes: 1, fetchedBatches: 1, start: new Date(1473865000597), end: new Date(1473865001353), elapsedMillis: 756 } } } }



 Comments   
Comment by Scott Hernandez (Inactive) [ 14/Sep/16 ]

It is already bson, so it should be easy to just convert to an extended json string.

Comment by Andy Schwerin [ 14/Sep/16 ]

The Date constructor also accepts strings in ISO date format. You could do either MongoDB extended json or javascript eval json. I'd prefer mongodb extended json, personally.

Comment by Scott Hernandez (Inactive) [ 14/Sep/16 ]

The only issue is that isn't parseable (as it will be a string). One of the goal of the stats was to be bson/json parseable.

We could use extended json notation using $date :

{"$date":"2010-01-01T00:00:00Z"}

Generated at Thu Feb 08 04:11:11 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.