Skip to content

Commit b1545f4

Browse files
committed
trivial: keep mongo shell pretty format for mongoreplay examples for maintainability
1 parent 9428885 commit b1545f4

File tree

1 file changed

+152
-55
lines changed

1 file changed

+152
-55
lines changed

source/reference/program/mongoreplay.txt

Lines changed: 152 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -254,25 +254,35 @@ The following is an example record from a JSON-formatted
254254
"payload" : {
255255
"$db" : "test",
256256
"aggregate" : "restaurants",
257-
"cursor" : {},
257+
"cursor" : {
258+
259+
},
258260
"lsid" : {
259261
"id" : {
260-
"$binary" : "sZEBzZOQRwe3+t/bJuLORQ==",
262+
"$binary" : "esmcqhiXSIWSpKGb4sOekw==",
261263
"$type" : "04"
262264
}
263265
},
264266
"pipeline" : [
265-
{ "$match" : { "borough" : "Manhattan" } },
266-
{ "$group" : { "_id" : "$cuisine" } }
267+
{
268+
"$match" : {
269+
"borough" : "Manhattan"
270+
}
271+
},
272+
{
273+
"$group" : {
274+
"_id" : "$cuisine"
275+
}
276+
}
267277
]
268278
},
269279
"payloadType" : 0
270280
}
271281
]
272282
},
273283
"connection_num" : 0,
274-
"seen" : "2018-11-15T14:39:11.324962-05:00",
275-
"request_id" : 15
284+
"seen" : "2018-11-15T16:28:52.870007-05:00",
285+
"request_id" : 13
276286
}
277287

278288
Fields
@@ -495,6 +505,52 @@ The ``play`` report contents would resemble:
495505
{
496506
"order" : 0,
497507
"op" : "op_msg",
508+
"command" : "isMaster",
509+
"ns" : "test",
510+
"request_data" : {
511+
"sections" : [
512+
{
513+
"payload" : {
514+
"$db" : "test",
515+
"forShell" : 1,
516+
"isMaster" : 1
517+
},
518+
"payloadType" : 0
519+
}
520+
]
521+
},
522+
"reply_data" : {
523+
"sections" : [
524+
{
525+
"payload" : {
526+
"ismaster" : true,
527+
"localTime" : {
528+
"$date" : "2018-11-15T21:35:01.843Z"
529+
},
530+
"logicalSessionTimeoutMinutes" : 30,
531+
"maxBsonObjectSize" : 16777216,
532+
"maxMessageSizeBytes" : 48000000,
533+
"maxWireVersion" : 7,
534+
"maxWriteBatchSize" : 100000,
535+
"minWireVersion" : 0,
536+
"ok" : 1,
537+
"readOnly" : false
538+
},
539+
"payloadType" : 0
540+
}
541+
]
542+
},
543+
"played_at" : "2018-11-15T16:35:01.84304-05:00",
544+
"play_at" : "2018-11-15T16:35:01.842903-05:00",
545+
"playbacklag_us" : 137,
546+
"connection_num" : 1,
547+
"latency_us" : 151,
548+
"seen" : "2018-11-15T21:30:33.379675Z",
549+
"request_id" : 21
550+
}
551+
{
552+
"order" : 2,
553+
"op" : "op_msg",
498554
"command" : "listCollections",
499555
"ns" : "test",
500556
"request_data" : {
@@ -503,11 +559,13 @@ The ``play`` report contents would resemble:
503559
"payload" : {
504560
"$db" : "test",
505561
"authorizedCollections" : true,
506-
"filter" : {},
562+
"filter" : {
563+
564+
},
507565
"listCollections" : 1,
508566
"lsid" : {
509567
"id" : {
510-
"$binary" : "bQ5if4RkRfmJUqYK0/Fvnw==",
568+
"$binary" : "esmcqhiXSIWSpKGb4sOekw==",
511569
"$type" : "04"
512570
}
513571
},
@@ -523,7 +581,9 @@ The ``play`` report contents would resemble:
523581
"payload" : {
524582
"cursor" : {
525583
"firstBatch" : [ ],
526-
"id" : { "$numberLong" : "0" },
584+
"id" : {
585+
"$numberLong" : "0"
586+
},
527587
"ns" : "test.$cmd.listCollections"
528588
},
529589
"ok" : 1
@@ -532,37 +592,26 @@ The ``play`` report contents would resemble:
532592
}
533593
]
534594
},
535-
"played_at" : "2018-11-15T14:58:08.110269-05:00",
536-
"play_at" : "2018-11-15T14:58:08.110148-05:00",
537-
"playbacklag_us" : 121,
595+
"played_at" : "2018-11-15T16:35:08.715002-05:00",
596+
"play_at" : "2018-11-15T16:35:08.713539-05:00",
597+
"playbacklag_us" : 1463,
538598
"connection_num" : 1,
539-
"latency_us" : 194,
540-
"seen" : "2018-11-15T19:57:24.468881Z",
541-
"request_id" : 9
599+
"latency_us" : 331,
600+
"seen" : "2018-11-15T21:30:40.250311Z",
601+
"request_id" : 22
542602
}
543-
544603
{
545604
"order" : 4,
546605
"op" : "op_msg",
547-
"command" : "aggregate",
606+
"command" : "isMaster",
548607
"ns" : "test",
549608
"request_data" : {
550609
"sections" : [
551610
{
552611
"payload" : {
553612
"$db" : "test",
554-
"aggregate" : "restaurants",
555-
"cursor" : {},
556-
"lsid" : {
557-
"id" : {
558-
"$binary" : "bQ5if4RkRfmJUqYK0/Fvnw==",
559-
"$type" : "04"
560-
}
561-
},
562-
"pipeline" : [
563-
{ "$match" : { "borough" : "Manhattan" } },
564-
{ "$group" : { "_id" : "$cuisine" } }
565-
]
613+
"forShell" : 1,
614+
"isMaster" : 1
566615
},
567616
"payloadType" : 0
568617
}
@@ -572,27 +621,32 @@ The ``play`` report contents would resemble:
572621
"sections" : [
573622
{
574623
"payload" : {
575-
"cursor" : {
576-
"firstBatch" : [ ],
577-
"id" : { "$numberLong" : "0" },
578-
"ns" : "test.restaurants"
624+
"ismaster" : true,
625+
"localTime" : {
626+
"$date" : "2018-11-15T21:35:08.715Z"
579627
},
580-
"ok" : 1
628+
"logicalSessionTimeoutMinutes" : 30,
629+
"maxBsonObjectSize" : 16777216,
630+
"maxMessageSizeBytes" : 48000000,
631+
"maxWireVersion" : 7,
632+
"maxWriteBatchSize" : 100000,
633+
"minWireVersion" : 0,
634+
"ok" : 1,
635+
"readOnly" : false
581636
},
582637
"payloadType" : 0
583638
}
584639
]
585640
},
586-
"played_at" : "2018-11-15T14:58:11.616059-05:00",
587-
"play_at" : "2018-11-15T14:58:11.615389-05:00",
588-
"playbacklag_us" : 670,
641+
"played_at" : "2018-11-15T16:35:08.715554-05:00",
642+
"play_at" : "2018-11-15T16:35:08.71471-05:00",
643+
"playbacklag_us" : 844,
589644
"connection_num" : 1,
590-
"latency_us" : 869,
591-
"seen" : "2018-11-15T19:57:27.974122Z",
592-
"request_id" : 11
645+
"latency_us" : 208,
646+
"seen" : "2018-11-15T21:30:40.251482Z",
647+
"request_id" : 23
593648
}
594649

595-
596650
Refer to :ref:`mongoreplay-report-format` for a description of each field.
597651

598652
.. _mongoreplay-use-monitor:
@@ -638,8 +692,49 @@ The report contents would resemble:
638692
]
639693
},
640694
"connection_num" : 0,
641-
"seen" : "2018-11-15T19:57:24.469967Z",
642-
"request_id" : 10
695+
"seen" : "2018-11-15T21:30:33.379675Z",
696+
"request_id" : 21
697+
}
698+
{
699+
"order" : 1,
700+
"op" : "op_msg",
701+
"command" : "aggregate",
702+
"ns" : "test",
703+
"request_data" : {
704+
"sections" : [
705+
{
706+
"payload" : {
707+
"$db" : "test",
708+
"aggregate" : "restaurants",
709+
"cursor" : {
710+
711+
},
712+
"lsid" : {
713+
"id" : {
714+
"$binary" : "esmcqhiXSIWSpKGb4sOekw==",
715+
"$type" : "04"
716+
}
717+
},
718+
"pipeline" : [
719+
{
720+
"$match" : {
721+
"borough" : "Manhattan"
722+
}
723+
},
724+
{
725+
"$group" : {
726+
"_id" : "$cuisine"
727+
}
728+
}
729+
]
730+
},
731+
"payloadType" : 0
732+
}
733+
]
734+
},
735+
"connection_num" : 0,
736+
"seen" : "2018-11-15T16:28:52.870007-05:00",
737+
"request_id" : 13
643738
}
644739
{
645740
"order" : 1,
@@ -649,15 +744,14 @@ The report contents would resemble:
649744
"sections" : [
650745
{
651746
"payload" : {
652-
"connectionId" : 1,
653747
"ismaster" : true,
654748
"localTime" : {
655-
"$date" : "2018-11-15T19:57:24.470Z"
749+
"$date" : "2018-11-15T21:30:33.379Z"
656750
},
657751
"logicalSessionTimeoutMinutes" : 30,
658752
"maxBsonObjectSize" : 16777216,
659753
"maxMessageSizeBytes" : 48000000,
660-
"maxWireVersion" : 8,
754+
"maxWireVersion" : 7,
661755
"maxWriteBatchSize" : 100000,
662756
"minWireVersion" : 0,
663757
"ok" : 1,
@@ -668,9 +762,9 @@ The report contents would resemble:
668762
]
669763
},
670764
"connection_num" : 0,
671-
"latency_us" : 90,
672-
"seen" : "2018-11-15T19:57:24.470057Z",
673-
"request_id" : 10
765+
"latency_us" : 174,
766+
"seen" : "2018-11-15T21:30:33.379849Z",
767+
"request_id" : 21
674768
}
675769
{
676770
"order" : 2,
@@ -682,26 +776,29 @@ The report contents would resemble:
682776
{
683777
"payload" : {
684778
"$db" : "test",
685-
"authorizedCollections" : false,
686-
"filter" : {},
779+
"authorizedCollections" : true,
780+
"filter" : {
781+
782+
},
687783
"listCollections" : 1,
688784
"lsid" : {
689785
"id" : {
690-
"$binary" : "bQ5if4RkRfmJUqYK0/Fvnw==",
786+
"$binary" : "esmcqhiXSIWSpKGb4sOekw==",
691787
"$type" : "04"
692788
}
693789
},
694-
"nameOnly" : false
790+
"nameOnly" : true
695791
},
696792
"payloadType" : 0
697793
}
698794
]
699795
},
700796
"connection_num" : 0,
701-
"seen" : "2018-11-15T19:57:44.316752Z",
702-
"request_id" : 13
797+
"seen" : "2018-11-15T21:30:40.250311Z",
798+
"request_id" : 22
703799
}
704800

801+
705802
Refer to :ref:`mongoreplay-report-format` for a description of each field.
706803

707804
Inspect Live MongoDB Traffic

0 commit comments

Comments
 (0)