From d1404d129fad758559a4c2424772fbb5837283c0 Mon Sep 17 00:00:00 2001 From: Carlos Salguero Date: Wed, 10 May 2017 11:50:25 -0300 Subject: [PATCH 001/104] WIP --- bin/pt-table-sync | 39 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/bin/pt-table-sync b/bin/pt-table-sync index 197cb31f..43e5e446 100755 --- a/bin/pt-table-sync +++ b/bin/pt-table-sync @@ -6943,7 +6943,36 @@ sub get_slave_status { ||= $dbh->prepare('SHOW SLAVE STATUS'); PTDEBUG && _d($dbh, 'SHOW SLAVE STATUS'); $sth->execute(); - my ($ss) = @{$sth->fetchall_arrayref({})}; + my ($sss_rows) = $sth->fetchall_arrayref({}); # Show Slave Status rows + + warn ">>>>===================================================================================================="; + warn Data::Dumper::Dumper($sss_rows); + warn ">>>>===================================================================================================="; + # If SHOW SLAVE STATUS returns more than one row it means that this slave is connected to more + # than one master using replication channels. + # If we have a channel name as a parameter, we need to select the correct row and return it. + # If we don't have a channel name as a parameter, there is no way to know what the correct master is so, + # return an error. + my $ss; + $self->{channel} = 'masterchan2'; + if ( $sss_rows && @$sss_rows && scalar @$sss_rows > 1) { + warn "KKKKKKKKKKKKKKKKKK"; + if (!$self->{channel}) { + warn 'This server returned more than one row for SHOW SLAVE STATUS but "channel" was not specified on the command line'; + $self->{not_a_slave}->{$dbh}++; + return; + } + for my $row (@$sss_rows) { + if ($row->{Channel_Name} eq $self->{channel}) { + $ss = $row; + last; + } + } + } else { + warn "MMMMMMMMMMMMMMMMMMMMMMMMM"; + $ss = $sss_rows->[0]; + } + if ( $ss && %$ss ) { $ss = { map { lc($_) => $ss->{$_} } keys %$ss }; # lowercase the keys @@ -6996,10 +7025,16 @@ sub wait_for_master { . "$master_status->{position}, $timeout)"; PTDEBUG && _d($slave_dbh, $sql); my $start = time; - ($result) = $slave_dbh->selectrow_array($sql); + $result = $slave_dbh->selectrow_array($sql); + warn ">>>"; + warn Data::Dumper::Dumper($result); $waited = time - $start; + warn "===================================================================================================="; + warn "slave_dbh $slave_dbh"; + warn Data::Dumper::Dumper($slave_dbh); + warn Data::Dumper::Dumper($master_status); PTDEBUG && _d('Result of waiting:', $result); PTDEBUG && _d("Waited", $waited, "seconds"); } From 7dcef2671c8b327a9bf5818c00275482c9895545 Mon Sep 17 00:00:00 2001 From: Carlos Salguero Date: Thu, 11 May 2017 18:06:49 -0300 Subject: [PATCH 002/104] PT-139 Added --channels option to MasterSlave --- t/pt-table-sync/sync_using_channels.t | 74 +++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 t/pt-table-sync/sync_using_channels.t diff --git a/t/pt-table-sync/sync_using_channels.t b/t/pt-table-sync/sync_using_channels.t new file mode 100644 index 00000000..66399ba4 --- /dev/null +++ b/t/pt-table-sync/sync_using_channels.t @@ -0,0 +1,74 @@ +#!/usr/bin/env perl + +BEGIN { + die "The PERCONA_TOOLKIT_BRANCH environment variable is not set.\n" + unless $ENV{PERCONA_TOOLKIT_BRANCH} && -d $ENV{PERCONA_TOOLKIT_BRANCH}; + unshift @INC, "$ENV{PERCONA_TOOLKIT_BRANCH}/lib"; +}; + +use strict; +use warnings FATAL => 'all'; +use English qw(-no_match_vars); +use Test::More; + +use PerconaTest; +use Sandbox; +require "$trunk/bin/pt-table-sync"; + +my $dp = new DSNParser(opts=>$dsn_opts); +my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp); +my $master_dbh = $sb->get_dbh_for('master'); +my $slave_dbh = $sb->get_dbh_for('slave1'); + +if ( !$master_dbh ) { + plan skip_all => 'Cannot connect to sandbox master'; +} +elsif ( !$slave_dbh ) { + plan skip_all => 'Cannot connect to sandbox slave'; +} elsif ($sandbox_version lt '5.7') { + plan skip_all => 'Only on MySQL 5.7+'; +} else { + plan tests => 2; +} + +my ($master1_dbh, $master1_dsn) = $sb->start_sandbox( + server => 'chan_master1', + type => 'master', +); +my ($master2_dbh, $master2_dsn) = $sb->start_sandbox( + server => 'chan_master2', + type => 'master', +); +my ($slave1_dbh, $slave1_dsn) = $sb->start_sandbox( + server => 'chan_slave1', + type => 'master', +); +my $slave1_port = $sb->port_for('chan_slave1'); + +$sb->load_file('chan_master1', "sandbox/gtid_on.sql", undef, no_wait => 1); +$sb->load_file('chan_master2', "sandbox/gtid_on.sql", undef, no_wait => 1); +$sb->load_file('chan_slave1', "sandbox/slave_channels.sql", undef, no_wait => 1); + +my @args = qw(--execute --no-foreign-key-checks --verbose --databases=sakila --tables=actor --sync-to-master --channel=masterchan1); +my $exit_status; + +my $output = output( + sub { $exit_status = pt_table_sync::main(@args, $slave1_dsn) }, + stderr => 1, +); + +like ( + $output, + qr/sakila.actor/, + 'Synced actor table' +); + +$sb->stop_sandbox(qw(chan_master1 chan_master2 chan_slave1)); + + +# ############################################################################# +# Done. +# ############################################################################# +$sb->wipe_clean($master_dbh); +ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox"); +exit; From 5744fdf583d2a64dedcdf2d2ca809e870ee5d3b0 Mon Sep 17 00:00:00 2001 From: Carlos Salguero Date: Fri, 12 May 2017 11:55:52 -0300 Subject: [PATCH 003/104] PT-139 Added replication channels suport to pt-table-sync --- bin/pt-archiver | 34 +++++++++++++---- bin/pt-heartbeat | 34 +++++++++++++---- bin/pt-kill | 34 +++++++++++++---- bin/pt-online-schema-change | 34 +++++++++++++---- bin/pt-query-digest | 34 +++++++++++++---- bin/pt-slave-find | 34 +++++++++++++---- bin/pt-slave-restart | 34 +++++++++++++---- bin/pt-table-checksum | 34 +++++++++++++---- bin/pt-table-sync | 75 ++++++++++++++++++------------------- lib/MasterSlave.pm | 40 ++++++++++++++++---- sandbox/gtid_on.sql | 1 + t/lib/MasterSlave.t | 64 +++++++++++++++++++++++++++++++ 12 files changed, 350 insertions(+), 102 deletions(-) diff --git a/bin/pt-archiver b/bin/pt-archiver index 136c324e..4356114a 100755 --- a/bin/pt-archiver +++ b/bin/pt-archiver @@ -3863,16 +3863,35 @@ sub get_slave_status { ||= $dbh->prepare('SHOW SLAVE STATUS'); PTDEBUG && _d($dbh, 'SHOW SLAVE STATUS'); $sth->execute(); - my ($ss) = @{$sth->fetchall_arrayref({})}; + my ($sss_rows) = $sth->fetchall_arrayref({}); # Show Slave Status rows - if ( $ss && %$ss ) { - $ss = { map { lc($_) => $ss->{$_} } keys %$ss }; # lowercase the keys - return $ss; + my $ss; + if ( $sss_rows && @$sss_rows ) { + if (scalar @$sss_rows > 1) { + if (!$self->{channel}) { + warn 'This server returned more than one row for SHOW SLAVE STATUS but "channel" was not specified on the command line'; + return undef; + } + for my $row (@$sss_rows) { + $row = { map { lc($_) => $row->{$_} } keys %$row }; # lowercase the keys + if ($row->{channel_name} eq $self->{channel}) { + $ss = $row; + last; + } + } + } else { + $ss = $sss_rows->[0]; + } + + if ( $ss && %$ss ) { + $ss = { map { lc($_) => $ss->{$_} } keys %$ss }; # lowercase the keys + return $ss; + } } PTDEBUG && _d('This server returns nothing for SHOW SLAVE STATUS'); $self->{not_a_slave}->{$dbh}++; - } + } } sub get_master_status { @@ -3912,8 +3931,9 @@ sub wait_for_master { my $result; my $waited; if ( $master_status ) { - my $sql = "SELECT MASTER_POS_WAIT('$master_status->{file}', " - . "$master_status->{position}, $timeout)"; + my $server_version = VersionParser->new($slave_dbh); + my $channel_sql = $server_version > '5.6' && $self->{channel} ? ", '$self->{channel}'" : ''; + my $sql = "SELECT MASTER_POS_WAIT('$master_status->{file}', $master_status->{position}, $timeout $channel_sql)"; PTDEBUG && _d($slave_dbh, $sql); my $start = time; ($result) = $slave_dbh->selectrow_array($sql); diff --git a/bin/pt-heartbeat b/bin/pt-heartbeat index 151f405d..4f1c06dc 100755 --- a/bin/pt-heartbeat +++ b/bin/pt-heartbeat @@ -456,16 +456,35 @@ sub get_slave_status { ||= $dbh->prepare('SHOW SLAVE STATUS'); PTDEBUG && _d($dbh, 'SHOW SLAVE STATUS'); $sth->execute(); - my ($ss) = @{$sth->fetchall_arrayref({})}; + my ($sss_rows) = $sth->fetchall_arrayref({}); # Show Slave Status rows - if ( $ss && %$ss ) { - $ss = { map { lc($_) => $ss->{$_} } keys %$ss }; # lowercase the keys - return $ss; + my $ss; + if ( $sss_rows && @$sss_rows ) { + if (scalar @$sss_rows > 1) { + if (!$self->{channel}) { + warn 'This server returned more than one row for SHOW SLAVE STATUS but "channel" was not specified on the command line'; + return undef; + } + for my $row (@$sss_rows) { + $row = { map { lc($_) => $row->{$_} } keys %$row }; # lowercase the keys + if ($row->{channel_name} eq $self->{channel}) { + $ss = $row; + last; + } + } + } else { + $ss = $sss_rows->[0]; + } + + if ( $ss && %$ss ) { + $ss = { map { lc($_) => $ss->{$_} } keys %$ss }; # lowercase the keys + return $ss; + } } PTDEBUG && _d('This server returns nothing for SHOW SLAVE STATUS'); $self->{not_a_slave}->{$dbh}++; - } + } } sub get_master_status { @@ -505,8 +524,9 @@ sub wait_for_master { my $result; my $waited; if ( $master_status ) { - my $sql = "SELECT MASTER_POS_WAIT('$master_status->{file}', " - . "$master_status->{position}, $timeout)"; + my $server_version = VersionParser->new($slave_dbh); + my $channel_sql = $server_version > '5.6' && $self->{channel} ? ", '$self->{channel}'" : ''; + my $sql = "SELECT MASTER_POS_WAIT('$master_status->{file}', $master_status->{position}, $timeout $channel_sql)"; PTDEBUG && _d($slave_dbh, $sql); my $start = time; ($result) = $slave_dbh->selectrow_array($sql); diff --git a/bin/pt-kill b/bin/pt-kill index 539eedfa..6631affa 100755 --- a/bin/pt-kill +++ b/bin/pt-kill @@ -4133,16 +4133,35 @@ sub get_slave_status { ||= $dbh->prepare('SHOW SLAVE STATUS'); PTDEBUG && _d($dbh, 'SHOW SLAVE STATUS'); $sth->execute(); - my ($ss) = @{$sth->fetchall_arrayref({})}; + my ($sss_rows) = $sth->fetchall_arrayref({}); # Show Slave Status rows - if ( $ss && %$ss ) { - $ss = { map { lc($_) => $ss->{$_} } keys %$ss }; # lowercase the keys - return $ss; + my $ss; + if ( $sss_rows && @$sss_rows ) { + if (scalar @$sss_rows > 1) { + if (!$self->{channel}) { + warn 'This server returned more than one row for SHOW SLAVE STATUS but "channel" was not specified on the command line'; + return undef; + } + for my $row (@$sss_rows) { + $row = { map { lc($_) => $row->{$_} } keys %$row }; # lowercase the keys + if ($row->{channel_name} eq $self->{channel}) { + $ss = $row; + last; + } + } + } else { + $ss = $sss_rows->[0]; + } + + if ( $ss && %$ss ) { + $ss = { map { lc($_) => $ss->{$_} } keys %$ss }; # lowercase the keys + return $ss; + } } PTDEBUG && _d('This server returns nothing for SHOW SLAVE STATUS'); $self->{not_a_slave}->{$dbh}++; - } + } } sub get_master_status { @@ -4182,8 +4201,9 @@ sub wait_for_master { my $result; my $waited; if ( $master_status ) { - my $sql = "SELECT MASTER_POS_WAIT('$master_status->{file}', " - . "$master_status->{position}, $timeout)"; + my $server_version = VersionParser->new($slave_dbh); + my $channel_sql = $server_version > '5.6' && $self->{channel} ? ", '$self->{channel}'" : ''; + my $sql = "SELECT MASTER_POS_WAIT('$master_status->{file}', $master_status->{position}, $timeout $channel_sql)"; PTDEBUG && _d($slave_dbh, $sql); my $start = time; ($result) = $slave_dbh->selectrow_array($sql); diff --git a/bin/pt-online-schema-change b/bin/pt-online-schema-change index 95d5cc38..fb92c18f 100755 --- a/bin/pt-online-schema-change +++ b/bin/pt-online-schema-change @@ -4415,16 +4415,35 @@ sub get_slave_status { ||= $dbh->prepare('SHOW SLAVE STATUS'); PTDEBUG && _d($dbh, 'SHOW SLAVE STATUS'); $sth->execute(); - my ($ss) = @{$sth->fetchall_arrayref({})}; + my ($sss_rows) = $sth->fetchall_arrayref({}); # Show Slave Status rows - if ( $ss && %$ss ) { - $ss = { map { lc($_) => $ss->{$_} } keys %$ss }; # lowercase the keys - return $ss; + my $ss; + if ( $sss_rows && @$sss_rows ) { + if (scalar @$sss_rows > 1) { + if (!$self->{channel}) { + warn 'This server returned more than one row for SHOW SLAVE STATUS but "channel" was not specified on the command line'; + return undef; + } + for my $row (@$sss_rows) { + $row = { map { lc($_) => $row->{$_} } keys %$row }; # lowercase the keys + if ($row->{channel_name} eq $self->{channel}) { + $ss = $row; + last; + } + } + } else { + $ss = $sss_rows->[0]; + } + + if ( $ss && %$ss ) { + $ss = { map { lc($_) => $ss->{$_} } keys %$ss }; # lowercase the keys + return $ss; + } } PTDEBUG && _d('This server returns nothing for SHOW SLAVE STATUS'); $self->{not_a_slave}->{$dbh}++; - } + } } sub get_master_status { @@ -4464,8 +4483,9 @@ sub wait_for_master { my $result; my $waited; if ( $master_status ) { - my $sql = "SELECT MASTER_POS_WAIT('$master_status->{file}', " - . "$master_status->{position}, $timeout)"; + my $server_version = VersionParser->new($slave_dbh); + my $channel_sql = $server_version > '5.6' && $self->{channel} ? ", '$self->{channel}'" : ''; + my $sql = "SELECT MASTER_POS_WAIT('$master_status->{file}', $master_status->{position}, $timeout $channel_sql)"; PTDEBUG && _d($slave_dbh, $sql); my $start = time; ($result) = $slave_dbh->selectrow_array($sql); diff --git a/bin/pt-query-digest b/bin/pt-query-digest index 2fad690b..6eba03da 100755 --- a/bin/pt-query-digest +++ b/bin/pt-query-digest @@ -10750,16 +10750,35 @@ sub get_slave_status { ||= $dbh->prepare('SHOW SLAVE STATUS'); PTDEBUG && _d($dbh, 'SHOW SLAVE STATUS'); $sth->execute(); - my ($ss) = @{$sth->fetchall_arrayref({})}; + my ($sss_rows) = $sth->fetchall_arrayref({}); # Show Slave Status rows - if ( $ss && %$ss ) { - $ss = { map { lc($_) => $ss->{$_} } keys %$ss }; # lowercase the keys - return $ss; + my $ss; + if ( $sss_rows && @$sss_rows ) { + if (scalar @$sss_rows > 1) { + if (!$self->{channel}) { + warn 'This server returned more than one row for SHOW SLAVE STATUS but "channel" was not specified on the command line'; + return undef; + } + for my $row (@$sss_rows) { + $row = { map { lc($_) => $row->{$_} } keys %$row }; # lowercase the keys + if ($row->{channel_name} eq $self->{channel}) { + $ss = $row; + last; + } + } + } else { + $ss = $sss_rows->[0]; + } + + if ( $ss && %$ss ) { + $ss = { map { lc($_) => $ss->{$_} } keys %$ss }; # lowercase the keys + return $ss; + } } PTDEBUG && _d('This server returns nothing for SHOW SLAVE STATUS'); $self->{not_a_slave}->{$dbh}++; - } + } } sub get_master_status { @@ -10799,8 +10818,9 @@ sub wait_for_master { my $result; my $waited; if ( $master_status ) { - my $sql = "SELECT MASTER_POS_WAIT('$master_status->{file}', " - . "$master_status->{position}, $timeout)"; + my $server_version = VersionParser->new($slave_dbh); + my $channel_sql = $server_version > '5.6' && $self->{channel} ? ", '$self->{channel}'" : ''; + my $sql = "SELECT MASTER_POS_WAIT('$master_status->{file}', $master_status->{position}, $timeout $channel_sql)"; PTDEBUG && _d($slave_dbh, $sql); my $start = time; ($result) = $slave_dbh->selectrow_array($sql); diff --git a/bin/pt-slave-find b/bin/pt-slave-find index 578afa54..a7b4b153 100755 --- a/bin/pt-slave-find +++ b/bin/pt-slave-find @@ -2570,16 +2570,35 @@ sub get_slave_status { ||= $dbh->prepare('SHOW SLAVE STATUS'); PTDEBUG && _d($dbh, 'SHOW SLAVE STATUS'); $sth->execute(); - my ($ss) = @{$sth->fetchall_arrayref({})}; + my ($sss_rows) = $sth->fetchall_arrayref({}); # Show Slave Status rows - if ( $ss && %$ss ) { - $ss = { map { lc($_) => $ss->{$_} } keys %$ss }; # lowercase the keys - return $ss; + my $ss; + if ( $sss_rows && @$sss_rows ) { + if (scalar @$sss_rows > 1) { + if (!$self->{channel}) { + warn 'This server returned more than one row for SHOW SLAVE STATUS but "channel" was not specified on the command line'; + return undef; + } + for my $row (@$sss_rows) { + $row = { map { lc($_) => $row->{$_} } keys %$row }; # lowercase the keys + if ($row->{channel_name} eq $self->{channel}) { + $ss = $row; + last; + } + } + } else { + $ss = $sss_rows->[0]; + } + + if ( $ss && %$ss ) { + $ss = { map { lc($_) => $ss->{$_} } keys %$ss }; # lowercase the keys + return $ss; + } } PTDEBUG && _d('This server returns nothing for SHOW SLAVE STATUS'); $self->{not_a_slave}->{$dbh}++; - } + } } sub get_master_status { @@ -2619,8 +2638,9 @@ sub wait_for_master { my $result; my $waited; if ( $master_status ) { - my $sql = "SELECT MASTER_POS_WAIT('$master_status->{file}', " - . "$master_status->{position}, $timeout)"; + my $server_version = VersionParser->new($slave_dbh); + my $channel_sql = $server_version > '5.6' && $self->{channel} ? ", '$self->{channel}'" : ''; + my $sql = "SELECT MASTER_POS_WAIT('$master_status->{file}', $master_status->{position}, $timeout $channel_sql)"; PTDEBUG && _d($slave_dbh, $sql); my $start = time; ($result) = $slave_dbh->selectrow_array($sql); diff --git a/bin/pt-slave-restart b/bin/pt-slave-restart index 52893fde..30941fa4 100755 --- a/bin/pt-slave-restart +++ b/bin/pt-slave-restart @@ -2981,16 +2981,35 @@ sub get_slave_status { ||= $dbh->prepare('SHOW SLAVE STATUS'); PTDEBUG && _d($dbh, 'SHOW SLAVE STATUS'); $sth->execute(); - my ($ss) = @{$sth->fetchall_arrayref({})}; + my ($sss_rows) = $sth->fetchall_arrayref({}); # Show Slave Status rows - if ( $ss && %$ss ) { - $ss = { map { lc($_) => $ss->{$_} } keys %$ss }; # lowercase the keys - return $ss; + my $ss; + if ( $sss_rows && @$sss_rows ) { + if (scalar @$sss_rows > 1) { + if (!$self->{channel}) { + warn 'This server returned more than one row for SHOW SLAVE STATUS but "channel" was not specified on the command line'; + return undef; + } + for my $row (@$sss_rows) { + $row = { map { lc($_) => $row->{$_} } keys %$row }; # lowercase the keys + if ($row->{channel_name} eq $self->{channel}) { + $ss = $row; + last; + } + } + } else { + $ss = $sss_rows->[0]; + } + + if ( $ss && %$ss ) { + $ss = { map { lc($_) => $ss->{$_} } keys %$ss }; # lowercase the keys + return $ss; + } } PTDEBUG && _d('This server returns nothing for SHOW SLAVE STATUS'); $self->{not_a_slave}->{$dbh}++; - } + } } sub get_master_status { @@ -3030,8 +3049,9 @@ sub wait_for_master { my $result; my $waited; if ( $master_status ) { - my $sql = "SELECT MASTER_POS_WAIT('$master_status->{file}', " - . "$master_status->{position}, $timeout)"; + my $server_version = VersionParser->new($slave_dbh); + my $channel_sql = $server_version > '5.6' && $self->{channel} ? ", '$self->{channel}'" : ''; + my $sql = "SELECT MASTER_POS_WAIT('$master_status->{file}', $master_status->{position}, $timeout $channel_sql)"; PTDEBUG && _d($slave_dbh, $sql); my $start = time; ($result) = $slave_dbh->selectrow_array($sql); diff --git a/bin/pt-table-checksum b/bin/pt-table-checksum index 338c1bee..3f3ab88a 100755 --- a/bin/pt-table-checksum +++ b/bin/pt-table-checksum @@ -5361,16 +5361,35 @@ sub get_slave_status { ||= $dbh->prepare('SHOW SLAVE STATUS'); PTDEBUG && _d($dbh, 'SHOW SLAVE STATUS'); $sth->execute(); - my ($ss) = @{$sth->fetchall_arrayref({})}; + my ($sss_rows) = $sth->fetchall_arrayref({}); # Show Slave Status rows - if ( $ss && %$ss ) { - $ss = { map { lc($_) => $ss->{$_} } keys %$ss }; # lowercase the keys - return $ss; + my $ss; + if ( $sss_rows && @$sss_rows ) { + if (scalar @$sss_rows > 1) { + if (!$self->{channel}) { + warn 'This server returned more than one row for SHOW SLAVE STATUS but "channel" was not specified on the command line'; + return undef; + } + for my $row (@$sss_rows) { + $row = { map { lc($_) => $row->{$_} } keys %$row }; # lowercase the keys + if ($row->{channel_name} eq $self->{channel}) { + $ss = $row; + last; + } + } + } else { + $ss = $sss_rows->[0]; + } + + if ( $ss && %$ss ) { + $ss = { map { lc($_) => $ss->{$_} } keys %$ss }; # lowercase the keys + return $ss; + } } PTDEBUG && _d('This server returns nothing for SHOW SLAVE STATUS'); $self->{not_a_slave}->{$dbh}++; - } + } } sub get_master_status { @@ -5410,8 +5429,9 @@ sub wait_for_master { my $result; my $waited; if ( $master_status ) { - my $sql = "SELECT MASTER_POS_WAIT('$master_status->{file}', " - . "$master_status->{position}, $timeout)"; + my $server_version = VersionParser->new($slave_dbh); + my $channel_sql = $server_version > '5.6' && $self->{channel} ? ", '$self->{channel}'" : ''; + my $sql = "SELECT MASTER_POS_WAIT('$master_status->{file}', $master_status->{position}, $timeout $channel_sql)"; PTDEBUG && _d($slave_dbh, $sql); my $start = time; ($result) = $slave_dbh->selectrow_array($sql); diff --git a/bin/pt-table-sync b/bin/pt-table-sync index 43e5e446..1fcbb6c3 100755 --- a/bin/pt-table-sync +++ b/bin/pt-table-sync @@ -6945,43 +6945,33 @@ sub get_slave_status { $sth->execute(); my ($sss_rows) = $sth->fetchall_arrayref({}); # Show Slave Status rows - warn ">>>>===================================================================================================="; - warn Data::Dumper::Dumper($sss_rows); - warn ">>>>===================================================================================================="; - # If SHOW SLAVE STATUS returns more than one row it means that this slave is connected to more - # than one master using replication channels. - # If we have a channel name as a parameter, we need to select the correct row and return it. - # If we don't have a channel name as a parameter, there is no way to know what the correct master is so, - # return an error. my $ss; - $self->{channel} = 'masterchan2'; - if ( $sss_rows && @$sss_rows && scalar @$sss_rows > 1) { - warn "KKKKKKKKKKKKKKKKKK"; - if (!$self->{channel}) { - warn 'This server returned more than one row for SHOW SLAVE STATUS but "channel" was not specified on the command line'; - $self->{not_a_slave}->{$dbh}++; - return; - } - for my $row (@$sss_rows) { - if ($row->{Channel_Name} eq $self->{channel}) { - $ss = $row; - last; + if ( $sss_rows && @$sss_rows ) { + if (scalar @$sss_rows > 1) { + if (!$self->{channel}) { + warn 'This server returned more than one row for SHOW SLAVE STATUS but "channel" was not specified on the command line'; + return undef; } + for my $row (@$sss_rows) { + $row = { map { lc($_) => $row->{$_} } keys %$row }; # lowercase the keys + if ($row->{channel_name} eq $self->{channel}) { + $ss = $row; + last; + } + } + } else { + $ss = $sss_rows->[0]; } - } else { - warn "MMMMMMMMMMMMMMMMMMMMMMMMM"; - $ss = $sss_rows->[0]; - } - - if ( $ss && %$ss ) { - $ss = { map { lc($_) => $ss->{$_} } keys %$ss }; # lowercase the keys - return $ss; + if ( $ss && %$ss ) { + $ss = { map { lc($_) => $ss->{$_} } keys %$ss }; # lowercase the keys + return $ss; + } } PTDEBUG && _d('This server returns nothing for SHOW SLAVE STATUS'); $self->{not_a_slave}->{$dbh}++; - } + } } sub get_master_status { @@ -7021,20 +7011,15 @@ sub wait_for_master { my $result; my $waited; if ( $master_status ) { - my $sql = "SELECT MASTER_POS_WAIT('$master_status->{file}', " - . "$master_status->{position}, $timeout)"; + my $server_version = VersionParser->new($slave_dbh); + my $channel_sql = $server_version > '5.6' && $self->{channel} ? ", '$self->{channel}'" : ''; + my $sql = "SELECT MASTER_POS_WAIT('$master_status->{file}', $master_status->{position}, $timeout $channel_sql)"; PTDEBUG && _d($slave_dbh, $sql); my $start = time; - $result = $slave_dbh->selectrow_array($sql); - warn ">>>"; - warn Data::Dumper::Dumper($result); + ($result) = $slave_dbh->selectrow_array($sql); $waited = time - $start; - warn "===================================================================================================="; - warn "slave_dbh $slave_dbh"; - warn Data::Dumper::Dumper($slave_dbh); - warn Data::Dumper::Dumper($master_status); PTDEBUG && _d('Result of waiting:', $result); PTDEBUG && _d("Waited", $waited, "seconds"); } @@ -9884,7 +9869,7 @@ sub main { # Do the work. # ######################################################################## my $tp = new TableParser( Quoter => $q ); - my $ms = new MasterSlave(OptionParser=>$o,DSNParser=>$dp,Quoter=>$q); + my $ms = new MasterSlave(OptionParser=>$o,DSNParser=>$dp,Quoter=>$q, channel=>$o->get('channel')); my $rt = new Retry(); my $chunker = new TableChunker( Quoter => $q, TableParser => $tp ); my $nibbler = new TableNibbler( Quoter => $q, TableParser => $tp ); @@ -12055,6 +12040,18 @@ For most non-trivial data sizes, you want to leave this option enabled. This option is disabled when L<"--bidirectional"> is used. +=item --channel + +type: string + +Channel name used when connected to a server using replication channels. +Suppose you have two masters, master_a at port 12345, master_b at port 1236 and +a slave connected to both masters using channels chan_master_a and chan_master_b. +If you want to run pt-table-sync to syncronize the slave against master_a, pt-table-sync +won't be able to determine what's the correct master since SHOW SLAVE STATUS +will return 2 rows. In this case, you can use --channel=chan_master_a to specify +the channel name to use in the SHOW SLAVE STATUS command. + =item --charset short form: -A; type: string diff --git a/lib/MasterSlave.pm b/lib/MasterSlave.pm index fa6b9852..276fec99 100644 --- a/lib/MasterSlave.pm +++ b/lib/MasterSlave.pm @@ -430,21 +430,46 @@ sub get_master_dsn { # Gets SHOW SLAVE STATUS, with column names all lowercased, as a hashref. sub get_slave_status { my ( $self, $dbh ) = @_; + if ( !$self->{not_a_slave}->{$dbh} ) { my $sth = $self->{sths}->{$dbh}->{SLAVE_STATUS} ||= $dbh->prepare('SHOW SLAVE STATUS'); PTDEBUG && _d($dbh, 'SHOW SLAVE STATUS'); $sth->execute(); - my ($ss) = @{$sth->fetchall_arrayref({})}; + my ($sss_rows) = $sth->fetchall_arrayref({}); # Show Slave Status rows - if ( $ss && %$ss ) { - $ss = { map { lc($_) => $ss->{$_} } keys %$ss }; # lowercase the keys - return $ss; + # If SHOW SLAVE STATUS returns more than one row it means that this slave is connected to more + # than one master using replication channels. + # If we have a channel name as a parameter, we need to select the correct row and return it. + # If we don't have a channel name as a parameter, there is no way to know what the correct master is so, + # return an error. + my $ss; + if ( $sss_rows && @$sss_rows ) { + if (scalar @$sss_rows > 1) { + if (!$self->{channel}) { + warn 'This server returned more than one row for SHOW SLAVE STATUS but "channel" was not specified on the command line'; + return undef; + } + for my $row (@$sss_rows) { + $row = { map { lc($_) => $row->{$_} } keys %$row }; # lowercase the keys + if ($row->{channel_name} eq $self->{channel}) { + $ss = $row; + last; + } + } + } else { + $ss = $sss_rows->[0]; + } + + if ( $ss && %$ss ) { + $ss = { map { lc($_) => $ss->{$_} } keys %$ss }; # lowercase the keys + return $ss; + } } PTDEBUG && _d('This server returns nothing for SHOW SLAVE STATUS'); $self->{not_a_slave}->{$dbh}++; - } + } } # Gets SHOW MASTER STATUS, with column names all lowercased, as a hashref. @@ -506,8 +531,9 @@ sub wait_for_master { my $result; my $waited; if ( $master_status ) { - my $sql = "SELECT MASTER_POS_WAIT('$master_status->{file}', " - . "$master_status->{position}, $timeout)"; + my $server_version = VersionParser->new($slave_dbh); + my $channel_sql = $server_version > '5.6' && $self->{channel} ? ", '$self->{channel}'" : ''; + my $sql = "SELECT MASTER_POS_WAIT('$master_status->{file}', $master_status->{position}, $timeout $channel_sql)"; PTDEBUG && _d($slave_dbh, $sql); my $start = time; ($result) = $slave_dbh->selectrow_array($sql); diff --git a/sandbox/gtid_on.sql b/sandbox/gtid_on.sql index 1de63bc2..f436d19e 100644 --- a/sandbox/gtid_on.sql +++ b/sandbox/gtid_on.sql @@ -1,3 +1,4 @@ +STOP SLAVE FOR CHANNEL ''; SET GLOBAL master_info_repository = 'TABLE'; SET @@GLOBAL.relay_log_info_repository = 'TABLE'; SET @@GLOBAL.ENFORCE_GTID_CONSISTENCY=ON; diff --git a/t/lib/MasterSlave.t b/t/lib/MasterSlave.t index c2477ce7..152c46da 100644 --- a/t/lib/MasterSlave.t +++ b/t/lib/MasterSlave.t @@ -750,6 +750,70 @@ like( "--recursion-method none,none" ); +SKIP: { + + skip "Only test on mysql 5.7" if ( $sandbox_version lt '5.7' ); + + my ($master1_dbh, $master1_dsn) = $sb->start_sandbox( + server => 'chan_master1', + type => 'master', + ); + my ($master2_dbh, $master2_dsn) = $sb->start_sandbox( + server => 'chan_master2', + type => 'master', + ); + my ($slave1_dbh, $slave1_dsn) = $sb->start_sandbox( + server => 'chan_slave1', + type => 'master', + ); + my $slave1_port = $sb->port_for('chan_slave1'); + + $sb->load_file('chan_master1', "sandbox/gtid_on.sql", undef, no_wait => 1); + $sb->load_file('chan_master2', "sandbox/gtid_on.sql", undef, no_wait => 1); + $sb->load_file('chan_slave1', "sandbox/slave_channels.sql", undef, no_wait => 1); + + my $chan_slaves = $ms->get_slaves( + dbh => $master1_dbh, + dsn => $master1_dsn, + make_cxn => sub { + my $cxn = new Cxn( + @_, + DSNParser => $dp, + OptionParser => $o, + ); + $cxn->connect(); + return $cxn; + }, + ); + + our $message; + local $SIG{__WARN__} = sub { + $message = shift; + }; + my $css = $ms->get_slave_status($slave1_dbh); + local $SIG{__WARN__} = undef; + is ( + $css, + undef, + 'Cannot determine slave in a multi source config without --channel param' + ); + like ( + $message, + qr/This server returned more than one row for SHOW SLAVE STATUS/, + 'Got warning message if we cannot determine slave in a multi source config without --channel param', + ); + + # Now try specifying a channel name + $ms->{channel} = 'masterchan1'; + $css = $ms->get_slave_status($slave1_dbh); + is ( + $css->{channel_name}, + 'masterchan1', + 'Returned the correct slave', + ); + + $sb->stop_sandbox(qw(chan_master1 chan_master2 chan_slave1)); +} # ############################################################################# # Done. # ############################################################################# From 820448fca3b64ae24eb31c4bdc82ca6788078a89 Mon Sep 17 00:00:00 2001 From: Carlos Salguero Date: Fri, 12 May 2017 15:44:57 -0300 Subject: [PATCH 004/104] PT-139 wait_for_master returns error if no channel was specified in a multi master env --- bin/pt-table-sync | 17 +++++++++++++++++ lib/MasterSlave.pm | 14 ++++++++++++-- t/lib/MasterSlave.t | 22 ++++++++++++++++++++++ 3 files changed, 51 insertions(+), 2 deletions(-) diff --git a/bin/pt-table-sync b/bin/pt-table-sync index 1fcbb6c3..64275d92 100755 --- a/bin/pt-table-sync +++ b/bin/pt-table-sync @@ -6237,6 +6237,9 @@ sub lock_and_wait { slave_dbh => $dst->{dbh}, timeout => $timeout, ); + if ($wait->{error}) { + die $result->{error}; + } if ( defined $wait->{result} && $wait->{result} != -1 ) { return; # slave caught up } @@ -7011,6 +7014,15 @@ sub wait_for_master { my $result; my $waited; if ( $master_status ) { + my $slave_status = $self->get_slave_status($slave_dbh); + if (!$slave_status) { + return { + result => undef, + waited => 0, + error =>'This server returned more than one row for SHOW SLAVE STATUS but "channel" was not specified on the command line', + }; + } + my $server_version = VersionParser->new($slave_dbh); my $channel_sql = $server_version > '5.6' && $self->{channel} ? ", '$self->{channel}'" : ''; my $sql = "SELECT MASTER_POS_WAIT('$master_status->{file}', $master_status->{position}, $timeout $channel_sql)"; @@ -7030,6 +7042,7 @@ sub wait_for_master { return { result => $result, waited => $waited, + error => undef, }; } @@ -7079,6 +7092,10 @@ sub catchup_to_master { timeout => $timeout, master_status => $master_status ); + if ($result->{error}) { + die $result->{error}; + } + if ( !defined $result->{result} ) { $slave_status = $self->get_slave_status($slave); if ( !$self->slave_is_running($slave_status) ) { diff --git a/lib/MasterSlave.pm b/lib/MasterSlave.pm index 276fec99..72ac80c2 100644 --- a/lib/MasterSlave.pm +++ b/lib/MasterSlave.pm @@ -105,8 +105,7 @@ sub get_slaves { }, } ); - } - elsif ( $methods->[0] =~ m/^dsn=/i ) { + } elsif ( $methods->[0] =~ m/^dsn=/i ) { (my $dsn_table_dsn = join ",", @$methods) =~ s/^dsn=//i; $slaves = $self->get_cxn_from_dsn_table( %args, @@ -531,6 +530,14 @@ sub wait_for_master { my $result; my $waited; if ( $master_status ) { + my $slave_status = $self->get_slave_status($slave_dbh); + if (!$slave_status) { + return { + result => undef, + waited => 0, + error =>'Wait for master: this is a multi-master slave but "channel" was not specified on the command line', + }; + } my $server_version = VersionParser->new($slave_dbh); my $channel_sql = $server_version > '5.6' && $self->{channel} ? ", '$self->{channel}'" : ''; my $sql = "SELECT MASTER_POS_WAIT('$master_status->{file}', $master_status->{position}, $timeout $channel_sql)"; @@ -614,6 +621,9 @@ sub catchup_to_master { timeout => $timeout, master_status => $master_status ); + if ($result->{error}) { + die $result->{error}; + } if ( !defined $result->{result} ) { $slave_status = $self->get_slave_status($slave); if ( !$self->slave_is_running($slave_status) ) { diff --git a/t/lib/MasterSlave.t b/t/lib/MasterSlave.t index 152c46da..e1416d82 100644 --- a/t/lib/MasterSlave.t +++ b/t/lib/MasterSlave.t @@ -803,6 +803,17 @@ SKIP: { 'Got warning message if we cannot determine slave in a multi source config without --channel param', ); + my $wfm = $ms->wait_for_master( + master_status => $ms->get_master_status($dbh), + slave_dbh => $slave1_dbh, + timeout => 1, + ); + like( + $wfm->{error}, + qr/"channel" was not specified on the command line/, + 'Wait for master returned error', + ); + # Now try specifying a channel name $ms->{channel} = 'masterchan1'; $css = $ms->get_slave_status($slave1_dbh); @@ -812,6 +823,17 @@ SKIP: { 'Returned the correct slave', ); + $wfm = $ms->wait_for_master( + master_status => $ms->get_master_status($dbh), + slave_dbh => $slave1_dbh, + timeout => 1, + ); + is( + $wfm->{error}, + undef, + 'Wait for master returned no error', + ); + $sb->stop_sandbox(qw(chan_master1 chan_master2 chan_slave1)); } # ############################################################################# From 8ca82d085ee50f83ddc7cc627d5db7c38e364119 Mon Sep 17 00:00:00 2001 From: Carlos Salguero Date: Mon, 22 May 2017 15:48:32 -0300 Subject: [PATCH 005/104] PT-139 Detect only 1 slave using rep channels If there is only one slave but it is using replication channels but --channel was not specified as a parameter, get_slave_status will return null. --- lib/MasterSlave.pm | 7 ++++++- t/lib/MasterSlave.t | 14 ++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/lib/MasterSlave.pm b/lib/MasterSlave.pm index 72ac80c2..ff0620f8 100644 --- a/lib/MasterSlave.pm +++ b/lib/MasterSlave.pm @@ -457,7 +457,12 @@ sub get_slave_status { } } } else { - $ss = $sss_rows->[0]; + if ($sss_rows->[0]->{channel_name} && $sss_rows->[0]->{channel_name} ne $self->{channel}) { + warn 'This server is using replication channels but "channel" was not specified on the command line'; + return undef; + } else { + $ss = $sss_rows->[0]; + } } if ( $ss && %$ss ) { diff --git a/t/lib/MasterSlave.t b/t/lib/MasterSlave.t index e1416d82..fb291e04 100644 --- a/t/lib/MasterSlave.t +++ b/t/lib/MasterSlave.t @@ -814,6 +814,20 @@ SKIP: { 'Wait for master returned error', ); + # After stopping one of the replication channels, show slave status returns only one slave + # but it has a channel name and we didn't specified a channels name in the command line. + # It should return undef + $slave1_dbh->do("STOP SLAVE for channel 'masterchan2'"); + + $css = $ms->get_slave_status($slave1_dbh); + is ( + $css, + undef, + 'Cannot determine slave in a multi source config without --channel param (only one server)' + ); + + $slave1_dbh->do("START SLAVE for channel 'masterchan2'"); + # Now try specifying a channel name $ms->{channel} = 'masterchan1'; $css = $ms->get_slave_status($slave1_dbh); From e25fc059c049e21d25c42c8eac12866007b2f962 Mon Sep 17 00:00:00 2001 From: azhebel Date: Mon, 31 Jul 2017 18:10:57 +0300 Subject: [PATCH 006/104] Bumped version and added external links --- config/sphinx-build/conf.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/config/sphinx-build/conf.py b/config/sphinx-build/conf.py index f4b30b8b..25808077 100644 --- a/config/sphinx-build/conf.py +++ b/config/sphinx-build/conf.py @@ -50,7 +50,7 @@ copyright = u'2017, Percona LLC and/or its affiliates' # The short X.Y version. version = '3.0' # The full version, including alpha/beta/rc tags. -release = '3.0.2' +release = '3.0.4' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. @@ -86,6 +86,8 @@ pygments_style = 'sphinx' # A list of ignored prefixes for module index sorting. #modindex_common_prefix = [] +extlinks = {'jirabug': ('https://jira.percona.com/browse/%s', ''), +'lpbug': ('https://bugs.launchpad.net/percona-toolkit/+bug/%s', '#')} # -- Options for HTML output --------------------------------------------------- From 85ecf7d30c833847599913663f62bd00717ae92d Mon Sep 17 00:00:00 2001 From: Carlos Salguero Date: Mon, 31 Jul 2017 15:29:08 -0300 Subject: [PATCH 007/104] Updated Percona::Toolkit version --- bin/pt-archiver | 2 +- bin/pt-config-diff | 2 +- bin/pt-deadlock-logger | 2 +- bin/pt-diskstats | 2 +- bin/pt-duplicate-key-checker | 2 +- bin/pt-find | 2 +- bin/pt-fk-error-logger | 2 +- bin/pt-heartbeat | 2 +- bin/pt-index-usage | 2 +- bin/pt-kill | 2 +- bin/pt-online-schema-change | 2 +- bin/pt-query-digest | 2 +- bin/pt-slave-delay | 2 +- bin/pt-slave-restart | 2 +- bin/pt-table-checksum | 2 +- bin/pt-table-sync | 2 +- bin/pt-upgrade | 2 +- bin/pt-variable-advisor | 2 +- lib/Percona/Toolkit.pm | 2 +- 19 files changed, 19 insertions(+), 19 deletions(-) diff --git a/bin/pt-archiver b/bin/pt-archiver index ff739e55..61c41a04 100755 --- a/bin/pt-archiver +++ b/bin/pt-archiver @@ -45,7 +45,7 @@ BEGIN { { package Percona::Toolkit; -our $VERSION = '3.0.3'; +our $VERSION = '3.0.4'; use strict; use warnings FATAL => 'all'; diff --git a/bin/pt-config-diff b/bin/pt-config-diff index 77639fe5..1317c79e 100755 --- a/bin/pt-config-diff +++ b/bin/pt-config-diff @@ -43,7 +43,7 @@ BEGIN { { package Percona::Toolkit; -our $VERSION = '3.0.3'; +our $VERSION = '3.0.4'; use strict; use warnings FATAL => 'all'; diff --git a/bin/pt-deadlock-logger b/bin/pt-deadlock-logger index 15e0e2d9..09ac78d1 100755 --- a/bin/pt-deadlock-logger +++ b/bin/pt-deadlock-logger @@ -42,7 +42,7 @@ BEGIN { { package Percona::Toolkit; -our $VERSION = '3.0.3'; +our $VERSION = '3.0.4'; use strict; use warnings FATAL => 'all'; diff --git a/bin/pt-diskstats b/bin/pt-diskstats index 3e0e2e76..0fada28a 100755 --- a/bin/pt-diskstats +++ b/bin/pt-diskstats @@ -38,7 +38,7 @@ BEGIN { { package Percona::Toolkit; -our $VERSION = '3.0.3'; +our $VERSION = '3.0.4'; use strict; use warnings FATAL => 'all'; diff --git a/bin/pt-duplicate-key-checker b/bin/pt-duplicate-key-checker index 6480f7e5..873eb371 100755 --- a/bin/pt-duplicate-key-checker +++ b/bin/pt-duplicate-key-checker @@ -39,7 +39,7 @@ BEGIN { { package Percona::Toolkit; -our $VERSION = '3.0.3'; +our $VERSION = '3.0.4'; use strict; use warnings FATAL => 'all'; diff --git a/bin/pt-find b/bin/pt-find index 4f300a53..f249376a 100755 --- a/bin/pt-find +++ b/bin/pt-find @@ -35,7 +35,7 @@ BEGIN { { package Percona::Toolkit; -our $VERSION = '3.0.3'; +our $VERSION = '3.0.4'; use strict; use warnings FATAL => 'all'; diff --git a/bin/pt-fk-error-logger b/bin/pt-fk-error-logger index 9e98eb85..d482a750 100755 --- a/bin/pt-fk-error-logger +++ b/bin/pt-fk-error-logger @@ -37,7 +37,7 @@ BEGIN { { package Percona::Toolkit; -our $VERSION = '3.0.3'; +our $VERSION = '3.0.4'; use strict; use warnings FATAL => 'all'; diff --git a/bin/pt-heartbeat b/bin/pt-heartbeat index 0877cd6f..31fc66d6 100755 --- a/bin/pt-heartbeat +++ b/bin/pt-heartbeat @@ -44,7 +44,7 @@ BEGIN { { package Percona::Toolkit; -our $VERSION = '3.0.3'; +our $VERSION = '3.0.4'; use strict; use warnings FATAL => 'all'; diff --git a/bin/pt-index-usage b/bin/pt-index-usage index 35960613..9c74b017 100755 --- a/bin/pt-index-usage +++ b/bin/pt-index-usage @@ -45,7 +45,7 @@ BEGIN { { package Percona::Toolkit; -our $VERSION = '3.0.3'; +our $VERSION = '3.0.4'; use strict; use warnings FATAL => 'all'; diff --git a/bin/pt-kill b/bin/pt-kill index 8fcb9765..d8e15197 100755 --- a/bin/pt-kill +++ b/bin/pt-kill @@ -47,7 +47,7 @@ BEGIN { { package Percona::Toolkit; -our $VERSION = '3.0.3'; +our $VERSION = '3.0.4'; use strict; use warnings FATAL => 'all'; diff --git a/bin/pt-online-schema-change b/bin/pt-online-schema-change index 32729f74..125e5dba 100755 --- a/bin/pt-online-schema-change +++ b/bin/pt-online-schema-change @@ -56,7 +56,7 @@ BEGIN { { package Percona::Toolkit; -our $VERSION = '3.0.3'; +our $VERSION = '3.0.4'; use strict; use warnings FATAL => 'all'; diff --git a/bin/pt-query-digest b/bin/pt-query-digest index c3b174a8..52fa933d 100755 --- a/bin/pt-query-digest +++ b/bin/pt-query-digest @@ -64,7 +64,7 @@ BEGIN { { package Percona::Toolkit; -our $VERSION = '3.0.3'; +our $VERSION = '3.0.4'; use strict; use warnings FATAL => 'all'; diff --git a/bin/pt-slave-delay b/bin/pt-slave-delay index 56032d14..d5134412 100755 --- a/bin/pt-slave-delay +++ b/bin/pt-slave-delay @@ -40,7 +40,7 @@ BEGIN { { package Percona::Toolkit; -our $VERSION = '3.0.3'; +our $VERSION = '3.0.4'; use strict; use warnings FATAL => 'all'; diff --git a/bin/pt-slave-restart b/bin/pt-slave-restart index 4ffb76ee..7ba3aabd 100755 --- a/bin/pt-slave-restart +++ b/bin/pt-slave-restart @@ -41,7 +41,7 @@ BEGIN { { package Percona::Toolkit; -our $VERSION = '3.0.3'; +our $VERSION = '3.0.4'; use strict; use warnings FATAL => 'all'; diff --git a/bin/pt-table-checksum b/bin/pt-table-checksum index 2d6fa5d6..eebf86fd 100755 --- a/bin/pt-table-checksum +++ b/bin/pt-table-checksum @@ -57,7 +57,7 @@ BEGIN { { package Percona::Toolkit; -our $VERSION = '3.0.3'; +our $VERSION = '3.0.4'; use strict; use warnings FATAL => 'all'; diff --git a/bin/pt-table-sync b/bin/pt-table-sync index 2a3af9e8..f2337bdb 100755 --- a/bin/pt-table-sync +++ b/bin/pt-table-sync @@ -55,7 +55,7 @@ BEGIN { { package Percona::Toolkit; -our $VERSION = '3.0.3'; +our $VERSION = '3.0.4'; use strict; use warnings FATAL => 'all'; diff --git a/bin/pt-upgrade b/bin/pt-upgrade index 3f9c0a7f..0760ce28 100755 --- a/bin/pt-upgrade +++ b/bin/pt-upgrade @@ -61,7 +61,7 @@ BEGIN { { package Percona::Toolkit; -our $VERSION = '3.0.3'; +our $VERSION = '3.0.4'; use strict; use warnings FATAL => 'all'; diff --git a/bin/pt-variable-advisor b/bin/pt-variable-advisor index ae0ffc9a..d6b6d891 100755 --- a/bin/pt-variable-advisor +++ b/bin/pt-variable-advisor @@ -44,7 +44,7 @@ BEGIN { { package Percona::Toolkit; -our $VERSION = '3.0.3'; +our $VERSION = '3.0.4'; use strict; use warnings FATAL => 'all'; diff --git a/lib/Percona/Toolkit.pm b/lib/Percona/Toolkit.pm index ff8109bb..fe10aa30 100644 --- a/lib/Percona/Toolkit.pm +++ b/lib/Percona/Toolkit.pm @@ -18,7 +18,7 @@ # ########################################################################### package Percona::Toolkit; -our $VERSION = '3.0.3'; +our $VERSION = '3.0.4'; use strict; use warnings FATAL => 'all'; From 7c70ae1de2ed7813b771181daeb4791d247fd2a7 Mon Sep 17 00:00:00 2001 From: Carlos Salguero Date: Mon, 31 Jul 2017 15:49:08 -0300 Subject: [PATCH 008/104] Updated build script to manage :jirabug: --- util/build-packages | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/build-packages b/util/build-packages index dec2d2d2..0942ee21 100755 --- a/util/build-packages +++ b/util/build-packages @@ -321,7 +321,7 @@ update_rel_notes() { # to # * `PT-73 `_: Added support for SSL connections to ``pt-mongodb-summary`` and ``pt-mongodb-query-digest`` - sed -i.bak -e 's|\^*\s*\(PT-\([[:digit:]]\+\)\):| `\1 `_:|' release_notes.rst + sed -i.bak -e 's|^\*\s*:jirabug:`\(PT-\([[:digit:]]\+\)\)`:|* :jirabug:`\1 `_:|' release_notes.rst # Lauchpad tickets From 8dacd0669d693bd358755983a2f32acc7ee6018d Mon Sep 17 00:00:00 2001 From: Carlos Salguero Date: Mon, 31 Jul 2017 15:53:14 -0300 Subject: [PATCH 009/104] Removed sed's to add links to tickets --- util/build-packages | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/util/build-packages b/util/build-packages index 0942ee21..a26bb2b8 100755 --- a/util/build-packages +++ b/util/build-packages @@ -315,23 +315,6 @@ update_rel_notes() { mv /tmp/release_notes.tmp release_notes.rst - # Convert issues numbers to links: - # Jira tickets - # * PT-73: Added support for SSL connections to ``pt-mongodb-summary`` and ``pt-mongodb-query-digest`` - # to - # * `PT-73 `_: Added support for SSL connections to ``pt-mongodb-summary`` and ``pt-mongodb-query-digest`` - - sed -i.bak -e 's|^\*\s*:jirabug:`\(PT-\([[:digit:]]\+\)\)`:|* :jirabug:`\1 `_:|' release_notes.rst - - - # Lauchpad tickets - # * 1642751: Enabled gathering of information about locks and transactions by ``pt-stalk`` using Performance Schema if it is enabled - # to - # * `1642751 `_: Enabled gathering of information about locks and transactions - # by ``pt-stalk`` using Performance Schema if it is enabled - sed -i.bak -e 's|^*\s*\(\([[:digit:]]\+\)\)\s*:|* `\1 `_:|' release_notes.rst - - echo "OK" } From 481acbaaa0d4783324e96f6a1e5dfee1a7450f0e Mon Sep 17 00:00:00 2001 From: Carlos Salguero Date: Mon, 31 Jul 2017 16:07:19 -0300 Subject: [PATCH 010/104] Updates for 3.0.4 release - Updated lib/Percona/Toolkit.pm version to 3.0.4 - Updated all scripts version to 3.0.4 - Updated the build script removing seds to add links to Jira/Launchpad in favor of a solution in config/sphinx-build/conf.py --- bin/pt-archiver | 2 +- bin/pt-config-diff | 2 +- bin/pt-deadlock-logger | 2 +- bin/pt-diskstats | 2 +- bin/pt-duplicate-key-checker | 2 +- bin/pt-find | 2 +- bin/pt-fk-error-logger | 2 +- bin/pt-heartbeat | 2 +- bin/pt-index-usage | 2 +- bin/pt-kill | 2 +- bin/pt-online-schema-change | 2 +- bin/pt-query-digest | 2 +- bin/pt-slave-delay | 2 +- bin/pt-slave-restart | 2 +- bin/pt-table-checksum | 2 +- bin/pt-table-sync | 2 +- bin/pt-upgrade | 2 +- bin/pt-variable-advisor | 2 +- lib/Percona/Toolkit.pm | 2 +- util/build-packages | 17 ----------------- 20 files changed, 19 insertions(+), 36 deletions(-) diff --git a/bin/pt-archiver b/bin/pt-archiver index ff739e55..61c41a04 100755 --- a/bin/pt-archiver +++ b/bin/pt-archiver @@ -45,7 +45,7 @@ BEGIN { { package Percona::Toolkit; -our $VERSION = '3.0.3'; +our $VERSION = '3.0.4'; use strict; use warnings FATAL => 'all'; diff --git a/bin/pt-config-diff b/bin/pt-config-diff index 77639fe5..1317c79e 100755 --- a/bin/pt-config-diff +++ b/bin/pt-config-diff @@ -43,7 +43,7 @@ BEGIN { { package Percona::Toolkit; -our $VERSION = '3.0.3'; +our $VERSION = '3.0.4'; use strict; use warnings FATAL => 'all'; diff --git a/bin/pt-deadlock-logger b/bin/pt-deadlock-logger index 15e0e2d9..09ac78d1 100755 --- a/bin/pt-deadlock-logger +++ b/bin/pt-deadlock-logger @@ -42,7 +42,7 @@ BEGIN { { package Percona::Toolkit; -our $VERSION = '3.0.3'; +our $VERSION = '3.0.4'; use strict; use warnings FATAL => 'all'; diff --git a/bin/pt-diskstats b/bin/pt-diskstats index 3e0e2e76..0fada28a 100755 --- a/bin/pt-diskstats +++ b/bin/pt-diskstats @@ -38,7 +38,7 @@ BEGIN { { package Percona::Toolkit; -our $VERSION = '3.0.3'; +our $VERSION = '3.0.4'; use strict; use warnings FATAL => 'all'; diff --git a/bin/pt-duplicate-key-checker b/bin/pt-duplicate-key-checker index 6480f7e5..873eb371 100755 --- a/bin/pt-duplicate-key-checker +++ b/bin/pt-duplicate-key-checker @@ -39,7 +39,7 @@ BEGIN { { package Percona::Toolkit; -our $VERSION = '3.0.3'; +our $VERSION = '3.0.4'; use strict; use warnings FATAL => 'all'; diff --git a/bin/pt-find b/bin/pt-find index 4f300a53..f249376a 100755 --- a/bin/pt-find +++ b/bin/pt-find @@ -35,7 +35,7 @@ BEGIN { { package Percona::Toolkit; -our $VERSION = '3.0.3'; +our $VERSION = '3.0.4'; use strict; use warnings FATAL => 'all'; diff --git a/bin/pt-fk-error-logger b/bin/pt-fk-error-logger index 9e98eb85..d482a750 100755 --- a/bin/pt-fk-error-logger +++ b/bin/pt-fk-error-logger @@ -37,7 +37,7 @@ BEGIN { { package Percona::Toolkit; -our $VERSION = '3.0.3'; +our $VERSION = '3.0.4'; use strict; use warnings FATAL => 'all'; diff --git a/bin/pt-heartbeat b/bin/pt-heartbeat index 0877cd6f..31fc66d6 100755 --- a/bin/pt-heartbeat +++ b/bin/pt-heartbeat @@ -44,7 +44,7 @@ BEGIN { { package Percona::Toolkit; -our $VERSION = '3.0.3'; +our $VERSION = '3.0.4'; use strict; use warnings FATAL => 'all'; diff --git a/bin/pt-index-usage b/bin/pt-index-usage index 35960613..9c74b017 100755 --- a/bin/pt-index-usage +++ b/bin/pt-index-usage @@ -45,7 +45,7 @@ BEGIN { { package Percona::Toolkit; -our $VERSION = '3.0.3'; +our $VERSION = '3.0.4'; use strict; use warnings FATAL => 'all'; diff --git a/bin/pt-kill b/bin/pt-kill index 8fcb9765..d8e15197 100755 --- a/bin/pt-kill +++ b/bin/pt-kill @@ -47,7 +47,7 @@ BEGIN { { package Percona::Toolkit; -our $VERSION = '3.0.3'; +our $VERSION = '3.0.4'; use strict; use warnings FATAL => 'all'; diff --git a/bin/pt-online-schema-change b/bin/pt-online-schema-change index 32729f74..125e5dba 100755 --- a/bin/pt-online-schema-change +++ b/bin/pt-online-schema-change @@ -56,7 +56,7 @@ BEGIN { { package Percona::Toolkit; -our $VERSION = '3.0.3'; +our $VERSION = '3.0.4'; use strict; use warnings FATAL => 'all'; diff --git a/bin/pt-query-digest b/bin/pt-query-digest index c3b174a8..52fa933d 100755 --- a/bin/pt-query-digest +++ b/bin/pt-query-digest @@ -64,7 +64,7 @@ BEGIN { { package Percona::Toolkit; -our $VERSION = '3.0.3'; +our $VERSION = '3.0.4'; use strict; use warnings FATAL => 'all'; diff --git a/bin/pt-slave-delay b/bin/pt-slave-delay index 56032d14..d5134412 100755 --- a/bin/pt-slave-delay +++ b/bin/pt-slave-delay @@ -40,7 +40,7 @@ BEGIN { { package Percona::Toolkit; -our $VERSION = '3.0.3'; +our $VERSION = '3.0.4'; use strict; use warnings FATAL => 'all'; diff --git a/bin/pt-slave-restart b/bin/pt-slave-restart index 4ffb76ee..7ba3aabd 100755 --- a/bin/pt-slave-restart +++ b/bin/pt-slave-restart @@ -41,7 +41,7 @@ BEGIN { { package Percona::Toolkit; -our $VERSION = '3.0.3'; +our $VERSION = '3.0.4'; use strict; use warnings FATAL => 'all'; diff --git a/bin/pt-table-checksum b/bin/pt-table-checksum index 2d6fa5d6..eebf86fd 100755 --- a/bin/pt-table-checksum +++ b/bin/pt-table-checksum @@ -57,7 +57,7 @@ BEGIN { { package Percona::Toolkit; -our $VERSION = '3.0.3'; +our $VERSION = '3.0.4'; use strict; use warnings FATAL => 'all'; diff --git a/bin/pt-table-sync b/bin/pt-table-sync index 2a3af9e8..f2337bdb 100755 --- a/bin/pt-table-sync +++ b/bin/pt-table-sync @@ -55,7 +55,7 @@ BEGIN { { package Percona::Toolkit; -our $VERSION = '3.0.3'; +our $VERSION = '3.0.4'; use strict; use warnings FATAL => 'all'; diff --git a/bin/pt-upgrade b/bin/pt-upgrade index 3f9c0a7f..0760ce28 100755 --- a/bin/pt-upgrade +++ b/bin/pt-upgrade @@ -61,7 +61,7 @@ BEGIN { { package Percona::Toolkit; -our $VERSION = '3.0.3'; +our $VERSION = '3.0.4'; use strict; use warnings FATAL => 'all'; diff --git a/bin/pt-variable-advisor b/bin/pt-variable-advisor index ae0ffc9a..d6b6d891 100755 --- a/bin/pt-variable-advisor +++ b/bin/pt-variable-advisor @@ -44,7 +44,7 @@ BEGIN { { package Percona::Toolkit; -our $VERSION = '3.0.3'; +our $VERSION = '3.0.4'; use strict; use warnings FATAL => 'all'; diff --git a/lib/Percona/Toolkit.pm b/lib/Percona/Toolkit.pm index ff8109bb..fe10aa30 100644 --- a/lib/Percona/Toolkit.pm +++ b/lib/Percona/Toolkit.pm @@ -18,7 +18,7 @@ # ########################################################################### package Percona::Toolkit; -our $VERSION = '3.0.3'; +our $VERSION = '3.0.4'; use strict; use warnings FATAL => 'all'; diff --git a/util/build-packages b/util/build-packages index dec2d2d2..a26bb2b8 100755 --- a/util/build-packages +++ b/util/build-packages @@ -315,23 +315,6 @@ update_rel_notes() { mv /tmp/release_notes.tmp release_notes.rst - # Convert issues numbers to links: - # Jira tickets - # * PT-73: Added support for SSL connections to ``pt-mongodb-summary`` and ``pt-mongodb-query-digest`` - # to - # * `PT-73 `_: Added support for SSL connections to ``pt-mongodb-summary`` and ``pt-mongodb-query-digest`` - - sed -i.bak -e 's|\^*\s*\(PT-\([[:digit:]]\+\)\):| `\1 `_:|' release_notes.rst - - - # Lauchpad tickets - # * 1642751: Enabled gathering of information about locks and transactions by ``pt-stalk`` using Performance Schema if it is enabled - # to - # * `1642751 `_: Enabled gathering of information about locks and transactions - # by ``pt-stalk`` using Performance Schema if it is enabled - sed -i.bak -e 's|^*\s*\(\([[:digit:]]\+\)\)\s*:|* `\1 `_:|' release_notes.rst - - echo "OK" } From b46e8bc7c1d0a18ff74100fba49e2a07cb5ce912 Mon Sep 17 00:00:00 2001 From: Carlos Salguero Date: Mon, 31 Jul 2017 16:14:02 -0300 Subject: [PATCH 011/104] Updated build config to convert issues to links --- config/sphinx-build/conf.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config/sphinx-build/conf.py b/config/sphinx-build/conf.py index f4b30b8b..f2982805 100644 --- a/config/sphinx-build/conf.py +++ b/config/sphinx-build/conf.py @@ -86,7 +86,8 @@ pygments_style = 'sphinx' # A list of ignored prefixes for module index sorting. #modindex_common_prefix = [] - +extlinks = {'jirabug': ('https://jira.percona.com/browse/%s', ''), +'lpbug': ('https://bugs.launchpad.net/percona-toolkit/+bug/%s', '#')} # -- Options for HTML output --------------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for From 5aa73ccbbd314e139ee991a11982a7b91b748b07 Mon Sep 17 00:00:00 2001 From: Alexey Date: Mon, 31 Jul 2017 23:42:52 +0300 Subject: [PATCH 012/104] Add the 'sphinx.ext.extlinks' extension --- config/sphinx-build/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/sphinx-build/conf.py b/config/sphinx-build/conf.py index 25808077..82194165 100644 --- a/config/sphinx-build/conf.py +++ b/config/sphinx-build/conf.py @@ -25,7 +25,7 @@ import sys, os # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. -extensions = ['sphinx.ext.autodoc'] +extensions = ['sphinx.ext.autodoc', 'sphinx.ext.extlinks'] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] From 21a50907ba73ca5368de7f376a9be44080161dd9 Mon Sep 17 00:00:00 2001 From: Mykola Marzhan Date: Tue, 1 Aug 2017 11:32:30 +0300 Subject: [PATCH 013/104] RM-269 add v3.0.4 release notes --- Changelog | 1 + docs/release_notes.rst | 81 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 82 insertions(+) diff --git a/Changelog b/Changelog index 978cfe59..8cbaefd9 100644 --- a/Changelog +++ b/Changelog @@ -1,5 +1,6 @@ Changelog for Percona Toolkit +v3.0.4 released 2017-08-02 * Fixed bug PT-181 : pt-online-schema-change not in sync with modules (Thanks DaniĆ«l van Eeden) * Fixed bug PT-180 : pt-online-schema-change --skip-check-slave-lag doesn't work diff --git a/docs/release_notes.rst b/docs/release_notes.rst index 0540c14a..d96bf8cd 100644 --- a/docs/release_notes.rst +++ b/docs/release_notes.rst @@ -1,6 +1,87 @@ Release Notes ************* +v3.0.4 released 2017-08-02 +========================== + +Percona Toolkit 3.0.4 includes the following changes: + +New Features + +* :jirabug:`PT-90`: Added collection of information about prepared statements + by ``pt-stalk`` when Performance Schema is enabled. + For more information, see :lpbug:`1642750`. + +* :jirabug:`PT-91`: Added the ``--preserve-triggers`` option + for ``pt-online-schema-change`` to support ``AFTER`` triggers. + +* :jirabug:`PT-138`: Added ``--output-format`` option + for ``pt-mongodb-summary`` to choose between JSON format + and the default plain text. + +* :jirabug:`PT-141`: Added the ``--output-format=csv`` parameter + for ``pt-archiver`` to archive rows in CSV format. + +* :jirabug:`PT-142`: Added the ``--only-same-schema-fks`` option + for ``pt-online-schema-change`` to check foreigns keys only on tables + with the same schema as the original table. + This should speed up the tool's execution, + but keep in mind that if you have foreign keys + referencing tables in other schemas, + they won't be detected. + For more information, see :lpbug:`1690122`. + +* :jirabug:`PT-153`: Added the ``--check-unique-key-change`` option + for ``pt-online-schema-change`` to abort + if the specified statement for ``--alter`` is trying to add a unique index. + This is supposed to avoid adding duplicate keys + that might lead to silently losing data. + +* :jirabug:`PT-173`: Added the ``--truncate-replicate-table`` option + for ``pt-table-checksum`` to ensure stale data is removed. + +Bug fixes + +* :jirabug:`PT-136`: Fixed ``pt-table-checksum`` to support tables + that have columns with different collations or charsets. + For more information, see :lpbug:`1674266`. + +* :jirabug:`PT-143`: Fixed primary key handling by ``pt-archiver``. + For more information, see :lpbug:`1691630`. + +* :jirabug:`PT-144`: Limited constraint name in the new table + when running ``pt-online-schema-change``. + For more information, see :lpbug:`1491674`. + +* :jirabug:`PT-146`: Fixed the ``--no-check-binlog-format`` option + for ``pt-table-checksum`` to work as expected. + +* :jirabug:`PT-148`: Fixed the use of uninitialized value in ``printf()`` + for ``pt-online-schema-change``. + For more information, see :lpbug:`1693614`. + +* :jirabug:`PT-151`: Fixed ``pt-table-sync`` to prevent field type ``point`` + to be taken as decimal. + +* :jirabug:`PT-154`: Reverted :jirabug:`PT-116` + to remove the ``--use-insert-ignore`` option + from ``pt-online-schema-change``. + +* :jirabug:`PT-161`: Fixed the ``--skip-check-slave-lag`` feature + for ``pt-table-checksum`` to safely check for undefined values. + +* :jirabug:`PT-178`: Fixed regression in ``--check-slave-lag`` option + for ``pt-online-schema-change``. + +* :jirabug:`PT-180`: Fixed regression in ``--skip-check-slave-lag`` option + for ``pt-online-schema-change``. + +* :jirabug:`PT-181`: Fixed syntax error in ``pt-online-schema-change``. + +Other Improvements + +* :jirabug:`PT-162`: Updated list of tables ignored by ``pt-table-checksum``. + v3.0.3 released 2017-05-18 ========================== From 70265ad22f28f95e76e634cc48cc60ac19c4125e Mon Sep 17 00:00:00 2001 From: Mykola Marzhan Date: Tue, 1 Aug 2017 13:28:32 +0300 Subject: [PATCH 014/104] RM-269 bump version --- Makefile.PL | 2 +- bin/pt-align | 2 +- bin/pt-archiver | 2 +- bin/pt-config-diff | 2 +- bin/pt-deadlock-logger | 2 +- bin/pt-diskstats | 2 +- bin/pt-duplicate-key-checker | 2 +- bin/pt-fifo-split | 2 +- bin/pt-find | 2 +- bin/pt-fingerprint | 2 +- bin/pt-fk-error-logger | 2 +- bin/pt-heartbeat | 2 +- bin/pt-index-usage | 2 +- bin/pt-ioprofile | 2 +- bin/pt-kill | 2 +- bin/pt-mext | 2 +- bin/pt-mysql-summary | 2 +- bin/pt-online-schema-change | 2 +- bin/pt-pmp | 2 +- bin/pt-query-digest | 2 +- bin/pt-show-grants | 2 +- bin/pt-sift | 2 +- bin/pt-slave-delay | 2 +- bin/pt-slave-find | 2 +- bin/pt-slave-restart | 2 +- bin/pt-stalk | 2 +- bin/pt-summary | 2 +- bin/pt-table-checksum | 2 +- bin/pt-table-sync | 2 +- bin/pt-table-usage | 2 +- bin/pt-upgrade | 2 +- bin/pt-variable-advisor | 2 +- bin/pt-visual-explain | 2 +- config/deb/changelog | 41 ++++++++++++++++++++++++++++++++++++ docs/percona-toolkit.pod | 2 +- src/go/Makefile | 2 +- 36 files changed, 76 insertions(+), 35 deletions(-) diff --git a/Makefile.PL b/Makefile.PL index 636669c1..7db7f5c0 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -2,7 +2,7 @@ use ExtUtils::MakeMaker; WriteMakefile( NAME => 'percona-toolkit', - VERSION => '3.0.2', + VERSION => '3.0.4', EXE_FILES => [ ], MAN1PODS => { 'docs/percona-toolkit.pod' => 'blib/man1/percona-toolkit.1p', diff --git a/bin/pt-align b/bin/pt-align index b22f2114..a15d0574 100755 --- a/bin/pt-align +++ b/bin/pt-align @@ -1359,6 +1359,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA. =head1 VERSION -pt-align 3.0.2 +pt-align 3.0.4 =cut diff --git a/bin/pt-archiver b/bin/pt-archiver index 61c41a04..6fac0681 100755 --- a/bin/pt-archiver +++ b/bin/pt-archiver @@ -8471,6 +8471,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA. =head1 VERSION -pt-archiver 3.0.2 +pt-archiver 3.0.4 =cut diff --git a/bin/pt-config-diff b/bin/pt-config-diff index 1317c79e..b688de65 100755 --- a/bin/pt-config-diff +++ b/bin/pt-config-diff @@ -5843,6 +5843,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA. =head1 VERSION -pt-config-diff 3.0.2 +pt-config-diff 3.0.4 =cut diff --git a/bin/pt-deadlock-logger b/bin/pt-deadlock-logger index 09ac78d1..50448b8f 100755 --- a/bin/pt-deadlock-logger +++ b/bin/pt-deadlock-logger @@ -5633,6 +5633,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA. =head1 VERSION -pt-deadlock-logger 3.0.2 +pt-deadlock-logger 3.0.4 =cut diff --git a/bin/pt-diskstats b/bin/pt-diskstats index 0fada28a..1333a5f1 100755 --- a/bin/pt-diskstats +++ b/bin/pt-diskstats @@ -5627,6 +5627,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA. =head1 VERSION -pt-diskstats 3.0.2 +pt-diskstats 3.0.4 =cut diff --git a/bin/pt-duplicate-key-checker b/bin/pt-duplicate-key-checker index 873eb371..3b4c8f9a 100755 --- a/bin/pt-duplicate-key-checker +++ b/bin/pt-duplicate-key-checker @@ -5678,6 +5678,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA. =head1 VERSION -pt-duplicate-key-checker 3.0.2 +pt-duplicate-key-checker 3.0.4 =cut diff --git a/bin/pt-fifo-split b/bin/pt-fifo-split index 7fd5d61e..766a8ba5 100755 --- a/bin/pt-fifo-split +++ b/bin/pt-fifo-split @@ -1648,6 +1648,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA. =head1 VERSION -pt-fifo-split 3.0.2 +pt-fifo-split 3.0.4 =cut diff --git a/bin/pt-find b/bin/pt-find index f249376a..444d6042 100755 --- a/bin/pt-find +++ b/bin/pt-find @@ -5037,6 +5037,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA. =head1 VERSION -pt-find 3.0.2 +pt-find 3.0.4 =cut diff --git a/bin/pt-fingerprint b/bin/pt-fingerprint index 0e45e58e..90745d96 100755 --- a/bin/pt-fingerprint +++ b/bin/pt-fingerprint @@ -2239,6 +2239,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA. =head1 VERSION -pt-fingerprint 3.0.2 +pt-fingerprint 3.0.4 =cut diff --git a/bin/pt-fk-error-logger b/bin/pt-fk-error-logger index d482a750..18b2dbef 100755 --- a/bin/pt-fk-error-logger +++ b/bin/pt-fk-error-logger @@ -4619,6 +4619,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA. =head1 VERSION -pt-fk-error-logger 3.0.2 +pt-fk-error-logger 3.0.4 =cut diff --git a/bin/pt-heartbeat b/bin/pt-heartbeat index 31fc66d6..412ef46d 100755 --- a/bin/pt-heartbeat +++ b/bin/pt-heartbeat @@ -7205,6 +7205,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA. =head1 VERSION -pt-heartbeat 3.0.2 +pt-heartbeat 3.0.4 =cut diff --git a/bin/pt-index-usage b/bin/pt-index-usage index 9c74b017..3a95a702 100755 --- a/bin/pt-index-usage +++ b/bin/pt-index-usage @@ -7608,6 +7608,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA. =head1 VERSION -pt-index-usage 3.0.2 +pt-index-usage 3.0.4 =cut diff --git a/bin/pt-ioprofile b/bin/pt-ioprofile index 215739fd..a4423d9e 100755 --- a/bin/pt-ioprofile +++ b/bin/pt-ioprofile @@ -1127,7 +1127,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA. =head1 VERSION -pt-ioprofile 3.0.2 +pt-ioprofile 3.0.4 =cut diff --git a/bin/pt-kill b/bin/pt-kill index d8e15197..a3c98aaa 100755 --- a/bin/pt-kill +++ b/bin/pt-kill @@ -8373,6 +8373,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA. =head1 VERSION -pt-kill 3.0.2 +pt-kill 3.0.4 =cut diff --git a/bin/pt-mext b/bin/pt-mext index 381c8bb1..8281b40b 100755 --- a/bin/pt-mext +++ b/bin/pt-mext @@ -804,7 +804,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA. =head1 VERSION -pt-mext 3.0.2 +pt-mext 3.0.4 =cut diff --git a/bin/pt-mysql-summary b/bin/pt-mysql-summary index 6827823c..10f0ea56 100755 --- a/bin/pt-mysql-summary +++ b/bin/pt-mysql-summary @@ -3139,7 +3139,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA. =head1 VERSION -pt-mysql-summary 3.0.2 +pt-mysql-summary 3.0.4 =cut diff --git a/bin/pt-online-schema-change b/bin/pt-online-schema-change index 125e5dba..93ad2825 100755 --- a/bin/pt-online-schema-change +++ b/bin/pt-online-schema-change @@ -12906,6 +12906,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA. =head1 VERSION -pt-online-schema-change 3.0.2 +pt-online-schema-change 3.0.4 =cut diff --git a/bin/pt-pmp b/bin/pt-pmp index e8b2c3ec..dbf8774c 100755 --- a/bin/pt-pmp +++ b/bin/pt-pmp @@ -897,7 +897,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA. =head1 VERSION -pt-pmp 3.0.2 +pt-pmp 3.0.4 =cut diff --git a/bin/pt-query-digest b/bin/pt-query-digest index 52fa933d..3ede8cb7 100755 --- a/bin/pt-query-digest +++ b/bin/pt-query-digest @@ -16752,6 +16752,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA. =head1 VERSION -pt-query-digest 3.0.2 +pt-query-digest 3.0.4 =cut diff --git a/bin/pt-show-grants b/bin/pt-show-grants index e1b57e34..075454bf 100755 --- a/bin/pt-show-grants +++ b/bin/pt-show-grants @@ -2524,6 +2524,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA. =head1 VERSION -pt-show-grants 3.0.2 +pt-show-grants 3.0.4 =cut diff --git a/bin/pt-sift b/bin/pt-sift index 60c7e915..39f8f846 100755 --- a/bin/pt-sift +++ b/bin/pt-sift @@ -1245,7 +1245,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA. =head1 VERSION -pt-sift 3.0.2 +pt-sift 3.0.4 =cut diff --git a/bin/pt-slave-delay b/bin/pt-slave-delay index d5134412..d274f68b 100755 --- a/bin/pt-slave-delay +++ b/bin/pt-slave-delay @@ -4919,6 +4919,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA. =head1 VERSION -pt-slave-delay 3.0.2 +pt-slave-delay 3.0.4 =cut diff --git a/bin/pt-slave-find b/bin/pt-slave-find index 578afa54..01ec4f0e 100755 --- a/bin/pt-slave-find +++ b/bin/pt-slave-find @@ -4445,6 +4445,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA. =head1 VERSION -pt-slave-find 3.0.2 +pt-slave-find 3.0.4 =cut diff --git a/bin/pt-slave-restart b/bin/pt-slave-restart index 7ba3aabd..0d5d5a13 100755 --- a/bin/pt-slave-restart +++ b/bin/pt-slave-restart @@ -6034,6 +6034,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA. =head1 VERSION -pt-slave-restart 3.0.2 +pt-slave-restart 3.0.4 =cut diff --git a/bin/pt-stalk b/bin/pt-stalk index 2bc7b94b..802f8832 100755 --- a/bin/pt-stalk +++ b/bin/pt-stalk @@ -2346,7 +2346,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA. =head1 VERSION -pt-stalk 3.0.2 +pt-stalk 3.0.4 =cut diff --git a/bin/pt-summary b/bin/pt-summary index 2acadac5..e080d88e 100755 --- a/bin/pt-summary +++ b/bin/pt-summary @@ -2723,7 +2723,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA. =head1 VERSION -pt-summary 3.0.2 +pt-summary 3.0.4 =cut diff --git a/bin/pt-table-checksum b/bin/pt-table-checksum index eebf86fd..70eb2051 100755 --- a/bin/pt-table-checksum +++ b/bin/pt-table-checksum @@ -13168,6 +13168,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA. =head1 VERSION -pt-table-checksum 3.0.2 +pt-table-checksum 3.0.4 =cut diff --git a/bin/pt-table-sync b/bin/pt-table-sync index f2337bdb..79887322 100755 --- a/bin/pt-table-sync +++ b/bin/pt-table-sync @@ -12899,6 +12899,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA. =head1 VERSION -pt-table-sync 3.0.2 +pt-table-sync 3.0.4 =cut diff --git a/bin/pt-table-usage b/bin/pt-table-usage index 77b809a1..91831b4a 100755 --- a/bin/pt-table-usage +++ b/bin/pt-table-usage @@ -8469,6 +8469,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA. =head1 VERSION -pt-table-usage 3.0.2 +pt-table-usage 3.0.4 =cut diff --git a/bin/pt-upgrade b/bin/pt-upgrade index 0760ce28..11eed616 100755 --- a/bin/pt-upgrade +++ b/bin/pt-upgrade @@ -11368,6 +11368,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA. =head1 VERSION -pt-upgrade 3.0.2 +pt-upgrade 3.0.4 =cut diff --git a/bin/pt-variable-advisor b/bin/pt-variable-advisor index d6b6d891..72df7372 100755 --- a/bin/pt-variable-advisor +++ b/bin/pt-variable-advisor @@ -6188,6 +6188,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA. =head1 VERSION -pt-variable-advisor 3.0.2 +pt-variable-advisor 3.0.4 =cut diff --git a/bin/pt-visual-explain b/bin/pt-visual-explain index 445f9ecf..381789cd 100755 --- a/bin/pt-visual-explain +++ b/bin/pt-visual-explain @@ -3281,6 +3281,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA. =head1 VERSION -pt-visual-explain 3.0.2 +pt-visual-explain 3.0.4 =cut diff --git a/config/deb/changelog b/config/deb/changelog index 3b8c3bf4..8e5d7b6e 100644 --- a/config/deb/changelog +++ b/config/deb/changelog @@ -1,3 +1,44 @@ +percona-toolkit (3.0.4-1) unstable; urgency=low + + * Fixed bug PT-181 : pt-online-schema-change not in sync with modules (Thanks DaniĆ«l van Eeden) + * Fixed bug PT-180 : pt-online-schema-change --skip-check-slave-lag doesn't work + * Fixed bug PT-178 : pt-online-schema-change appears to ignore the --check-slave-lag option + * Fixed bug PT-162 : Updated pt-table-checksum ignored dbs (Thanks Agustin Gallego) + * Fixed bug PT-161 : Safely check for undefined values in --skip-check-slave-lag (Thanks Chris Swingler) + * Fixed bug PT-154 : pt-online-schema-change --no-use-insert-ignore is broken + * Fixed bug PT-153 : pt-online-schema-change data loss when adding unique keys + * Fixed bug PT-151 : point is not decimal + * Fixed bug PT-148 : pt-osc Use of uninitialized value in printf + * Fixed bug PT-146 : Turn off statement based binlog checks + * Fixed bug PT-144 : Constraint name is too long (> 64 chars) + * Fixed bug PT-143 : pt-archiver SELECT query fails because of primary key + * Fixed bug PT-142 : pt-online-schema-change find_child_tables slow + * Fixed bug PT-138 : Added --output-format option to pt-mongodb-summary + * Fixed bug PT-136 : pt-table-checksum fails with columns having different collation/charset + * Feature PT-173 : Enable pt-table-checksum to ensure stale data is removed + * Feature PT-141 : pt-archiver archive records into csv file + * Feature PT-91 : Make pt-osc compatible with AFTER triggers + * Feature PT-90 : pt-stalk: Collect information about prepared statements if P_S is enabled (Thanks Agustin Gallego) + + -- Percona Toolkit Developers Tue, 01 Aug 2017 09:35:45 +0000 + +percona-toolkit (3.0.3-1) unstable; urgency=low + + * Fixed bug PT-133 : Sandbox won't start correctly if autocommit=0 in my.cnf + * Fixed bug PT-132 : pt-online-schema-change should imply --no-drop-new-table + * Fixed bug PT-130 : Fixed pt-mext not working with not empty Rsa_public_key + * Fixed bug PT-128 : pt-stalk ps include memory usage outputs + * Fixed bug PT-126 : Recognize comments in ALTER + * Fixed bug PT-116 : pt-online-schema change eats data on adding a unique index. Added --[no]use-insert-ignore + * Feature PT-115 : Make DSNs params able to be repeatable + * Fixed bug PT-115 : Made OptionParser to accept repeatable DSNs + * Fixed bug PT-111 : Collect MySQL variables + * Fixed bug PT-087 : Add --skip-check-slave-lag to pt-table-checksum + * Fixed bug PT-086 : Added --skip-check-slave-lag to pt-osc + * Fixed bug PT-080 : Added support for slave status in pt-stalk + + -- Percona Toolkit Developers Tue, 01 Aug 2017 10:23:25 +0000 + percona-toolkit (3.0.2-1) unstable; urgency=low * Fixed bug PT-73 : pt-mongodb tools add support for SSL connections diff --git a/docs/percona-toolkit.pod b/docs/percona-toolkit.pod index 1a5eb44a..322f735d 100644 --- a/docs/percona-toolkit.pod +++ b/docs/percona-toolkit.pod @@ -560,6 +560,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA. =head1 VERSION -Percona Toolkit v3.0.2 released 2017-03-23 +Percona Toolkit v3.0.4 released 2017-08-02 =cut diff --git a/src/go/Makefile b/src/go/Makefile index 9722b52b..cda11d26 100644 --- a/src/go/Makefile +++ b/src/go/Makefile @@ -1,6 +1,6 @@ GO := go pkgs = $(shell find . -type d -name "pt-mongodb*" -exec basename {} \;) -VERSION="3.0.2" +VERSION="3.0.4" BUILD=$(shell date +%FT%T%z) GOVERSION=$(shell go version | cut --delimiter=" " -f3) From 2e44c3a86898525aab4c281dfd6c8d62dedd09fe Mon Sep 17 00:00:00 2001 From: Mykola Marzhan Date: Tue, 1 Aug 2017 14:48:15 +0300 Subject: [PATCH 015/104] RM-269 rename README to README.md --- config/rpm/percona-toolkit.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/rpm/percona-toolkit.spec b/config/rpm/percona-toolkit.spec index 1a0bc80a..b2bddfc9 100644 --- a/config/rpm/percona-toolkit.spec +++ b/config/rpm/percona-toolkit.spec @@ -48,7 +48,7 @@ rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root,-) -%doc COPYING INSTALL README Changelog +%doc COPYING INSTALL README.md Changelog %{_bindir}/* %{_mandir}/man1/*.1* From f48297af94cb9291742ed140271bbfb6e7ccc992 Mon Sep 17 00:00:00 2001 From: Alexey Date: Wed, 2 Aug 2017 16:39:20 +0300 Subject: [PATCH 016/104] Remove Ubuntu 12.04 from list of supported distros --- docs/installation.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/installation.rst b/docs/installation.rst index ec497a5e..c03718d9 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -8,7 +8,6 @@ Percona provides packages for most popular 64-bit Linux distributions: * Debian 7 ("wheezy") * Debian 8 ("jessie") -* Ubuntu 12.04 LTS (Precise Pangolin) * Ubuntu 14.04 LTS (Trusty Tahr) * Ubuntu 16.04 LTS (Xenial Xerus) * Ubuntu 16.10 (Yakkety Yak) From 05769ba23438888f7163625a1f588d2c1e2df21c Mon Sep 17 00:00:00 2001 From: Carlos Salguero Date: Wed, 2 Aug 2017 15:23:35 -0300 Subject: [PATCH 017/104] PT-183 pt-mongodb-query-digest fails to connect Fixed connection params to connect to a db using authentication --- .../fingerprinter/figerprinter_test.go | 29 +++++++++++++++++++ src/go/pt-mongodb-query-digest/main.go | 7 +++-- 2 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 src/go/mongolib/fingerprinter/figerprinter_test.go diff --git a/src/go/mongolib/fingerprinter/figerprinter_test.go b/src/go/mongolib/fingerprinter/figerprinter_test.go new file mode 100644 index 00000000..d2d3d484 --- /dev/null +++ b/src/go/mongolib/fingerprinter/figerprinter_test.go @@ -0,0 +1,29 @@ +package fingerprinter + +import "testing" + +func TestFingerprint(t *testing.T) { + + query := map[string]interface{}{ + "find": "feedback", + "filter": map[string]interface{}{ + "tool": "Atlas", + "potId": "2c9180865ae33e85015af1cc29243dc5", + }, + "limit": 1, + "singleBatch": true, + } + want := "potId,tool" + + fp := NewFingerprinter(nil) + got, err := fp.Fingerprint(query) + + if err != nil { + t.Error("Error in fingerprint") + } + + if got != want { + t.Errorf("Invalid fingerprint. Got: %q, want %q", got, want) + } + +} diff --git a/src/go/pt-mongodb-query-digest/main.go b/src/go/pt-mongodb-query-digest/main.go index d6548fe1..ae0d174e 100644 --- a/src/go/pt-mongodb-query-digest/main.go +++ b/src/go/pt-mongodb-query-digest/main.go @@ -95,6 +95,8 @@ func main() { } } + log.Debugf("Command line options:\n%+v\n", opts) + di := getDialInfo(opts) if di.Database == "" { log.Errorln("must indicate a database as host:[port]/database") @@ -104,6 +106,7 @@ func main() { dialer := pmgo.NewDialer() session, err := dialer.DialWithInfo(di) + log.Debugf("Dial Info: %+v\n", di) if err != nil { log.Errorf("Error connecting to the db: %s while trying to connect to %s", err, di.Addrs[0]) os.Exit(3) @@ -278,10 +281,10 @@ func getDialInfo(opts *options) *pmgo.DialInfo { di, _ := mgo.ParseURL(opts.Host) di.FailFast = true - if di.Username != "" { + if di.Username == "" { di.Username = opts.User } - if di.Password != "" { + if di.Password == "" { di.Password = opts.Password } if opts.AuthDB != "" { From d939d2bf307784f0a3cea1039d78978fc6a464be Mon Sep 17 00:00:00 2001 From: Carlos Salguero Date: Fri, 4 Aug 2017 17:57:14 -0300 Subject: [PATCH 018/104] PT-186 osc doesn't recognize mixed case in field names --alter 'CHANGE COLUMN C1 c1 ...' was failing because osc was not lowering the case of the field names when trying to detect renamed columns. --- bin/pt-online-schema-change | 2 +- t/pt-online-schema-change/pt-186.t | 91 ++++++++++++++++++++ t/pt-online-schema-change/samples/pt-186.sql | 33 +++++++ 3 files changed, 125 insertions(+), 1 deletion(-) create mode 100644 t/pt-online-schema-change/pt-186.t create mode 100644 t/pt-online-schema-change/samples/pt-186.sql diff --git a/bin/pt-online-schema-change b/bin/pt-online-schema-change index 125e5dba..211af579 100755 --- a/bin/pt-online-schema-change +++ b/bin/pt-online-schema-change @@ -10166,7 +10166,7 @@ sub find_renamed_cols { my %renames; while ( $alter =~ /$alter_change_col_re/g ) { - my ($orig, $new) = map { $tp->ansi_to_legacy($_) } $1, $2; + my ($orig, $new) = map { $tp->ansi_to_legacy($_) } lc($1), lc($2); next unless $orig && $new; my (undef, $orig_tbl) = Quoter->split_unquote($orig); my (undef, $new_tbl) = Quoter->split_unquote($new); diff --git a/t/pt-online-schema-change/pt-186.t b/t/pt-online-schema-change/pt-186.t new file mode 100644 index 00000000..0573e667 --- /dev/null +++ b/t/pt-online-schema-change/pt-186.t @@ -0,0 +1,91 @@ +#!/usr/bin/env perl + +BEGIN { + die "The PERCONA_TOOLKIT_BRANCH environment variable is not set.\n" + unless $ENV{PERCONA_TOOLKIT_BRANCH} && -d $ENV{PERCONA_TOOLKIT_BRANCH}; + unshift @INC, "$ENV{PERCONA_TOOLKIT_BRANCH}/lib"; +}; + +use strict; +use warnings FATAL => 'all'; +use threads; + +use English qw(-no_match_vars); +use Test::More; + +use Data::Dumper; +use PerconaTest; +use Sandbox; +use SqlModes; +use File::Temp qw/ tempdir /; + +plan tests => 4; + +require "$trunk/bin/pt-online-schema-change"; + +my $dp = new DSNParser(opts=>$dsn_opts); +my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp); +my $master_dbh = $sb->get_dbh_for('master'); +my $master_dsn = 'h=127.1,P=12345,u=msandbox,p=msandbox'; + +if ( !$master_dbh ) { + plan skip_all => 'Cannot connect to sandbox master'; +} + +# The sandbox servers run with lock_wait_timeout=3 and it's not dynamic +# so we need to specify --set-vars innodb_lock_wait_timeout=3 else the +# tool will die. +my @args = (qw(--set-vars innodb_lock_wait_timeout=3)); +my $output; +my $exit_status; +my $sample = "t/pt-online-schema-change/samples/"; + +$sb->load_file('master', "$sample/pt-186.sql"); + +my $ori_rows = $master_dbh->selectall_arrayref('SELECT * FROM test.t1'); + +($output, $exit_status) = full_output( + sub { pt_online_schema_change::main(@args, "$master_dsn,D=test,t=t1", + '--execute', '--no-check-alter', + '--alter', 'CHANGE COLUMN `Last_referenced` `c11` INT NOT NULL default 99' + ), + }, +); + +is( + $exit_status, + 0, + "--alter rename columns with uppercase names -> exit status 0", +); + +my $structure = $master_dbh->selectall_arrayref('DESCRIBE test.t1'); +is_deeply( + $structure->[2], + [ + 'c11', + 'int(11)', + 'NO', + 'MUL', + '99', + '' + ], + '--alter rename columns with uppercase names -> Column was renamed' +); + +my $new_rows = $master_dbh->selectall_arrayref('SELECT * FROM test.t1'); + +is_deeply( + $ori_rows, + $new_rows, + "--alter rename columns with uppercase names -> Row values OK" + ); + + +$master_dbh->do("DROP DATABASE IF EXISTS test"); + +# ############################################################################# +# Done. +# ############################################################################# +$sb->wipe_clean($master_dbh); +ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox"); +done_testing; diff --git a/t/pt-online-schema-change/samples/pt-186.sql b/t/pt-online-schema-change/samples/pt-186.sql new file mode 100644 index 00000000..2c6124cc --- /dev/null +++ b/t/pt-online-schema-change/samples/pt-186.sql @@ -0,0 +1,33 @@ +DROP DATABASE IF EXISTS test; +CREATE DATABASE test; + +CREATE TABLE `test`.`t1` ( + `c1` int(10) unsigned NOT NULL, + `c2` varchar(255) NOT NULL, + `Last_referenced` INT NOT NULL DEFAULT 0, + `c3` int(10) unsigned NOT NULL, + `c4` int(10) unsigned NOT NULL DEFAULT '0', + `c5` varchar(255) NOT NULL DEFAULT '', + `c6` varchar(255) NOT NULL DEFAULT '', + `c7` varchar(255) NOT NULL DEFAULT '', + `c8` varchar(255) DEFAULT '', + `c9` varchar(255) DEFAULT '', + `c10` int(10) NOT NULL DEFAULT '0', + PRIMARY KEY (`c1`,`c2`), + KEY `Last_Referenced_c6_Index` (`Last_referenced`,`c6`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +INSERT INTO `test`.`t1` VALUES + (1,'',0,139772,47473,'','','','','',178332), + (2,'',1,74283,65463,'','','','','',159673), + (3,'',2,161929,72681,'','','','','',189530), + (4,'',3,76402,136494,'','','','','',132035), + (5,'',4,133053,176778,'','','','','',198267), + (6,'',5,68824,198479,'','','','','',139027), + (7,'',6,98103,195314,'','','','','',307), + (8,'',7,15094,53330,'','','','','',26258), + (9,'',8,183263,73658,'','','','','',51367), +(10,'',9,141835,87261,'','','','','',73928); + + + From 331a88c9eafb0e79e10eb4a8c1edc7d6826550c1 Mon Sep 17 00:00:00 2001 From: Carlos Salguero Date: Fri, 4 Aug 2017 18:30:03 -0300 Subject: [PATCH 019/104] PT-186 Updated changelog --- Changelog | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Changelog b/Changelog index 8cbaefd9..4d37d7d4 100644 --- a/Changelog +++ b/Changelog @@ -1,5 +1,8 @@ Changelog for Percona Toolkit + + * Fixed bug PT-186: pt-online-schema-change --alter fails if fields are using mixed case + v3.0.4 released 2017-08-02 * Fixed bug PT-181 : pt-online-schema-change not in sync with modules (Thanks DaniĆ«l van Eeden) From 7359ccdd3b4e79736c5590cb0ff4872f3fb7bc18 Mon Sep 17 00:00:00 2001 From: Carlos Salguero Date: Fri, 4 Aug 2017 19:21:53 -0300 Subject: [PATCH 020/104] PT-186 New fix to make all other tests to pass --- bin/pt-online-schema-change | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/pt-online-schema-change b/bin/pt-online-schema-change index 9814fd6c..4974fd1c 100755 --- a/bin/pt-online-schema-change +++ b/bin/pt-online-schema-change @@ -10166,13 +10166,13 @@ sub find_renamed_cols { my %renames; while ( $alter =~ /$alter_change_col_re/g ) { - my ($orig, $new) = map { $tp->ansi_to_legacy($_) } lc($1), lc($2); + my ($orig, $new) = map { $tp->ansi_to_legacy($_) } $1, $2; next unless $orig && $new; my (undef, $orig_tbl) = Quoter->split_unquote($orig); my (undef, $new_tbl) = Quoter->split_unquote($new); # Silly but plausible: CHANGE COLUMN same_name same_name ... next if lc($orig_tbl) eq lc($new_tbl); - $renames{$orig_tbl} = $new_tbl; + $renames{lc($orig_tbl)} = $new_tbl; } PTDEBUG && _d("Renamed columns (old => new): ", Dumper(\%renames)); return \%renames; From c375fd068b1ed4a6a83d632e6e22b7673b269ff7 Mon Sep 17 00:00:00 2001 From: Carlos Salguero Date: Mon, 14 Aug 2017 21:01:30 -0300 Subject: [PATCH 021/104] PT-193 Fixed regex in TableParser TableParser's parse function was failing while trying to lowercase column names in the provided 'SHOW CREATE TABLE'. The problem was it was trying to lowercase everything between backticks but lines like these: `field_name` int comment "here is a ` in the comment" `second_field_name` int made the original regex to fail, matching `in the coment"` as an expression to be lowercased while second_file_name was considered as outside backticks. --- lib/TableParser.pm | 2 +- t/lib/TableParser.t | 26 +++++++++++++++++++ .../issue_pt-193_backtick_in_col_comments.sql | 6 +++++ 3 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 t/lib/samples/issue_pt-193_backtick_in_col_comments.sql diff --git a/lib/TableParser.pm b/lib/TableParser.pm index 2f7521f6..4b5904bb 100644 --- a/lib/TableParser.pm +++ b/lib/TableParser.pm @@ -145,7 +145,7 @@ sub parse { # Lowercase identifiers to avoid issues with case-sensitivity in Perl. # (Bug #1910276). - $ddl =~ s/(`[^`]+`)/\L$1/g; + $ddl =~ s/(`[^`\n]+`)/\L$1/gm; my $engine = $self->get_engine($ddl); diff --git a/t/lib/TableParser.t b/t/lib/TableParser.t index 52bdd52b..8a063ee6 100644 --- a/t/lib/TableParser.t +++ b/t/lib/TableParser.t @@ -806,6 +806,32 @@ is_deeply( 'issue with pairing backticks in column comments (issue 330)' ); + +$tbl = $tp->parse( load_file('t/lib/samples/issue_pt-193_backtick_in_col_comments.sql') ); +is_deeply( + $tbl, + { cols => [qw(id f22abcde f23abc)], + col_posn => { id => 0, f22abcde => 1, f23abc => 2 }, + is_col => { id => 1, f22abcde => 1, f23abc => 1 }, + is_autoinc => { id => 1, f22abcde => 0, f23abc => 0 }, + null_cols => [qw(f22abcde)], + is_nullable => { f22abcde => 1}, + clustered_key => undef, + keys => {}, + defs => { id => " `id` int(11) NOT NULL AUTO_INCREMENT", + "f22abcde" => " `f22abcde` int(10) unsigned DEFAULT NULL COMMENT 'xxx`XXx'", + "f23abc" => " `f23abc` int(10) unsigned NOT NULL DEFAULT '255' COMMENT \"`yyy\"" + }, + numeric_cols => [qw(id f22abcde f23abc)], + is_numeric => { id => 1, f22abcde => 1, f23abc => 1 }, + engine => 'InnoDB', + type_for => { id => 'int', f22abcde => 'int', f23abc => 'int' }, + name => 't3', + charset => 'latin1', + }, + 'issue with pairing backticks in column comments (issue 330)' +); + # ############################################################################# # Issue 170: mk-parallel-dump dies when table-status Data_length is NULL # ############################################################################# diff --git a/t/lib/samples/issue_pt-193_backtick_in_col_comments.sql b/t/lib/samples/issue_pt-193_backtick_in_col_comments.sql new file mode 100644 index 00000000..e6f123d3 --- /dev/null +++ b/t/lib/samples/issue_pt-193_backtick_in_col_comments.sql @@ -0,0 +1,6 @@ +Create Table: CREATE TABLE `t3` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `f22aBcDe` int(10) unsigned DEFAULT NULL COMMENT 'xxx`XXx', + `f23aBc` int(10) unsigned NOT NULL DEFAULT '255' COMMENT "`yyy", + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1) From 54dfcf36de2e2aaf0e6a59cec385457ac816ba2a Mon Sep 17 00:00:00 2001 From: Carlos Salguero Date: Tue, 15 Aug 2017 12:06:24 -0300 Subject: [PATCH 022/104] PT-193 New test and updated libraries Added a specific test for this issue and updated all binaries to the latest TableParser version --- bin/pt-archiver | 9 ++- bin/pt-duplicate-key-checker | 9 ++- bin/pt-find | 9 ++- bin/pt-heartbeat | 9 ++- bin/pt-index-usage | 9 ++- bin/pt-kill | 9 ++- bin/pt-online-schema-change | 2 +- bin/pt-query-digest | 9 ++- bin/pt-table-checksum | 2 +- bin/pt-table-sync | 9 ++- bin/pt-table-usage | 9 ++- .../issue_pt-193_backtick_in_col_comments.sql | 9 ++- t/pt-table-checksum/pt-193.t | 66 +++++++++++++++++++ 13 files changed, 129 insertions(+), 31 deletions(-) create mode 100644 t/pt-table-checksum/pt-193.t diff --git a/bin/pt-archiver b/bin/pt-archiver index 6fac0681..768af530 100755 --- a/bin/pt-archiver +++ b/bin/pt-archiver @@ -1954,7 +1954,7 @@ sub parse { my ($name) = $ddl =~ m/CREATE (?:TEMPORARY )?TABLE\s+(`.+?`)/; (undef, $name) = $self->{Quoter}->split_unquote($name) if $name; - $ddl =~ s/(`[^`]+`)/\L$1/g; + $ddl =~ s/(`[^`\n]+`)/\L$1/gm; my $engine = $self->get_engine($ddl); @@ -2085,6 +2085,8 @@ sub check_table { my $db_tbl = $q->quote($db, $tbl); PTDEBUG && _d('Checking', $db_tbl); + $self->{check_table_error} = undef; + my $sql = "SHOW TABLES FROM " . $q->quote($db) . ' LIKE ' . $q->literal_like($tbl); PTDEBUG && _d($sql); @@ -2092,8 +2094,9 @@ sub check_table { eval { $row = $dbh->selectrow_arrayref($sql); }; - if ( $EVAL_ERROR ) { - PTDEBUG && _d($EVAL_ERROR); + if ( my $e = $EVAL_ERROR ) { + PTDEBUG && _d($e); + $self->{check_table_error} = $e; return 0; } if ( !$row->[0] || $row->[0] ne $tbl ) { diff --git a/bin/pt-duplicate-key-checker b/bin/pt-duplicate-key-checker index 3b4c8f9a..f288a596 100755 --- a/bin/pt-duplicate-key-checker +++ b/bin/pt-duplicate-key-checker @@ -341,7 +341,7 @@ sub parse { my ($name) = $ddl =~ m/CREATE (?:TEMPORARY )?TABLE\s+(`.+?`)/; (undef, $name) = $self->{Quoter}->split_unquote($name) if $name; - $ddl =~ s/(`[^`]+`)/\L$1/g; + $ddl =~ s/(`[^`\n]+`)/\L$1/gm; my $engine = $self->get_engine($ddl); @@ -472,6 +472,8 @@ sub check_table { my $db_tbl = $q->quote($db, $tbl); PTDEBUG && _d('Checking', $db_tbl); + $self->{check_table_error} = undef; + my $sql = "SHOW TABLES FROM " . $q->quote($db) . ' LIKE ' . $q->literal_like($tbl); PTDEBUG && _d($sql); @@ -479,8 +481,9 @@ sub check_table { eval { $row = $dbh->selectrow_arrayref($sql); }; - if ( $EVAL_ERROR ) { - PTDEBUG && _d($EVAL_ERROR); + if ( my $e = $EVAL_ERROR ) { + PTDEBUG && _d($e); + $self->{check_table_error} = $e; return 0; } if ( !$row->[0] || $row->[0] ne $tbl ) { diff --git a/bin/pt-find b/bin/pt-find index 444d6042..4f9c7bf4 100755 --- a/bin/pt-find +++ b/bin/pt-find @@ -1869,7 +1869,7 @@ sub parse { my ($name) = $ddl =~ m/CREATE (?:TEMPORARY )?TABLE\s+(`.+?`)/; (undef, $name) = $self->{Quoter}->split_unquote($name) if $name; - $ddl =~ s/(`[^`]+`)/\L$1/g; + $ddl =~ s/(`[^`\n]+`)/\L$1/gm; my $engine = $self->get_engine($ddl); @@ -2000,6 +2000,8 @@ sub check_table { my $db_tbl = $q->quote($db, $tbl); PTDEBUG && _d('Checking', $db_tbl); + $self->{check_table_error} = undef; + my $sql = "SHOW TABLES FROM " . $q->quote($db) . ' LIKE ' . $q->literal_like($tbl); PTDEBUG && _d($sql); @@ -2007,8 +2009,9 @@ sub check_table { eval { $row = $dbh->selectrow_arrayref($sql); }; - if ( $EVAL_ERROR ) { - PTDEBUG && _d($EVAL_ERROR); + if ( my $e = $EVAL_ERROR ) { + PTDEBUG && _d($e); + $self->{check_table_error} = $e; return 0; } if ( !$row->[0] || $row->[0] ne $tbl ) { diff --git a/bin/pt-heartbeat b/bin/pt-heartbeat index 412ef46d..667b037a 100755 --- a/bin/pt-heartbeat +++ b/bin/pt-heartbeat @@ -3488,7 +3488,7 @@ sub parse { my ($name) = $ddl =~ m/CREATE (?:TEMPORARY )?TABLE\s+(`.+?`)/; (undef, $name) = $self->{Quoter}->split_unquote($name) if $name; - $ddl =~ s/(`[^`]+`)/\L$1/g; + $ddl =~ s/(`[^`\n]+`)/\L$1/gm; my $engine = $self->get_engine($ddl); @@ -3619,6 +3619,8 @@ sub check_table { my $db_tbl = $q->quote($db, $tbl); PTDEBUG && _d('Checking', $db_tbl); + $self->{check_table_error} = undef; + my $sql = "SHOW TABLES FROM " . $q->quote($db) . ' LIKE ' . $q->literal_like($tbl); PTDEBUG && _d($sql); @@ -3626,8 +3628,9 @@ sub check_table { eval { $row = $dbh->selectrow_arrayref($sql); }; - if ( $EVAL_ERROR ) { - PTDEBUG && _d($EVAL_ERROR); + if ( my $e = $EVAL_ERROR ) { + PTDEBUG && _d($e); + $self->{check_table_error} = $e; return 0; } if ( !$row->[0] || $row->[0] ne $tbl ) { diff --git a/bin/pt-index-usage b/bin/pt-index-usage index 3a95a702..c58cacaa 100755 --- a/bin/pt-index-usage +++ b/bin/pt-index-usage @@ -3108,7 +3108,7 @@ sub parse { my ($name) = $ddl =~ m/CREATE (?:TEMPORARY )?TABLE\s+(`.+?`)/; (undef, $name) = $self->{Quoter}->split_unquote($name) if $name; - $ddl =~ s/(`[^`]+`)/\L$1/g; + $ddl =~ s/(`[^`\n]+`)/\L$1/gm; my $engine = $self->get_engine($ddl); @@ -3239,6 +3239,8 @@ sub check_table { my $db_tbl = $q->quote($db, $tbl); PTDEBUG && _d('Checking', $db_tbl); + $self->{check_table_error} = undef; + my $sql = "SHOW TABLES FROM " . $q->quote($db) . ' LIKE ' . $q->literal_like($tbl); PTDEBUG && _d($sql); @@ -3246,8 +3248,9 @@ sub check_table { eval { $row = $dbh->selectrow_arrayref($sql); }; - if ( $EVAL_ERROR ) { - PTDEBUG && _d($EVAL_ERROR); + if ( my $e = $EVAL_ERROR ) { + PTDEBUG && _d($e); + $self->{check_table_error} = $e; return 0; } if ( !$row->[0] || $row->[0] ne $tbl ) { diff --git a/bin/pt-kill b/bin/pt-kill index a3c98aaa..6d1fb47e 100755 --- a/bin/pt-kill +++ b/bin/pt-kill @@ -2934,7 +2934,7 @@ sub parse { my ($name) = $ddl =~ m/CREATE (?:TEMPORARY )?TABLE\s+(`.+?`)/; (undef, $name) = $self->{Quoter}->split_unquote($name) if $name; - $ddl =~ s/(`[^`]+`)/\L$1/g; + $ddl =~ s/(`[^`\n]+`)/\L$1/gm; my $engine = $self->get_engine($ddl); @@ -3065,6 +3065,8 @@ sub check_table { my $db_tbl = $q->quote($db, $tbl); PTDEBUG && _d('Checking', $db_tbl); + $self->{check_table_error} = undef; + my $sql = "SHOW TABLES FROM " . $q->quote($db) . ' LIKE ' . $q->literal_like($tbl); PTDEBUG && _d($sql); @@ -3072,8 +3074,9 @@ sub check_table { eval { $row = $dbh->selectrow_arrayref($sql); }; - if ( $EVAL_ERROR ) { - PTDEBUG && _d($EVAL_ERROR); + if ( my $e = $EVAL_ERROR ) { + PTDEBUG && _d($e); + $self->{check_table_error} = $e; return 0; } if ( !$row->[0] || $row->[0] ne $tbl ) { diff --git a/bin/pt-online-schema-change b/bin/pt-online-schema-change index 4974fd1c..95cfbef9 100755 --- a/bin/pt-online-schema-change +++ b/bin/pt-online-schema-change @@ -3298,7 +3298,7 @@ sub parse { my ($name) = $ddl =~ m/CREATE (?:TEMPORARY )?TABLE\s+(`.+?`)/; (undef, $name) = $self->{Quoter}->split_unquote($name) if $name; - $ddl =~ s/(`[^`]+`)/\L$1/g; + $ddl =~ s/(`[^`\n]+`)/\L$1/gm; my $engine = $self->get_engine($ddl); diff --git a/bin/pt-query-digest b/bin/pt-query-digest index 3ede8cb7..b90f3426 100755 --- a/bin/pt-query-digest +++ b/bin/pt-query-digest @@ -8834,7 +8834,7 @@ sub parse { my ($name) = $ddl =~ m/CREATE (?:TEMPORARY )?TABLE\s+(`.+?`)/; (undef, $name) = $self->{Quoter}->split_unquote($name) if $name; - $ddl =~ s/(`[^`]+`)/\L$1/g; + $ddl =~ s/(`[^`\n]+`)/\L$1/gm; my $engine = $self->get_engine($ddl); @@ -8965,6 +8965,8 @@ sub check_table { my $db_tbl = $q->quote($db, $tbl); PTDEBUG && _d('Checking', $db_tbl); + $self->{check_table_error} = undef; + my $sql = "SHOW TABLES FROM " . $q->quote($db) . ' LIKE ' . $q->literal_like($tbl); PTDEBUG && _d($sql); @@ -8972,8 +8974,9 @@ sub check_table { eval { $row = $dbh->selectrow_arrayref($sql); }; - if ( $EVAL_ERROR ) { - PTDEBUG && _d($EVAL_ERROR); + if ( my $e = $EVAL_ERROR ) { + PTDEBUG && _d($e); + $self->{check_table_error} = $e; return 0; } if ( !$row->[0] || $row->[0] ne $tbl ) { diff --git a/bin/pt-table-checksum b/bin/pt-table-checksum index 70eb2051..558fe6e3 100755 --- a/bin/pt-table-checksum +++ b/bin/pt-table-checksum @@ -4435,7 +4435,7 @@ sub parse { my ($name) = $ddl =~ m/CREATE (?:TEMPORARY )?TABLE\s+(`.+?`)/; (undef, $name) = $self->{Quoter}->split_unquote($name) if $name; - $ddl =~ s/(`[^`]+`)/\L$1/g; + $ddl =~ s/(`[^`\n]+`)/\L$1/gm; my $engine = $self->get_engine($ddl); diff --git a/bin/pt-table-sync b/bin/pt-table-sync index 79887322..0f2bdd05 100755 --- a/bin/pt-table-sync +++ b/bin/pt-table-sync @@ -2853,7 +2853,7 @@ sub parse { my ($name) = $ddl =~ m/CREATE (?:TEMPORARY )?TABLE\s+(`.+?`)/; (undef, $name) = $self->{Quoter}->split_unquote($name) if $name; - $ddl =~ s/(`[^`]+`)/\L$1/g; + $ddl =~ s/(`[^`\n]+`)/\L$1/gm; my $engine = $self->get_engine($ddl); @@ -2984,6 +2984,8 @@ sub check_table { my $db_tbl = $q->quote($db, $tbl); PTDEBUG && _d('Checking', $db_tbl); + $self->{check_table_error} = undef; + my $sql = "SHOW TABLES FROM " . $q->quote($db) . ' LIKE ' . $q->literal_like($tbl); PTDEBUG && _d($sql); @@ -2991,8 +2993,9 @@ sub check_table { eval { $row = $dbh->selectrow_arrayref($sql); }; - if ( $EVAL_ERROR ) { - PTDEBUG && _d($EVAL_ERROR); + if ( my $e = $EVAL_ERROR ) { + PTDEBUG && _d($e); + $self->{check_table_error} = $e; return 0; } if ( !$row->[0] || $row->[0] ne $tbl ) { diff --git a/bin/pt-table-usage b/bin/pt-table-usage index 91831b4a..5dcdd8e9 100755 --- a/bin/pt-table-usage +++ b/bin/pt-table-usage @@ -6784,7 +6784,7 @@ sub parse { my ($name) = $ddl =~ m/CREATE (?:TEMPORARY )?TABLE\s+(`.+?`)/; (undef, $name) = $self->{Quoter}->split_unquote($name) if $name; - $ddl =~ s/(`[^`]+`)/\L$1/g; + $ddl =~ s/(`[^`\n]+`)/\L$1/gm; my $engine = $self->get_engine($ddl); @@ -6915,6 +6915,8 @@ sub check_table { my $db_tbl = $q->quote($db, $tbl); PTDEBUG && _d('Checking', $db_tbl); + $self->{check_table_error} = undef; + my $sql = "SHOW TABLES FROM " . $q->quote($db) . ' LIKE ' . $q->literal_like($tbl); PTDEBUG && _d($sql); @@ -6922,8 +6924,9 @@ sub check_table { eval { $row = $dbh->selectrow_arrayref($sql); }; - if ( $EVAL_ERROR ) { - PTDEBUG && _d($EVAL_ERROR); + if ( my $e = $EVAL_ERROR ) { + PTDEBUG && _d($e); + $self->{check_table_error} = $e; return 0; } if ( !$row->[0] || $row->[0] ne $tbl ) { diff --git a/t/lib/samples/issue_pt-193_backtick_in_col_comments.sql b/t/lib/samples/issue_pt-193_backtick_in_col_comments.sql index e6f123d3..6f37b92c 100644 --- a/t/lib/samples/issue_pt-193_backtick_in_col_comments.sql +++ b/t/lib/samples/issue_pt-193_backtick_in_col_comments.sql @@ -1,6 +1,11 @@ -Create Table: CREATE TABLE `t3` ( +DROP DATABASE IF EXISTS test; +CREATE DATABASE test; +USE test; + +CREATE TABLE `t3` ( `id` int(11) NOT NULL AUTO_INCREMENT, `f22aBcDe` int(10) unsigned DEFAULT NULL COMMENT 'xxx`XXx', `f23aBc` int(10) unsigned NOT NULL DEFAULT '255' COMMENT "`yyy", PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1) +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1; + diff --git a/t/pt-table-checksum/pt-193.t b/t/pt-table-checksum/pt-193.t new file mode 100644 index 00000000..7f3af8d6 --- /dev/null +++ b/t/pt-table-checksum/pt-193.t @@ -0,0 +1,66 @@ +#!/usr/bin/env perl + +BEGIN { + die "The PERCONA_TOOLKIT_BRANCH environment variable is not set.\n" + unless $ENV{PERCONA_TOOLKIT_BRANCH} && -d $ENV{PERCONA_TOOLKIT_BRANCH}; + unshift @INC, "$ENV{PERCONA_TOOLKIT_BRANCH}/lib"; +}; + +use strict; +use warnings FATAL => 'all'; +use English qw(-no_match_vars); +use Test::More; + +use PerconaTest; +use Sandbox; +use SqlModes; +require "$trunk/bin/pt-table-checksum"; + +my $dp = new DSNParser(opts=>$dsn_opts); +my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp); +my $dbh = $sb->get_dbh_for('master'); + +if ( !$dbh ) { + plan skip_all => 'Cannot connect to sandbox master'; +} +else { + plan tests => 3; +} + +$sb->load_file('master', 't/lib/samples/issue_pt-193_backtick_in_col_comments.sql'); + +# The sandbox servers run with lock_wait_timeout=3 and it's not dynamic +# so we need to specify --set-vars innodb_lock_wait_timeout=3 else the tool will die. +# And --max-load "" prevents waiting for status variables. +my $master_dsn = $sb->dsn_for('master'); +my @args = ($master_dsn, "--set-vars", "innodb_lock_wait_timeout=50", + "--no-check-binlog-format", "--ignore-databases", "mysql", + "--nocheck-replication-filters"); +my $output; +my $exit_status; + +# Test #1 +$output = output( + sub { $exit_status = pt_table_checksum::main(@args) }, + stderr => 1, +); + +is( + $exit_status, + 0, + "PT-193 use single backtick in comments", +); + +like( + $output, + qr/test\.t3/, + "PT-193 table t3 was checksumed", +); + + +# ############################################################################# +# Done. +# ############################################################################# +$sb->wipe_clean($dbh); +ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox"); +exit; From 51be22073b0fc9c39ed08260f8de7511a54751e5 Mon Sep 17 00:00:00 2001 From: Kamil Dziedzic Date: Mon, 21 Aug 2017 15:48:14 +0200 Subject: [PATCH 023/104] PMM-1057: fingerprint more types of queries --- .travis.yml | 29 + glide.lock | 20 +- glide.yaml | 1 - src/go/lib/tutil/util.go | 37 + src/go/mongolib/fingerprinter/figerprinter.go | 115 - .../fingerprinter/figerprinter_test.go | 29 - .../mongolib/fingerprinter/fingerprinter.go | 216 + .../fingerprinter/fingerprinter_test.go | 251 ++ src/go/mongolib/profiler/profiler.go | 2 +- src/go/mongolib/profiler/profiler_test.go | 52 +- src/go/mongolib/proto/bson.go | 114 + src/go/mongolib/proto/main_test.go | 9 +- src/go/mongolib/proto/system.profile.go | 27 +- src/go/mongolib/stats/stats.go | 39 +- src/go/mongolib/stats/stats_test.go | 15 +- src/go/mongolib/util/util.go | 91 +- src/go/pt-mongodb-summary/main.go | 2 +- src/go/tests/doc/docker-compose.yml | 7 + src/go/tests/doc/out/aggregate_2.6.12 | 40 + src/go/tests/doc/out/aggregate_3.0.15 | 53 + src/go/tests/doc/out/aggregate_3.2.16 | 49 + src/go/tests/doc/out/aggregate_3.4.7 | 50 + src/go/tests/doc/out/aggregate_3.5.11 | 51 + src/go/tests/doc/out/count_2.6.12 | 34 + src/go/tests/doc/out/count_3.0.15 | 47 + src/go/tests/doc/out/count_3.2.16 | 43 + src/go/tests/doc/out/count_3.4.7 | 57 + src/go/tests/doc/out/count_3.5.11 | 58 + src/go/tests/doc/out/count_with_query_2.6.12 | 36 + src/go/tests/doc/out/count_with_query_3.0.15 | 49 + src/go/tests/doc/out/count_with_query_3.2.16 | 45 + src/go/tests/doc/out/count_with_query_3.4.7 | 95 + src/go/tests/doc/out/count_with_query_3.5.11 | 96 + src/go/tests/doc/out/delete_2.6.12 | 33 + src/go/tests/doc/out/delete_3.0.15 | 47 + src/go/tests/doc/out/delete_3.2.16 | 42 + src/go/tests/doc/out/delete_3.4.7 | 113 + src/go/tests/doc/out/delete_3.5.11 | 116 + src/go/tests/doc/out/distinct_2.6.12 | 34 + src/go/tests/doc/out/distinct_3.0.15 | 47 + src/go/tests/doc/out/distinct_3.2.16 | 43 + src/go/tests/doc/out/distinct_3.4.7 | 93 + src/go/tests/doc/out/distinct_3.5.11 | 94 + src/go/tests/doc/out/find_2.6.12 | 67 + src/go/tests/doc/out/find_3.0.15 | 87 + src/go/tests/doc/out/find_3.2.16 | 88 + src/go/tests/doc/out/find_3.4.7 | 92 + src/go/tests/doc/out/find_3.5.11 | 93 + src/go/tests/doc/out/find_andrii_2.6.12 | 146 + src/go/tests/doc/out/find_andrii_3.0.15 | 247 ++ src/go/tests/doc/out/find_andrii_3.2.16 | 167 + src/go/tests/doc/out/find_andrii_3.4.7 | 167 + src/go/tests/doc/out/find_andrii_3.5.11 | 168 + src/go/tests/doc/out/find_empty_2.6.12 | 43 + src/go/tests/doc/out/find_empty_3.0.15 | 61 + src/go/tests/doc/out/find_empty_3.2.16 | 59 + src/go/tests/doc/out/find_empty_3.4.7 | 56 + src/go/tests/doc/out/find_empty_3.5.11 | 57 + src/go/tests/doc/out/findandmodify_2.6.12 | 45 + src/go/tests/doc/out/findandmodify_3.0.15 | 59 + src/go/tests/doc/out/findandmodify_3.2.16 | 55 + src/go/tests/doc/out/findandmodify_3.4.7 | 92 + src/go/tests/doc/out/findandmodify_3.5.11 | 88 + src/go/tests/doc/out/geonear_2.6.12 | 36 + src/go/tests/doc/out/geonear_3.0.15 | 49 + src/go/tests/doc/out/geonear_3.2.16 | 45 + src/go/tests/doc/out/geonear_3.4.7 | 3565 ++++++++++++++++ src/go/tests/doc/out/geonear_3.5.11 | 3566 +++++++++++++++++ src/go/tests/doc/out/group_2.6.12 | 41 + src/go/tests/doc/out/group_3.0.15 | 54 + src/go/tests/doc/out/group_3.2.16 | 50 + src/go/tests/doc/out/group_3.4.7 | 116 + src/go/tests/doc/out/group_3.5.11 | 117 + src/go/tests/doc/out/insert_2.6.12 | 28 + src/go/tests/doc/out/insert_3.0.15 | 42 + src/go/tests/doc/out/insert_3.2.16 | 45 + src/go/tests/doc/out/insert_3.4.7 | 42 + src/go/tests/doc/out/insert_3.5.11 | 38 + src/go/tests/doc/out/mapreduce_2.6.12 | 42 + src/go/tests/doc/out/mapreduce_3.0.15 | 60 + src/go/tests/doc/out/mapreduce_3.2.16 | 60 + src/go/tests/doc/out/mapreduce_3.4.7 | 110 + src/go/tests/doc/out/mapreduce_3.5.11 | 111 + src/go/tests/doc/out/update_2.6.12 | 43 + src/go/tests/doc/out/update_3.0.15 | 57 + src/go/tests/doc/out/update_3.2.16 | 50 + src/go/tests/doc/out/update_3.4.7 | 118 + src/go/tests/doc/out/update_3.5.11 | 122 + src/go/tests/doc/run.sh | 24 + src/go/tests/doc/script/func/db_version.func | 5 + .../doc/script/func/get_single_profile.func | 7 + .../doc/script/func/set_profiling_level.func | 6 + src/go/tests/doc/script/main.sh | 34 + src/go/tests/doc/script/profile/aggregate.js | 9 + src/go/tests/doc/script/profile/count.js | 7 + .../doc/script/profile/count_with_query.js | 7 + src/go/tests/doc/script/profile/delete.js | 9 + src/go/tests/doc/script/profile/distinct.js | 9 + src/go/tests/doc/script/profile/find.js | 4 + .../tests/doc/script/profile/find_andrii.js | 20 + src/go/tests/doc/script/profile/find_empty.js | 3 + .../tests/doc/script/profile/findandmodify.js | 12 + src/go/tests/doc/script/profile/geonear.js | 15 + src/go/tests/doc/script/profile/group.js | 15 + src/go/tests/doc/script/profile/insert.js | 4 + src/go/tests/doc/script/profile/mapreduce.js | 20 + src/go/tests/doc/script/profile/update.js | 9 + src/go/tests/fingerprinter_doc.json | 172 + src/go/tests/profiler_docs_stats.json | 4 +- src/go/tests/profiler_docs_stats.want.json | 18 +- .../tests/profiler_docs_total_stats.want.json | 2 +- 111 files changed, 13240 insertions(+), 240 deletions(-) create mode 100644 .travis.yml delete mode 100644 src/go/mongolib/fingerprinter/figerprinter.go delete mode 100644 src/go/mongolib/fingerprinter/figerprinter_test.go create mode 100644 src/go/mongolib/fingerprinter/fingerprinter.go create mode 100644 src/go/mongolib/fingerprinter/fingerprinter_test.go create mode 100644 src/go/mongolib/proto/bson.go create mode 100644 src/go/tests/doc/docker-compose.yml create mode 100644 src/go/tests/doc/out/aggregate_2.6.12 create mode 100644 src/go/tests/doc/out/aggregate_3.0.15 create mode 100644 src/go/tests/doc/out/aggregate_3.2.16 create mode 100644 src/go/tests/doc/out/aggregate_3.4.7 create mode 100644 src/go/tests/doc/out/aggregate_3.5.11 create mode 100644 src/go/tests/doc/out/count_2.6.12 create mode 100644 src/go/tests/doc/out/count_3.0.15 create mode 100644 src/go/tests/doc/out/count_3.2.16 create mode 100644 src/go/tests/doc/out/count_3.4.7 create mode 100644 src/go/tests/doc/out/count_3.5.11 create mode 100644 src/go/tests/doc/out/count_with_query_2.6.12 create mode 100644 src/go/tests/doc/out/count_with_query_3.0.15 create mode 100644 src/go/tests/doc/out/count_with_query_3.2.16 create mode 100644 src/go/tests/doc/out/count_with_query_3.4.7 create mode 100644 src/go/tests/doc/out/count_with_query_3.5.11 create mode 100644 src/go/tests/doc/out/delete_2.6.12 create mode 100644 src/go/tests/doc/out/delete_3.0.15 create mode 100644 src/go/tests/doc/out/delete_3.2.16 create mode 100644 src/go/tests/doc/out/delete_3.4.7 create mode 100644 src/go/tests/doc/out/delete_3.5.11 create mode 100644 src/go/tests/doc/out/distinct_2.6.12 create mode 100644 src/go/tests/doc/out/distinct_3.0.15 create mode 100644 src/go/tests/doc/out/distinct_3.2.16 create mode 100644 src/go/tests/doc/out/distinct_3.4.7 create mode 100644 src/go/tests/doc/out/distinct_3.5.11 create mode 100644 src/go/tests/doc/out/find_2.6.12 create mode 100644 src/go/tests/doc/out/find_3.0.15 create mode 100644 src/go/tests/doc/out/find_3.2.16 create mode 100644 src/go/tests/doc/out/find_3.4.7 create mode 100644 src/go/tests/doc/out/find_3.5.11 create mode 100644 src/go/tests/doc/out/find_andrii_2.6.12 create mode 100644 src/go/tests/doc/out/find_andrii_3.0.15 create mode 100644 src/go/tests/doc/out/find_andrii_3.2.16 create mode 100644 src/go/tests/doc/out/find_andrii_3.4.7 create mode 100644 src/go/tests/doc/out/find_andrii_3.5.11 create mode 100644 src/go/tests/doc/out/find_empty_2.6.12 create mode 100644 src/go/tests/doc/out/find_empty_3.0.15 create mode 100644 src/go/tests/doc/out/find_empty_3.2.16 create mode 100644 src/go/tests/doc/out/find_empty_3.4.7 create mode 100644 src/go/tests/doc/out/find_empty_3.5.11 create mode 100644 src/go/tests/doc/out/findandmodify_2.6.12 create mode 100644 src/go/tests/doc/out/findandmodify_3.0.15 create mode 100644 src/go/tests/doc/out/findandmodify_3.2.16 create mode 100644 src/go/tests/doc/out/findandmodify_3.4.7 create mode 100644 src/go/tests/doc/out/findandmodify_3.5.11 create mode 100644 src/go/tests/doc/out/geonear_2.6.12 create mode 100644 src/go/tests/doc/out/geonear_3.0.15 create mode 100644 src/go/tests/doc/out/geonear_3.2.16 create mode 100644 src/go/tests/doc/out/geonear_3.4.7 create mode 100644 src/go/tests/doc/out/geonear_3.5.11 create mode 100644 src/go/tests/doc/out/group_2.6.12 create mode 100644 src/go/tests/doc/out/group_3.0.15 create mode 100644 src/go/tests/doc/out/group_3.2.16 create mode 100644 src/go/tests/doc/out/group_3.4.7 create mode 100644 src/go/tests/doc/out/group_3.5.11 create mode 100644 src/go/tests/doc/out/insert_2.6.12 create mode 100644 src/go/tests/doc/out/insert_3.0.15 create mode 100644 src/go/tests/doc/out/insert_3.2.16 create mode 100644 src/go/tests/doc/out/insert_3.4.7 create mode 100644 src/go/tests/doc/out/insert_3.5.11 create mode 100644 src/go/tests/doc/out/mapreduce_2.6.12 create mode 100644 src/go/tests/doc/out/mapreduce_3.0.15 create mode 100644 src/go/tests/doc/out/mapreduce_3.2.16 create mode 100644 src/go/tests/doc/out/mapreduce_3.4.7 create mode 100644 src/go/tests/doc/out/mapreduce_3.5.11 create mode 100644 src/go/tests/doc/out/update_2.6.12 create mode 100644 src/go/tests/doc/out/update_3.0.15 create mode 100644 src/go/tests/doc/out/update_3.2.16 create mode 100644 src/go/tests/doc/out/update_3.4.7 create mode 100644 src/go/tests/doc/out/update_3.5.11 create mode 100755 src/go/tests/doc/run.sh create mode 100644 src/go/tests/doc/script/func/db_version.func create mode 100644 src/go/tests/doc/script/func/get_single_profile.func create mode 100644 src/go/tests/doc/script/func/set_profiling_level.func create mode 100755 src/go/tests/doc/script/main.sh create mode 100644 src/go/tests/doc/script/profile/aggregate.js create mode 100644 src/go/tests/doc/script/profile/count.js create mode 100644 src/go/tests/doc/script/profile/count_with_query.js create mode 100644 src/go/tests/doc/script/profile/delete.js create mode 100644 src/go/tests/doc/script/profile/distinct.js create mode 100644 src/go/tests/doc/script/profile/find.js create mode 100644 src/go/tests/doc/script/profile/find_andrii.js create mode 100644 src/go/tests/doc/script/profile/find_empty.js create mode 100644 src/go/tests/doc/script/profile/findandmodify.js create mode 100644 src/go/tests/doc/script/profile/geonear.js create mode 100644 src/go/tests/doc/script/profile/group.js create mode 100644 src/go/tests/doc/script/profile/insert.js create mode 100644 src/go/tests/doc/script/profile/mapreduce.js create mode 100644 src/go/tests/doc/script/profile/update.js create mode 100644 src/go/tests/fingerprinter_doc.json diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..be5d3945 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,29 @@ +dist: trusty +sudo: required + +language: go + +go: + - 1.7.x + - 1.8.x + - tip + +install: + - go get -u github.com/Masterminds/glide + # remove vendor dir and re-fetch it to check later if it's correct with `git diff --exit-code` + - rm -rf vendor/ + - glide install + +before_script: + # check if vendor dir is correct + - git diff --exit-code + +script: + - go test $(glide nv) + +notifications: + slack: + on_success: change + on_failure: change + rooms: + secure: A/jke9SzibxoGc0H86z5fnGKoLr6xTPBNUcjLMVJ2xzqp8HX90gOdWKenooCu6tyJ0gXX8nUgIOQWsupICy2P2HPGXXKonY4Lq1qRPbxXnlqweaoTf2IZ8SmQeyP6TvNZF9978YRLqRBmJXzq7dcZCF2Gr/1XLPDCNIVJcKgG+heVUubt6q8EnIzB4OYKwUJwZ2ORzleLwqzs8ViB5ffmOXmAVd80rUTcCOailKE4+ML+CQO1MLbGxbdVjacivjM0cvXoibRZF5bhUsg7qoszaWJidJjX9UtW9rRKyPuh1vh1HFgayxmWNeiqe7yyIwGZU37Gnten+4XsVpKYxSOfRWz8TNu01jdDs7e8RgJ29OCwVG88y/yxrBtDlhjsKvy7owV1eAH63YVUJzgoVQZKUt04LAKTMxjEZKBb7o7+GdmSHQWPj8NNmcPEWBwSg99yU3xTQXefgLjqiCQTTNaiNEa1JgPNroKXzAcjJ12qpY5F5MWPFZ2ndTOL2kVEn4iqV7t6bresISXAZKJn+IrjUdZ+ZBr48zcnO7rgWGvszScDWt3oqjRlCbwxXWTL8VoDouylGVAJTUHxo07Bs307cwYiLsUp/2hPvcY2ELXrQXTqk3ZHJkMHa4U+nNvXY9RYNNqFmvAnUCHG6JfBda4b0SCjbCINjQVMCsF5DSXua8= diff --git a/glide.lock b/glide.lock index 103f3bc0..61f7f8c4 100644 --- a/glide.lock +++ b/glide.lock @@ -1,14 +1,14 @@ -hash: 7cc97c518c04beac5926bfef5fafc2c291d1c8eff945390edb5e71fecbf461f2 -updated: 2017-07-10T21:03:28.164296188-03:00 +hash: 203838fffdc6549caf8a6a439df2e2df48fe15449dedc702b632f2b06f66ae72 +updated: 2017-08-18T11:00:19.296275985+02:00 imports: - name: github.com/bradfitz/slice version: d9036e2120b5ddfa53f3ebccd618c4af275f47da - name: github.com/go-ole/go-ole - version: 02d3668a0cf01f58411cc85cd37c174c257ec7c2 + version: 085abb85892dc1949567b726dff00fa226c60c45 subpackages: - oleutil - name: github.com/golang/mock - version: 93f6609a15b7de76bd49259f1f9a6b58df358936 + version: 1df903b45f27b0b3685fa78609b653a54c7eead8 subpackages: - gomock - name: github.com/hashicorp/go-version @@ -18,7 +18,7 @@ imports: - name: github.com/kr/pretty version: cfb55aafdaf3ec08f0db22699ab822c50091b1c4 - name: github.com/montanaflynn/stats - version: 41c34e4914ec3c05d485e564d9028d8861d5d9ad + version: 4a163274fa4ca0b524ccee24757d7bec79475aca - name: github.com/pborman/getopt version: 7148bc3a4c3008adfcab60cbebfd0576018f330b subpackages: @@ -32,7 +32,7 @@ imports: - name: github.com/satori/go.uuid version: 5bf94b69c6b68ee1b541973bb8e1144db23a194b - name: github.com/shirou/gopsutil - version: 09e98597147f04686f71603d5525627cd066701d + version: 1c211f0807a3436707409fa313599dd8c7a48664 subpackages: - cpu - host @@ -43,7 +43,7 @@ imports: - name: github.com/shirou/w32 version: bb4de0191aa41b5507caa14b0650cdbddcd9280b - name: github.com/sirupsen/logrus - version: 7f976d3a76720c4c27af2ba716b85d2e0a7e38b1 + version: 68806b4b77355d6c8577a2c8bbc6d547a5272491 - name: github.com/StackExchange/wmi version: ea383cf3ba6ec950874b8486cd72356d007c768f - name: go4.org @@ -51,15 +51,15 @@ imports: subpackages: - reflectutil - name: golang.org/x/crypto - version: 3627ff35f31987174dbee61d9d1dcc1c643e7174 + version: b176d7def5d71bdd214203491f89843ed217f420 subpackages: - ssh/terminal - name: golang.org/x/net - version: 054b33e6527139ad5b1ec2f6232c3b175bd9a30c + version: 1c05540f6879653db88113bc4a2b70aec4bd491f subpackages: - context - name: golang.org/x/sys - version: abf9c25f54453410d0c6668e519582a9e1115027 + version: 43e60d72a8e2bd92ee98319ba9a384a0e9837c08 subpackages: - unix - windows diff --git a/glide.yaml b/glide.yaml index c4ef7088..d63fe93c 100644 --- a/glide.yaml +++ b/glide.yaml @@ -7,7 +7,6 @@ import: - package: github.com/montanaflynn/stats - package: github.com/pborman/getopt - package: github.com/percona/pmgo - version: ^0.4 - package: github.com/pkg/errors - package: github.com/satori/go.uuid - package: github.com/shirou/gopsutil diff --git a/src/go/lib/tutil/util.go b/src/go/lib/tutil/util.go index 3a4caa7e..9bd2477f 100644 --- a/src/go/lib/tutil/util.go +++ b/src/go/lib/tutil/util.go @@ -6,6 +6,10 @@ import ( "os" "os/exec" "strings" + + "regexp" + + "gopkg.in/mgo.v2/bson" ) const ( @@ -44,6 +48,39 @@ func LoadJson(filename string, destination interface{}) error { return nil } +func LoadBson(filename string, destination interface{}) error { + file, err := os.Open(filename) + if err != nil { + return err + } + + buf, err := ioutil.ReadAll(file) + if err != nil { + return err + } + + // https://github.com/go-mgo/mgo/issues/363 + re := regexp.MustCompile(`" :`) + buf = re.ReplaceAll(buf, []byte(`":`)) + + // Using regexp is not supported + // https://github.com/go-mgo/mgo/issues/363 + re = regexp.MustCompile(`(/.*/)`) + buf = re.ReplaceAll(buf, []byte(`"$1"`)) + + // Using functions is not supported + // https://github.com/go-mgo/mgo/issues/363 + re = regexp.MustCompile(`(?s): (function \(.*?\) {.*?})`) + buf = re.ReplaceAll(buf, []byte(`: ""`)) + + err = bson.UnmarshalJSON(buf, &destination) + if err != nil { + return err + } + + return nil +} + func WriteJson(filename string, data interface{}) error { buf, err := json.MarshalIndent(data, "", " ") diff --git a/src/go/mongolib/fingerprinter/figerprinter.go b/src/go/mongolib/fingerprinter/figerprinter.go deleted file mode 100644 index 3a1c0de2..00000000 --- a/src/go/mongolib/fingerprinter/figerprinter.go +++ /dev/null @@ -1,115 +0,0 @@ -package fingerprinter - -import ( - "encoding/json" - "fmt" - "regexp" - "sort" - "strings" - - "github.com/percona/percona-toolkit/src/go/mongolib/util" -) - -var ( - MAX_DEPTH_LEVEL = 10 - DEFAULT_KEY_FILTERS = []string{"^shardVersion$", "^\\$"} -) - -type Fingerprinter interface { - Fingerprint(query map[string]interface{}) (string, error) -} - -type Fingerprint struct { - keyFilters []string -} - -func NewFingerprinter(keyFilters []string) *Fingerprint { - return &Fingerprint{ - keyFilters: keyFilters, - } -} - -// Query is the top level map query element -// Example for MongoDB 3.2+ -// "query" : { -// "find" : "col1", -// "filter" : { -// "s2" : { -// "$lt" : "54701", -// "$gte" : "73754" -// } -// }, -// "sort" : { -// "user_id" : 1 -// } -// } -func (f *Fingerprint) Fingerprint(query map[string]interface{}) (string, error) { - - realQuery, err := util.GetQueryField(query) - if err != nil { - // Try to encode doc.Query as json for prettiness - if buf, err := json.Marshal(realQuery); err == nil { - return "", fmt.Errorf("%v for query %s", err, string(buf)) - } - // If we cannot encode as json, return just the error message without the query - return "", err - } - retKeys := keys(realQuery, f.keyFilters) - - sort.Strings(retKeys) - - // if there is a sort clause in the query, we have to add all fields in the sort - // fields list that are not in the query keys list (retKeys) - if sortKeys, ok := query["sort"]; ok { - if sortKeysMap, ok := sortKeys.(map[string]interface{}); ok { - sortKeys := keys(sortKeysMap, f.keyFilters) - for _, sortKey := range sortKeys { - if !inSlice(sortKey, retKeys) { - retKeys = append(retKeys, sortKey) - } - } - } - } - - return strings.Join(retKeys, ","), nil -} - -func inSlice(str string, list []string) bool { - for _, v := range list { - if v == str { - return true - } - } - return false -} - -func keys(query map[string]interface{}, keyFilters []string) []string { - return getKeys(query, keyFilters, 0) -} - -func getKeys(query map[string]interface{}, keyFilters []string, level int) []string { - ks := []string{} - for key, value := range query { - if shouldSkipKey(key, keyFilters) { - continue - } - ks = append(ks, key) - if m, ok := value.(map[string]interface{}); ok { - level++ - if level <= MAX_DEPTH_LEVEL { - ks = append(ks, getKeys(m, keyFilters, level)...) - } - } - } - sort.Strings(ks) - return ks -} - -func shouldSkipKey(key string, keyFilters []string) bool { - for _, filter := range keyFilters { - if matched, _ := regexp.MatchString(filter, key); matched { - return true - } - } - return false -} diff --git a/src/go/mongolib/fingerprinter/figerprinter_test.go b/src/go/mongolib/fingerprinter/figerprinter_test.go deleted file mode 100644 index d2d3d484..00000000 --- a/src/go/mongolib/fingerprinter/figerprinter_test.go +++ /dev/null @@ -1,29 +0,0 @@ -package fingerprinter - -import "testing" - -func TestFingerprint(t *testing.T) { - - query := map[string]interface{}{ - "find": "feedback", - "filter": map[string]interface{}{ - "tool": "Atlas", - "potId": "2c9180865ae33e85015af1cc29243dc5", - }, - "limit": 1, - "singleBatch": true, - } - want := "potId,tool" - - fp := NewFingerprinter(nil) - got, err := fp.Fingerprint(query) - - if err != nil { - t.Error("Error in fingerprint") - } - - if got != want { - t.Errorf("Invalid fingerprint. Got: %q, want %q", got, want) - } - -} diff --git a/src/go/mongolib/fingerprinter/fingerprinter.go b/src/go/mongolib/fingerprinter/fingerprinter.go new file mode 100644 index 00000000..e434d4f0 --- /dev/null +++ b/src/go/mongolib/fingerprinter/fingerprinter.go @@ -0,0 +1,216 @@ +package fingerprinter + +import ( + "encoding/json" + "fmt" + "regexp" + "sort" + "strings" + + "github.com/percona/percona-toolkit/src/go/mongolib/proto" + "github.com/percona/percona-toolkit/src/go/mongolib/util" +) + +var ( + MAX_DEPTH_LEVEL = 10 + DEFAULT_KEY_FILTERS = []string{"^shardVersion$"} +) + +type Fingerprinter interface { + Fingerprint(doc proto.SystemProfile) (string, error) +} + +type Fingerprint struct { + keyFilters []string +} + +func NewFingerprinter(keyFilters []string) *Fingerprint { + return &Fingerprint{ + keyFilters: keyFilters, + } +} + +// Query is the top level map query element +// Example for MongoDB 3.2+ +// "query" : { +// "find" : "col1", +// "filter" : { +// "s2" : { +// "$lt" : "54701", +// "$gte" : "73754" +// } +// }, +// "sort" : { +// "user_id" : 1 +// } +// } +func (f *Fingerprint) Fingerprint(doc proto.SystemProfile) (string, error) { + realQuery, err := util.GetQueryField(doc) + if err != nil { + // Try to encode doc.Query as json for prettiness + if buf, err := json.Marshal(realQuery); err == nil { + return "", fmt.Errorf("%v for query %s", err, string(buf)) + } + // If we cannot encode as json, return just the error message without the query + return "", err + } + retKeys := keys(realQuery, f.keyFilters) + + // Proper way to detect if protocol used is "op_msg" or "op_command" + // would be to look at "doc.Protocol" field, + // however MongoDB 3.0 doesn't have that field + // so we need to detect protocol by looking at actual data. + query := doc.Query + if doc.Command.Len() > 0 { + query = doc.Command + } + + // if there is a sort clause in the query, we have to add all fields in the sort + // fields list that are not in the query keys list (retKeys) + if sortKeys, ok := query.Map()["sort"]; ok { + if sortKeysMap, ok := sortKeys.(map[string]interface{}); ok { + sortKeys := keys(sortKeysMap, f.keyFilters) + retKeys = append(retKeys, sortKeys...) + } + } + + // Extract collection name and operation + op := "" + collection := "" + switch doc.Op { + case "remove", "update": + op = doc.Op + ns := strings.Split(doc.Ns, ".") + if len(ns) == 2 { + collection = ns[1] + } + case "insert": + op = doc.Op + ns := strings.Split(doc.Ns, ".") + if len(ns) == 2 { + collection = ns[1] + } + retKeys = []string{} + case "query": + op = "find" + ns := strings.Split(doc.Ns, ".") + if len(ns) == 2 { + collection = ns[1] + } + default: + // first key is operation type + op = query.D[0].Name + collection, _ = query.D[0].Value.(string) + switch op { + case "group": + retKeys = []string{} + if g, ok := query.Map()["group"]; ok { + if m, ok := g.(map[string]interface{}); ok { + if f, ok := m["key"]; ok { + if keysMap, ok := f.(map[string]interface{}); ok { + retKeys = append(retKeys, keys(keysMap, []string{})...) + } + } + if f, ok := m["cond"]; ok { + if keysMap, ok := f.(map[string]interface{}); ok { + retKeys = append(retKeys, keys(keysMap, []string{})...) + } + } + if f, ok := m["ns"]; ok { + if ns, ok := f.(string); ok { + collection = ns + } + } + } + } + case "distinct": + if key, ok := query.Map()["key"]; ok { + if k, ok := key.(string); ok { + retKeys = append(retKeys, k) + } + } + case "aggregate": + retKeys = []string{} + if v, ok := query.Map()["pipeline"]; ok { + retKeys = append(retKeys, keys(v, []string{})...) + } + case "geoNear": + retKeys = []string{} + } + } + + sort.Strings(retKeys) + retKeys = deduplicate(retKeys) + keys := strings.Join(retKeys, ",") + op = strings.ToUpper(op) + + parts := []string{} + if op != "" { + parts = append(parts, op) + } + if collection != "" { + parts = append(parts, collection) + } + if keys != "" { + parts = append(parts, keys) + } + + return strings.Join(parts, " "), nil +} + +func keys(query interface{}, keyFilters []string) []string { + return getKeys(query, keyFilters, 0) +} + +func getKeys(query interface{}, keyFilters []string, level int) []string { + ks := []string{} + var q []interface{} + switch v := query.(type) { + case map[string]interface{}: + q = append(q, v) + case []interface{}: + q = v + } + + if level <= MAX_DEPTH_LEVEL { + for i := range q { + if query, ok := q[i].(map[string]interface{}); ok { + for key, value := range query { + if shouldSkipKey(key, keyFilters) { + continue + } + if matched, _ := regexp.MatchString("^\\$", key); !matched { + ks = append(ks, key) + } + + ks = append(ks, getKeys(value, keyFilters, level)...) + } + } else { + ks = append(ks, getKeys(q[i], keyFilters, level)...) + } + } + } + return ks +} + +func shouldSkipKey(key string, keyFilters []string) bool { + for _, filter := range keyFilters { + if matched, _ := regexp.MatchString(filter, key); matched { + return true + } + } + return false +} + +func deduplicate(s []string) (r []string) { + m := map[string]struct{}{} + + for _, v := range s { + if _, seen := m[v]; !seen { + r = append(r, v) + m[v] = struct{}{} + } + } + + return r +} diff --git a/src/go/mongolib/fingerprinter/fingerprinter_test.go b/src/go/mongolib/fingerprinter/fingerprinter_test.go new file mode 100644 index 00000000..172bd7dd --- /dev/null +++ b/src/go/mongolib/fingerprinter/fingerprinter_test.go @@ -0,0 +1,251 @@ +package fingerprinter + +import ( + "fmt" + "io/ioutil" + "log" + "os" + "reflect" + "testing" + + "github.com/percona/percona-toolkit/src/go/lib/tutil" + "github.com/percona/percona-toolkit/src/go/mongolib/proto" + "github.com/percona/pmgo" + "gopkg.in/mgo.v2" + "gopkg.in/mgo.v2/bson" +) + +const ( + samples = "/src/go/tests/" +) + +type testVars struct { + RootPath string +} + +var vars testVars + +func TestMain(m *testing.M) { + var err error + if vars.RootPath, err = tutil.RootPath(); err != nil { + log.Printf("cannot get root path: %s", err.Error()) + os.Exit(1) + } + os.Exit(m.Run()) +} + +func ExampleFingerprint() { + doc := proto.SystemProfile{} + err := tutil.LoadBson(vars.RootPath+samples+"fingerprinter_doc.json", &doc) + if err != nil { + panic(err) + } + + fp := NewFingerprinter(DEFAULT_KEY_FILTERS) + got, err := fp.Fingerprint(doc) + if err != nil { + panic(err) + } + fmt.Println(got) + // Output: FIND sbtest3 c,k,pad +} + +func TestFingerprint(t *testing.T) { + doc := proto.SystemProfile{} + doc.Query = proto.BsonD{bson.D{ + {"find", "feedback"}, + {"filter", map[string]interface{}{ + "tool": "Atlas", + "potId": "2c9180865ae33e85015af1cc29243dc5", + }}, + {"limit", 1}, + {"singleBatch", true}, + }} + want := "FIND feedback potId,tool" + + fp := NewFingerprinter(nil) + got, err := fp.Fingerprint(doc) + + if err != nil { + t.Error("Error in fingerprint") + } + + if got != want { + t.Errorf("Invalid fingerprint. Got: %q, want %q", got, want) + } +} + +//func TestFingerprints(t *testing.T) { +// //t.Parallel() +// +// dialer := pmgo.NewDialer() +// dialInfo, _ := pmgo.ParseURL("127.0.0.1:27017") +// +// session, err := dialer.DialWithInfo(dialInfo) +// if err != nil { +// t.Fatalf("cannot dial: %s", err) +// } +// defer session.Close() +// session.SetMode(mgo.Eventual, true) +// +// dir := vars.RootPath+samples+"/profile/" +// files, err := ioutil.ReadDir(dir) +// if err != nil { +// t.Fatalf("cannot load samples: %s", err) +// } +// +// for _, file := range files { +// f, err := os.Open(dir+file.Name()) +// if err != nil { +// t.Fatalf("cannot open file: %s", err) +// } +// +// buf, err := ioutil.ReadAll(f) +// if err != nil { +// t.Fatalf("cannot read file: %s", err) +// } +// +// t.Run(file.Name(), func(t *testing.T) { +// var err error +// result := bson.Raw{} +// err = session.DB("").Run(bson.M{"eval": string(buf)}, &result) +// if err != nil { +// t.Fatalf("cannot execute query: %s", err) +// } +// doc := proto.SystemProfile{} +// query := bson.M{"op": bson.M{"$nin": []string{"getmore"}}, "ns": bson.M{"$nin": []string{"test.system.profile"}}} +// err = session.DB("").C("system.profile").Find(query).Sort("-ts").Limit(1).One(&doc) +// if err != nil { +// t.Fatalf("cannot get system.profile query: %s", err) +// } +// fmt.Println(doc) +// +// //err = tutil.LoadBson(dir+file.Name(), &doc) +// //if err != nil { +// // t.Fatalf("cannot load sample: %s", err) +// //} +// fp := NewFingerprinter(DEFAULT_KEY_FILTERS) +// got, err := fp.Fingerprint(doc) +// if err != nil { +// panic(err) +// } +// if !reflect.DeepEqual(got, "") { +// t.Errorf("fp.Fingerprint(doc) = %s, want %s", got, "") +// } +// }) +// } +// +// +//} + +func TestFingerprints(t *testing.T) { + t.Parallel() + + dialer := pmgo.NewDialer() + dialInfo, _ := pmgo.ParseURL("") + + session, err := dialer.DialWithInfo(dialInfo) + if err != nil { + t.Fatalf("cannot dial: %s", err) + } + defer session.Close() + session.SetMode(mgo.Eventual, true) + + dir := vars.RootPath + samples + "/doc/out/" + files, err := ioutil.ReadDir(dir) + if err != nil { + t.Fatalf("cannot list samples: %s", err) + } + + expects := map[string]string{ + "aggregate_2.6.12": "AGGREGATE coll a", + "aggregate_3.0.15": "AGGREGATE coll a", + "aggregate_3.2.16": "AGGREGATE coll a", + "aggregate_3.4.7": "AGGREGATE coll a", + "aggregate_3.5.11": "AGGREGATE coll a", + "count_2.6.12": "COUNT coll", + "count_3.0.15": "COUNT coll", + "count_3.2.16": "COUNT coll", + "count_3.4.7": "COUNT coll", + "count_3.5.11": "COUNT coll", + "count_with_query_2.6.12": "COUNT coll a", + "count_with_query_3.0.15": "COUNT coll a", + "count_with_query_3.2.16": "COUNT coll a", + "count_with_query_3.4.7": "COUNT coll a", + "count_with_query_3.5.11": "COUNT coll a", + "delete_2.6.12": "REMOVE coll a,b", + "delete_3.0.15": "REMOVE coll a,b", + "delete_3.2.16": "REMOVE coll a,b", + "delete_3.4.7": "REMOVE coll a,b", + "delete_3.5.11": "REMOVE coll a,b", + "distinct_2.6.12": "DISTINCT coll a,b", + "distinct_3.0.15": "DISTINCT coll a,b", + "distinct_3.2.16": "DISTINCT coll a,b", + "distinct_3.4.7": "DISTINCT coll a,b", + "distinct_3.5.11": "DISTINCT coll a,b", + "find_empty_2.6.12": "FIND coll", + "find_empty_3.0.15": "FIND coll", + "find_empty_3.2.16": "FIND coll", + "find_empty_3.4.7": "FIND coll", + "find_empty_3.5.11": "FIND coll", + "find_2.6.12": "FIND coll a", + "find_3.0.15": "FIND coll a", + "find_3.2.16": "FIND coll a", + "find_3.4.7": "FIND coll a", + "find_3.5.11": "FIND coll a", + "find_andrii_2.6.12": "FIND coll c,k,pad", + "find_andrii_3.0.15": "FIND coll c,k,pad", + "find_andrii_3.2.16": "FIND coll c,k,pad", + "find_andrii_3.4.7": "FIND coll c,k,pad", + "find_andrii_3.5.11": "FIND coll c,k,pad", + "findandmodify_2.6.12": "FINDANDMODIFY coll a", + "findandmodify_3.0.15": "FINDANDMODIFY coll a", + "findandmodify_3.2.16": "FINDANDMODIFY coll a", + "findandmodify_3.4.7": "FINDANDMODIFY coll a", + "findandmodify_3.5.11": "FINDANDMODIFY coll a", + "geonear_2.6.12": "GEONEAR coll", + "geonear_3.0.15": "GEONEAR coll", + "geonear_3.2.16": "GEONEAR coll", + "geonear_3.4.7": "GEONEAR coll", + "geonear_3.5.11": "GEONEAR coll", + "group_2.6.12": "GROUP coll a,b", + "group_3.0.15": "GROUP coll a,b", + "group_3.2.16": "GROUP coll a,b", + "group_3.4.7": "GROUP coll a,b", + "group_3.5.11": "GROUP coll a,b", + "insert_2.6.12": "INSERT coll", + "insert_3.0.15": "INSERT coll", + "insert_3.2.16": "INSERT coll", + "insert_3.4.7": "INSERT coll", + "insert_3.5.11": "INSERT coll", + "mapreduce_2.6.12": "MAPREDUCE coll a", + "mapreduce_3.0.15": "MAPREDUCE coll a", + "mapreduce_3.2.16": "MAPREDUCE coll a", + "mapreduce_3.4.7": "MAPREDUCE coll a", + "mapreduce_3.5.11": "MAPREDUCE coll a", + "update_2.6.12": "UPDATE coll a", + "update_3.0.15": "UPDATE coll a", + "update_3.2.16": "UPDATE coll a", + "update_3.4.7": "UPDATE coll a", + "update_3.5.11": "UPDATE coll a", + } + + for _, file := range files { + t.Run(file.Name(), func(t *testing.T) { + doc := proto.SystemProfile{} + err = tutil.LoadBson(dir+file.Name(), &doc) + if err != nil { + t.Fatalf("cannot load sample %s: %s", dir+file.Name(), err) + } + fp := NewFingerprinter(DEFAULT_KEY_FILTERS) + got, err := fp.Fingerprint(doc) + if err != nil { + t.Errorf("cannot create fingerprint: %s", err) + } + expect := expects[file.Name()] + if !reflect.DeepEqual(got, expect) { + t.Errorf("fp.Fingerprint(doc) = %s, want %s", got, expect) + } + }) + } +} diff --git a/src/go/mongolib/profiler/profiler.go b/src/go/mongolib/profiler/profiler.go index f920a28c..44f85c21 100644 --- a/src/go/mongolib/profiler/profiler.go +++ b/src/go/mongolib/profiler/profiler.go @@ -139,7 +139,7 @@ func (p *Profile) getDocs() { if !valid { continue } - if len(doc.Query) > 0 { + if doc.Query.Len() > 0 { p.stats.Add(doc) } } diff --git a/src/go/mongolib/profiler/profiler_test.go b/src/go/mongolib/profiler/profiler_test.go index c3289396..fd42ba7c 100644 --- a/src/go/mongolib/profiler/profiler_test.go +++ b/src/go/mongolib/profiler/profiler_test.go @@ -70,14 +70,11 @@ func TestRegularIterator(t *testing.T) { lastSeen, _ := time.Parse(time.RFC3339Nano, "2017-04-01T23:01:20.214+00:00") want := stats.Queries{ { - ID: "c6466139b21c392acd0699e863b50d81", - Namespace: "samples.col1", - Operation: "query", - Query: map[string]interface{}{ - "find": "col1", - "shardVersion": []interface{}{float64(0), "000000000000000000000000"}, - }, - Fingerprint: "find", + ID: "16196765fb4c14edb91efdbe4f5c5973", + Namespace: "samples.col1", + Operation: "query", + Query: "", + Fingerprint: "FIND col1 find", FirstSeen: firstSeen, LastSeen: lastSeen, TableScan: false, @@ -130,14 +127,11 @@ func TestIteratorTimeout(t *testing.T) { lastSeen, _ := time.Parse(time.RFC3339Nano, "2017-04-01T23:01:19.914+00:00") want := stats.Queries{ { - ID: "c6466139b21c392acd0699e863b50d81", - Namespace: "samples.col1", - Operation: "query", - Query: map[string]interface{}{ - "find": "col1", - "shardVersion": []interface{}{float64(0), "000000000000000000000000"}, - }, - Fingerprint: "find", + ID: "16196765fb4c14edb91efdbe4f5c5973", + Namespace: "samples.col1", + Operation: "query", + Query: "", + Fingerprint: "FIND col1 find", FirstSeen: firstSeen, LastSeen: lastSeen, TableScan: false, @@ -214,14 +208,11 @@ func TestTailIterator(t *testing.T) { want := stats.Queries{ { - ID: "c6466139b21c392acd0699e863b50d81", - Namespace: "samples.col1", - Operation: "query", - Query: map[string]interface{}{ - "find": "col1", - "shardVersion": []interface{}{float64(0), "000000000000000000000000"}, - }, - Fingerprint: "find", + ID: "16196765fb4c14edb91efdbe4f5c5973", + Namespace: "samples.col1", + Operation: "query", + Query: "", + Fingerprint: "FIND col1 find", FirstSeen: parseDate("2017-04-01T23:01:20.214+00:00"), LastSeen: parseDate("2017-04-01T23:01:20.214+00:00"), TableScan: false, @@ -232,14 +223,11 @@ func TestTailIterator(t *testing.T) { ResponseLength: []float64{1.06123e+06}, }, { - ID: "c6466139b21c392acd0699e863b50d81", - Namespace: "samples.col1", - Operation: "query", - Query: map[string]interface{}{ - "find": "col1", - "shardVersion": []interface{}{float64(0), "000000000000000000000000"}, - }, - Fingerprint: "find", + ID: "16196765fb4c14edb91efdbe4f5c5973", + Namespace: "samples.col1", + Operation: "query", + Query: "", + Fingerprint: "FIND col1 find", FirstSeen: parseDate("2017-04-01T23:01:19.914+00:00"), LastSeen: parseDate("2017-04-01T23:01:19.914+00:00"), TableScan: false, diff --git a/src/go/mongolib/proto/bson.go b/src/go/mongolib/proto/bson.go new file mode 100644 index 00000000..f4f890e7 --- /dev/null +++ b/src/go/mongolib/proto/bson.go @@ -0,0 +1,114 @@ +package proto + +import ( + "bytes" + "encoding/json" + "fmt" + + "gopkg.in/mgo.v2/bson" +) + +type BsonD struct { + bson.D +} + +func (d *BsonD) UnmarshalJSON(data []byte) error { + dec := json.NewDecoder(bytes.NewReader(data)) + + t, err := dec.Token() + if err != nil { + return err + } + if t != json.Delim('{') { + return fmt.Errorf("expected { but got %s", t) + } + for { + t, err := dec.Token() + if err != nil { + return err + } + + // Might be empty object + if t == json.Delim('}') { + return nil + } + + key, ok := t.(string) + if !ok { + return fmt.Errorf("expected key to be a string but got %s", t) + } + + de := bson.DocElem{} + de.Name = key + + if !dec.More() { + return fmt.Errorf("missing value for key %s", key) + } + + v := BsonD{} + r := dec.Buffered() + ndec := json.NewDecoder(r) + err = ndec.Decode(&v) + if err != nil { + var v interface{} + dec.Decode(&v) + de.Value = v + } else { + de.Value = v + } + + d.D = append(d.D, de) + if !dec.More() { + break + } + } + + t, err = dec.Token() + if err != nil { + return err + } + if t != json.Delim('}') { + return fmt.Errorf("expect delimeter %s but got %s", json.Delim('}'), t) + } + + return nil +} + +func (d *BsonD) MarshalJSON() ([]byte, error) { + var b bytes.Buffer + if d.D == nil { + b.WriteString("null") + return nil, nil + } + + b.WriteByte('{') + + for i, v := range d.D { + if i > 0 { + b.WriteByte(',') + } + + // marshal key + key, err := json.Marshal(v.Name) + if err != nil { + return nil, err + } + b.Write(key) + b.WriteByte(':') + + // marshal value + val, err := json.Marshal(v.Value) + if err != nil { + return nil, err + } + b.Write(val) + } + + b.WriteByte('}') + + return b.Bytes(), nil +} + +func (d BsonD) Len() int { + return len(d.D) +} diff --git a/src/go/mongolib/proto/main_test.go b/src/go/mongolib/proto/main_test.go index c6d96154..60179394 100644 --- a/src/go/mongolib/proto/main_test.go +++ b/src/go/mongolib/proto/main_test.go @@ -6,8 +6,6 @@ import ( "os" "testing" - "github.com/percona/percona-toolkit/src/go/mongolib/proto" - mgo "gopkg.in/mgo.v2" "gopkg.in/mgo.v2/bson" "gopkg.in/mgo.v2/dbtest" @@ -37,11 +35,10 @@ func TestMain(m *testing.M) { } func ExampleServerStatus() { - ss := proto.ServerStatus{} - if err := session.DB("admin").Run(bson.D{{"serverStatus", 1}, {"recordStats", 1}}, &ss); err != nil { + ss := map[string]interface{}{} + if err := session.DB("admin").Run(bson.D{{"ping", 1}}, &ss); err != nil { panic(err) } fmt.Printf("%+v", ss) - // Output: - + // Output: map[ok:1] } diff --git a/src/go/mongolib/proto/system.profile.go b/src/go/mongolib/proto/system.profile.go index 3bb4494d..bb444e9b 100644 --- a/src/go/mongolib/proto/system.profile.go +++ b/src/go/mongolib/proto/system.profile.go @@ -1,6 +1,8 @@ package proto -import "time" +import ( + "time" +) type SystemProfile struct { AllUsers []interface{} `bson:"allUsers"` @@ -65,15 +67,16 @@ type SystemProfile struct { } `bson:"acquireCount"` } `bson:"MMAPV1Journal"` } `bson:"locks"` - Millis int `bson:"millis"` - Nreturned int `bson:"nreturned"` - Ns string `bson:"ns"` - NumYield int `bson:"numYield"` - Op string `bson:"op"` - Protocol string `bson:"protocol"` - Query map[string]interface{} `bson:"query"` - ResponseLength int `bson:"responseLength"` - Ts time.Time `bson:"ts"` - User string `bson:"user"` - WriteConflicts int `bson:"writeConflicts"` + Millis int `bson:"millis"` + Nreturned int `bson:"nreturned"` + Ns string `bson:"ns"` + NumYield int `bson:"numYield"` + Op string `bson:"op"` + Protocol string `bson:"protocol"` + Query BsonD `bson:"query"` + Command BsonD `bson:"command"` + ResponseLength int `bson:"responseLength"` + Ts time.Time `bson:"ts"` + User string `bson:"user"` + WriteConflicts int `bson:"writeConflicts"` } diff --git a/src/go/mongolib/stats/stats.go b/src/go/mongolib/stats/stats.go index e7c38b84..1752140a 100644 --- a/src/go/mongolib/stats/stats.go +++ b/src/go/mongolib/stats/stats.go @@ -4,13 +4,14 @@ import ( "crypto/md5" "encoding/json" "fmt" + "sort" "sync" "time" "github.com/montanaflynn/stats" "github.com/percona/percona-toolkit/src/go/mongolib/fingerprinter" "github.com/percona/percona-toolkit/src/go/mongolib/proto" - "github.com/percona/percona-toolkit/src/go/mongolib/util" + "gopkg.in/mgo.v2/bson" ) type StatsError struct { @@ -62,7 +63,7 @@ func (s *Stats) Reset() { // Add adds proto.SystemProfile to the collection of statistics func (s *Stats) Add(doc proto.SystemProfile) error { - fp, err := s.fingerprinter.Fingerprint(doc.Query) + fp, err := s.fingerprinter.Fingerprint(doc) if err != nil { return &StatsFingerprintError{err} } @@ -75,17 +76,24 @@ func (s *Stats) Add(doc proto.SystemProfile) error { Namespace: doc.Ns, } if qiac, ok = s.getQueryInfoAndCounters(key); !ok { - realQuery, err := util.GetQueryField(doc.Query) + query := doc.Query + if doc.Command.Len() > 0 { + query = doc.Command + } if err != nil { return &StatsGetQueryFieldError{err} } + queryBson, err := bson.MarshalJSON(&query) + if err != nil { + return err + } qiac = &QueryInfoAndCounters{ ID: fmt.Sprintf("%x", md5.Sum([]byte(fmt.Sprintf("%s", key)))), Operation: doc.Op, Fingerprint: fp, Namespace: doc.Ns, TableScan: false, - Query: realQuery, + Query: string(queryBson), } s.setQueryInfoAndCounters(key, qiac) } @@ -110,9 +118,14 @@ func (s *Stats) Queries() Queries { s.RLock() defer s.RUnlock() + keys := GroupKeys{} + for key := range s.queryInfoAndCounters { + keys = append(keys, key) + } + sort.Sort(keys) queries := []QueryInfoAndCounters{} - for _, v := range s.queryInfoAndCounters { - queries = append(queries, *v) + for _, key := range keys { + queries = append(queries, *s.queryInfoAndCounters[key]) } return queries } @@ -162,7 +175,7 @@ type QueryInfoAndCounters struct { ID string Namespace string Operation string - Query map[string]interface{} + Query string Fingerprint string FirstSeen time.Time LastSeen time.Time @@ -184,10 +197,20 @@ func (a Times) Len() int { return len(a) } func (a Times) Swap(i, j int) { a[i], a[j] = a[j], a[i] } func (a Times) Less(i, j int) bool { return a[i].Before(a[j]) } +type GroupKeys []GroupKey + +func (a GroupKeys) Len() int { return len(a) } +func (a GroupKeys) Swap(i, j int) { a[i], a[j] = a[j], a[i] } +func (a GroupKeys) Less(i, j int) bool { return a[i].String() < a[j].String() } + type GroupKey struct { Operation string - Fingerprint string Namespace string + Fingerprint string +} + +func (g GroupKey) String() string { + return g.Operation + g.Namespace + g.Fingerprint } type totalCounters struct { diff --git a/src/go/mongolib/stats/stats_test.go b/src/go/mongolib/stats/stats_test.go index d1e4b3f8..56c492f3 100644 --- a/src/go/mongolib/stats/stats_test.go +++ b/src/go/mongolib/stats/stats_test.go @@ -1,15 +1,16 @@ package stats import ( - "github.com/golang/mock/gomock" - "github.com/percona/percona-toolkit/src/go/lib/tutil" - "github.com/percona/percona-toolkit/src/go/mongolib/fingerprinter" - "github.com/percona/percona-toolkit/src/go/mongolib/proto" "log" "os" "reflect" "testing" "time" + + "github.com/golang/mock/gomock" + "github.com/percona/percona-toolkit/src/go/lib/tutil" + "github.com/percona/percona-toolkit/src/go/mongolib/fingerprinter" + "github.com/percona/percona-toolkit/src/go/mongolib/proto" ) const ( @@ -138,11 +139,11 @@ func TestStats(t *testing.T) { t.Errorf("Error processing doc: %s\n", err.Error()) } statsVal := QueryInfoAndCounters{ - ID: "84e09ef6a3dc35f472df05fa98eee7d3", + ID: "4e4774ad26f934a193757002a991ebb8", Namespace: "samples.col1", Operation: "query", - Query: map[string]interface{}{"s2": map[string]interface{}{"$gte": "41991", "$lt": "33754"}}, - Fingerprint: "s2", + Query: "", + Fingerprint: "FIND col1 s2", FirstSeen: parseDate("2017-04-10T13:15:53.532-03:00"), LastSeen: parseDate("2017-04-10T13:15:53.532-03:00"), TableScan: false, diff --git a/src/go/mongolib/util/util.go b/src/go/mongolib/util/util.go index 259489aa..0a592c65 100644 --- a/src/go/mongolib/util/util.go +++ b/src/go/mongolib/util/util.go @@ -237,21 +237,100 @@ func GetServerStatus(dialer pmgo.Dialer, di *pmgo.DialInfo, hostname string) (pr return ss, nil } -func GetQueryField(query map[string]interface{}) (map[string]interface{}, error) { - // MongoDB 3.0 - if squery, ok := query["$query"]; ok { +func GetQueryField(doc proto.SystemProfile) (map[string]interface{}, error) { + // Proper way to detect if protocol used is "op_msg" or "op_command" + // would be to look at "doc.Protocol" field, + // however MongoDB 3.0 doesn't have that field + // so we need to detect protocol by looking at actual data. + query := doc.Query + if doc.Command.Len() > 0 { + query = doc.Command + if doc.Op == "update" || doc.Op == "remove" { + if squery, ok := query.Map()["q"]; ok { + // just an extra check to ensure this type assertion won't fail + if ssquery, ok := squery.(map[string]interface{}); ok { + return ssquery, nil + } + return nil, CANNOT_GET_QUERY_ERROR + } + } + } + + // "query" in MongoDB 3.0 can look like this: + // { + // "op" : "query", + // "ns" : "test.coll", + // "query" : { + // "a" : 1 + // }, + // ... + // } + // + // but also it can have "query" subkey like this: + // { + // "op" : "query", + // "ns" : "test.coll", + // "query" : { + // "query" : { + // "$and" : [ + // { + // "k" : { + // "$gt" : 1 + // } + // }, + // { + // "k" : { + // "$lt" : 2 + // } + // }, + // { + // "$or" : [ + // { + // "c" : { + // "$in" : [ + // /^0/, + // /^2/, + // /^4/, + // /^6/ + // ] + // } + // }, + // { + // "pad" : { + // "$in" : [ + // /9$/, + // /7$/, + // /5$/, + // /3$/ + // ] + // } + // } + // ] + // } + // ] + // }, + // "orderby" : { + // "k" : -1 + // } + // }, + // ... + // } + // + if squery, ok := query.Map()["query"]; ok { // just an extra check to ensure this type assertion won't fail if ssquery, ok := squery.(map[string]interface{}); ok { return ssquery, nil } return nil, CANNOT_GET_QUERY_ERROR } - // MongoDB 3.2+ - if squery, ok := query["filter"]; ok { + + // "query" in MongoDB 3.2+ is better structured and always has a "filter" subkey: + if squery, ok := query.Map()["filter"]; ok { if ssquery, ok := squery.(map[string]interface{}); ok { return ssquery, nil } return nil, CANNOT_GET_QUERY_ERROR } - return query, nil + + return query.Map(), nil } diff --git a/src/go/pt-mongodb-summary/main.go b/src/go/pt-mongodb-summary/main.go index 6d90e81c..f3b0a4dd 100644 --- a/src/go/pt-mongodb-summary/main.go +++ b/src/go/pt-mongodb-summary/main.go @@ -504,7 +504,7 @@ func GetSecuritySettings(session pmgo.SessionManager, ver string) (*security, er } } else { if ip != "127.0.0.1" && ip != extIP { - s.WarningMsgs = append(s.WarningMsgs, fmt.Sprintf("WARNING: You might be insecure. IP binding %s is not localhost")) + s.WarningMsgs = append(s.WarningMsgs, fmt.Sprintf("WARNING: You might be insecure. IP binding %s is not localhost", ip)) } } } diff --git a/src/go/tests/doc/docker-compose.yml b/src/go/tests/doc/docker-compose.yml new file mode 100644 index 00000000..34b21d83 --- /dev/null +++ b/src/go/tests/doc/docker-compose.yml @@ -0,0 +1,7 @@ +version: '3' +services: + mongo: + image: ${MONGO_IMAGE:-mongo} + volumes: + - ./script:/script + - ./out:/out diff --git a/src/go/tests/doc/out/aggregate_2.6.12 b/src/go/tests/doc/out/aggregate_2.6.12 new file mode 100644 index 00000000..ba3b921b --- /dev/null +++ b/src/go/tests/doc/out/aggregate_2.6.12 @@ -0,0 +1,40 @@ +{ + "op" : "command", + "ns" : "test.$cmd", + "command" : { + "aggregate" : "coll", + "pipeline" : [ + { + "$match" : { + "a" : { + "$gte" : 2 + } + } + } + ], + "cursor" : { + + } + }, + "keyUpdates" : 0, + "numYield" : 0, + "lockStats" : { + "timeLockedMicros" : { + "r" : NumberLong(154), + "w" : NumberLong(0) + }, + "timeAcquiringMicros" : { + "r" : NumberLong(4), + "w" : NumberLong(2) + } + }, + "responseLength" : 385, + "millis" : 0, + "execStats" : { + + }, + "ts" : ISODate("2017-08-20T15:39:14.658Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/aggregate_3.0.15 b/src/go/tests/doc/out/aggregate_3.0.15 new file mode 100644 index 00000000..619ff376 --- /dev/null +++ b/src/go/tests/doc/out/aggregate_3.0.15 @@ -0,0 +1,53 @@ +{ + "op" : "command", + "ns" : "test.$cmd", + "command" : { + "aggregate" : "coll", + "pipeline" : [ + { + "$match" : { + "a" : { + "$gte" : 2 + } + } + } + ], + "cursor" : { + + } + }, + "keyUpdates" : 0, + "writeConflicts" : 0, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(6) + } + }, + "MMAPV1Journal" : { + "acquireCount" : { + "r" : NumberLong(3) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(3) + } + }, + "Collection" : { + "acquireCount" : { + "R" : NumberLong(3) + } + } + }, + "responseLength" : 385, + "millis" : 2, + "execStats" : { + + }, + "ts" : ISODate("2017-08-20T15:39:20.858Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/aggregate_3.2.16 b/src/go/tests/doc/out/aggregate_3.2.16 new file mode 100644 index 00000000..49b5ccb7 --- /dev/null +++ b/src/go/tests/doc/out/aggregate_3.2.16 @@ -0,0 +1,49 @@ +{ + "op" : "command", + "ns" : "test.coll", + "command" : { + "aggregate" : "coll", + "pipeline" : [ + { + "$match" : { + "a" : { + "$gte" : 2 + } + } + } + ], + "cursor" : { + + } + }, + "keyUpdates" : 0, + "writeConflicts" : 0, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(6) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(3) + } + }, + "Collection" : { + "acquireCount" : { + "r" : NumberLong(3) + } + } + }, + "responseLength" : 388, + "protocol" : "op_command", + "millis" : 2, + "execStats" : { + + }, + "ts" : ISODate("2017-08-20T15:39:29.915Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/aggregate_3.4.7 b/src/go/tests/doc/out/aggregate_3.4.7 new file mode 100644 index 00000000..7464feb8 --- /dev/null +++ b/src/go/tests/doc/out/aggregate_3.4.7 @@ -0,0 +1,50 @@ +{ + "op" : "command", + "ns" : "test.coll", + "command" : { + "aggregate" : "coll", + "pipeline" : [ + { + "$match" : { + "a" : { + "$gte" : 2 + } + } + } + ], + "cursor" : { + + } + }, + "keysExamined" : 8, + "docsExamined" : 8, + "cursorExhausted" : true, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(8) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(4) + } + }, + "Collection" : { + "acquireCount" : { + "r" : NumberLong(3) + } + } + }, + "nreturned" : 8, + "responseLength" : 370, + "protocol" : "op_command", + "millis" : 0, + "planSummary" : "IXSCAN { a: 1 }", + "ts" : ISODate("2017-08-20T15:39:36.711Z"), + "client" : "127.0.0.1", + "appName" : "MongoDB Shell", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/aggregate_3.5.11 b/src/go/tests/doc/out/aggregate_3.5.11 new file mode 100644 index 00000000..a039c308 --- /dev/null +++ b/src/go/tests/doc/out/aggregate_3.5.11 @@ -0,0 +1,51 @@ +{ + "op" : "command", + "ns" : "test.coll", + "command" : { + "aggregate" : "coll", + "pipeline" : [ + { + "$match" : { + "a" : { + "$gte" : 2 + } + } + } + ], + "cursor" : { + + }, + "$db" : "test" + }, + "keysExamined" : 8, + "docsExamined" : 8, + "cursorExhausted" : true, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(6) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(3) + } + }, + "Collection" : { + "acquireCount" : { + "r" : NumberLong(3) + } + } + }, + "nreturned" : 8, + "responseLength" : 370, + "protocol" : "op_msg", + "millis" : 2, + "planSummary" : "IXSCAN { a: 1 }", + "ts" : ISODate("2017-08-20T15:39:47.203Z"), + "client" : "127.0.0.1", + "appName" : "MongoDB Shell", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/count_2.6.12 b/src/go/tests/doc/out/count_2.6.12 new file mode 100644 index 00000000..b073b918 --- /dev/null +++ b/src/go/tests/doc/out/count_2.6.12 @@ -0,0 +1,34 @@ +{ + "op" : "command", + "ns" : "test.$cmd", + "command" : { + "count" : "coll", + "query" : { + + }, + "fields" : { + + } + }, + "keyUpdates" : 0, + "numYield" : 0, + "lockStats" : { + "timeLockedMicros" : { + "r" : NumberLong(12), + "w" : NumberLong(0) + }, + "timeAcquiringMicros" : { + "r" : NumberLong(2), + "w" : NumberLong(2) + } + }, + "responseLength" : 48, + "millis" : 0, + "execStats" : { + + }, + "ts" : ISODate("2017-08-20T15:39:14.823Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/count_3.0.15 b/src/go/tests/doc/out/count_3.0.15 new file mode 100644 index 00000000..2d7a5c5c --- /dev/null +++ b/src/go/tests/doc/out/count_3.0.15 @@ -0,0 +1,47 @@ +{ + "op" : "command", + "ns" : "test.$cmd", + "command" : { + "count" : "coll", + "query" : { + + }, + "fields" : { + + } + }, + "keyUpdates" : 0, + "writeConflicts" : 0, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(2) + } + }, + "MMAPV1Journal" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "R" : NumberLong(1) + } + } + }, + "responseLength" : 44, + "millis" : 0, + "execStats" : { + + }, + "ts" : ISODate("2017-08-20T15:39:20.982Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/count_3.2.16 b/src/go/tests/doc/out/count_3.2.16 new file mode 100644 index 00000000..975cd10c --- /dev/null +++ b/src/go/tests/doc/out/count_3.2.16 @@ -0,0 +1,43 @@ +{ + "op" : "command", + "ns" : "test.coll", + "command" : { + "count" : "coll", + "query" : { + + }, + "fields" : { + + } + }, + "keyUpdates" : 0, + "writeConflicts" : 0, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(2) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "r" : NumberLong(1) + } + } + }, + "responseLength" : 47, + "protocol" : "op_command", + "millis" : 0, + "execStats" : { + + }, + "ts" : ISODate("2017-08-20T15:39:30.094Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/count_3.4.7 b/src/go/tests/doc/out/count_3.4.7 new file mode 100644 index 00000000..1309138a --- /dev/null +++ b/src/go/tests/doc/out/count_3.4.7 @@ -0,0 +1,57 @@ +{ + "op" : "command", + "ns" : "test.coll", + "command" : { + "count" : "coll", + "query" : { + + }, + "fields" : { + + } + }, + "keysExamined" : 0, + "docsExamined" : 0, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(2) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "r" : NumberLong(1) + } + } + }, + "responseLength" : 29, + "protocol" : "op_command", + "millis" : 0, + "planSummary" : "COUNT", + "execStats" : { + "stage" : "COUNT", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 1, + "advanced" : 0, + "needTime" : 0, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "nCounted" : 20, + "nSkipped" : 0 + }, + "ts" : ISODate("2017-08-20T15:39:36.897Z"), + "client" : "127.0.0.1", + "appName" : "MongoDB Shell", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/count_3.5.11 b/src/go/tests/doc/out/count_3.5.11 new file mode 100644 index 00000000..61458ff1 --- /dev/null +++ b/src/go/tests/doc/out/count_3.5.11 @@ -0,0 +1,58 @@ +{ + "op" : "command", + "ns" : "test.coll", + "command" : { + "count" : "coll", + "query" : { + + }, + "fields" : { + + }, + "$db" : "test" + }, + "keysExamined" : 0, + "docsExamined" : 0, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(2) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "r" : NumberLong(1) + } + } + }, + "responseLength" : 29, + "protocol" : "op_msg", + "millis" : 0, + "planSummary" : "COUNT", + "execStats" : { + "stage" : "COUNT", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 1, + "advanced" : 0, + "needTime" : 0, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "nCounted" : 20, + "nSkipped" : 0 + }, + "ts" : ISODate("2017-08-20T15:39:47.396Z"), + "client" : "127.0.0.1", + "appName" : "MongoDB Shell", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/count_with_query_2.6.12 b/src/go/tests/doc/out/count_with_query_2.6.12 new file mode 100644 index 00000000..d20bab68 --- /dev/null +++ b/src/go/tests/doc/out/count_with_query_2.6.12 @@ -0,0 +1,36 @@ +{ + "op" : "command", + "ns" : "test.$cmd", + "command" : { + "count" : "coll", + "query" : { + "a" : { + "$gt" : 5 + } + }, + "fields" : { + + } + }, + "keyUpdates" : 0, + "numYield" : 0, + "lockStats" : { + "timeLockedMicros" : { + "r" : NumberLong(131), + "w" : NumberLong(0) + }, + "timeAcquiringMicros" : { + "r" : NumberLong(3), + "w" : NumberLong(4) + } + }, + "responseLength" : 48, + "millis" : 0, + "execStats" : { + + }, + "ts" : ISODate("2017-08-20T15:39:14.971Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/count_with_query_3.0.15 b/src/go/tests/doc/out/count_with_query_3.0.15 new file mode 100644 index 00000000..fe86634a --- /dev/null +++ b/src/go/tests/doc/out/count_with_query_3.0.15 @@ -0,0 +1,49 @@ +{ + "op" : "command", + "ns" : "test.$cmd", + "command" : { + "count" : "coll", + "query" : { + "a" : { + "$gt" : 5 + } + }, + "fields" : { + + } + }, + "keyUpdates" : 0, + "writeConflicts" : 0, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(2) + } + }, + "MMAPV1Journal" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "R" : NumberLong(1) + } + } + }, + "responseLength" : 44, + "millis" : 0, + "execStats" : { + + }, + "ts" : ISODate("2017-08-20T15:39:21.124Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/count_with_query_3.2.16 b/src/go/tests/doc/out/count_with_query_3.2.16 new file mode 100644 index 00000000..852e8afe --- /dev/null +++ b/src/go/tests/doc/out/count_with_query_3.2.16 @@ -0,0 +1,45 @@ +{ + "op" : "command", + "ns" : "test.coll", + "command" : { + "count" : "coll", + "query" : { + "a" : { + "$gt" : 5 + } + }, + "fields" : { + + } + }, + "keyUpdates" : 0, + "writeConflicts" : 0, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(2) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "r" : NumberLong(1) + } + } + }, + "responseLength" : 47, + "protocol" : "op_command", + "millis" : 0, + "execStats" : { + + }, + "ts" : ISODate("2017-08-20T15:39:30.251Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/count_with_query_3.4.7 b/src/go/tests/doc/out/count_with_query_3.4.7 new file mode 100644 index 00000000..5bdc59ff --- /dev/null +++ b/src/go/tests/doc/out/count_with_query_3.4.7 @@ -0,0 +1,95 @@ +{ + "op" : "command", + "ns" : "test.coll", + "command" : { + "count" : "coll", + "query" : { + "a" : { + "$gt" : 5 + } + }, + "fields" : { + + } + }, + "keysExamined" : 13, + "docsExamined" : 0, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(2) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "r" : NumberLong(1) + } + } + }, + "responseLength" : 29, + "protocol" : "op_command", + "millis" : 0, + "planSummary" : "COUNT_SCAN { a: 1 }", + "execStats" : { + "stage" : "COUNT", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 13, + "advanced" : 0, + "needTime" : 12, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "nCounted" : 12, + "nSkipped" : 0, + "inputStage" : { + "stage" : "COUNT_SCAN", + "nReturned" : 12, + "executionTimeMillisEstimate" : 0, + "works" : 13, + "advanced" : 12, + "needTime" : 0, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "keysExamined" : 13, + "keyPattern" : { + "a" : 1 + }, + "indexName" : "a_1", + "isMultiKey" : false, + "multiKeyPaths" : { + "a" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "indexBounds" : { + "startKey" : { + "a" : 5 + }, + "startKeyInclusive" : false, + "endKey" : { + "a" : Infinity + }, + "endKeyInclusive" : true + } + } + }, + "ts" : ISODate("2017-08-20T15:39:37.077Z"), + "client" : "127.0.0.1", + "appName" : "MongoDB Shell", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/count_with_query_3.5.11 b/src/go/tests/doc/out/count_with_query_3.5.11 new file mode 100644 index 00000000..e7c3d455 --- /dev/null +++ b/src/go/tests/doc/out/count_with_query_3.5.11 @@ -0,0 +1,96 @@ +{ + "op" : "command", + "ns" : "test.coll", + "command" : { + "count" : "coll", + "query" : { + "a" : { + "$gt" : 5 + } + }, + "fields" : { + + }, + "$db" : "test" + }, + "keysExamined" : 13, + "docsExamined" : 0, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(2) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "r" : NumberLong(1) + } + } + }, + "responseLength" : 29, + "protocol" : "op_msg", + "millis" : 0, + "planSummary" : "COUNT_SCAN { a: 1 }", + "execStats" : { + "stage" : "COUNT", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 13, + "advanced" : 0, + "needTime" : 12, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "nCounted" : 12, + "nSkipped" : 0, + "inputStage" : { + "stage" : "COUNT_SCAN", + "nReturned" : 12, + "executionTimeMillisEstimate" : 0, + "works" : 13, + "advanced" : 12, + "needTime" : 0, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "keysExamined" : 13, + "keyPattern" : { + "a" : 1 + }, + "indexName" : "a_1", + "isMultiKey" : false, + "multiKeyPaths" : { + "a" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "indexBounds" : { + "startKey" : { + "a" : 5 + }, + "startKeyInclusive" : false, + "endKey" : { + "a" : Infinity + }, + "endKeyInclusive" : true + } + } + }, + "ts" : ISODate("2017-08-20T15:39:47.573Z"), + "client" : "127.0.0.1", + "appName" : "MongoDB Shell", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/delete_2.6.12 b/src/go/tests/doc/out/delete_2.6.12 new file mode 100644 index 00000000..8546bd8c --- /dev/null +++ b/src/go/tests/doc/out/delete_2.6.12 @@ -0,0 +1,33 @@ +{ + "op" : "remove", + "ns" : "test.coll", + "query" : { + "a" : { + "$gte" : 2 + }, + "b" : { + "$gte" : 2 + } + }, + "ndeleted" : 1, + "keyUpdates" : 0, + "numYield" : 0, + "lockStats" : { + "timeLockedMicros" : { + "r" : NumberLong(0), + "w" : NumberLong(182) + }, + "timeAcquiringMicros" : { + "r" : NumberLong(0), + "w" : NumberLong(4) + } + }, + "millis" : 0, + "execStats" : { + + }, + "ts" : ISODate("2017-08-20T15:39:15.126Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/delete_3.0.15 b/src/go/tests/doc/out/delete_3.0.15 new file mode 100644 index 00000000..f9c6426a --- /dev/null +++ b/src/go/tests/doc/out/delete_3.0.15 @@ -0,0 +1,47 @@ +{ + "op" : "remove", + "ns" : "test.coll", + "query" : { + "a" : { + "$gte" : 2 + }, + "b" : { + "$gte" : 2 + } + }, + "ndeleted" : 1, + "keyUpdates" : 0, + "writeConflicts" : 0, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(1), + "w" : NumberLong(1) + } + }, + "MMAPV1Journal" : { + "acquireCount" : { + "w" : NumberLong(2) + } + }, + "Database" : { + "acquireCount" : { + "w" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "W" : NumberLong(1) + } + } + }, + "millis" : 0, + "execStats" : { + + }, + "ts" : ISODate("2017-08-20T15:39:21.265Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/delete_3.2.16 b/src/go/tests/doc/out/delete_3.2.16 new file mode 100644 index 00000000..a04ce599 --- /dev/null +++ b/src/go/tests/doc/out/delete_3.2.16 @@ -0,0 +1,42 @@ +{ + "op" : "remove", + "ns" : "test.coll", + "query" : { + "a" : { + "$gte" : 2 + }, + "b" : { + "$gte" : 2 + } + }, + "ndeleted" : 1, + "keyUpdates" : 0, + "writeConflicts" : 0, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(1), + "w" : NumberLong(1) + } + }, + "Database" : { + "acquireCount" : { + "w" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "w" : NumberLong(1) + } + } + }, + "millis" : 1, + "execStats" : { + + }, + "ts" : ISODate("2017-08-20T15:39:30.543Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/delete_3.4.7 b/src/go/tests/doc/out/delete_3.4.7 new file mode 100644 index 00000000..9a253d6e --- /dev/null +++ b/src/go/tests/doc/out/delete_3.4.7 @@ -0,0 +1,113 @@ +{ + "op" : "remove", + "ns" : "test.coll", + "query" : { + "a" : { + "$gte" : 2 + }, + "b" : { + "$gte" : 2 + } + }, + "keysExamined" : 4, + "docsExamined" : 4, + "ndeleted" : 1, + "keysDeleted" : 2, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(1), + "w" : NumberLong(1) + } + }, + "Database" : { + "acquireCount" : { + "w" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "w" : NumberLong(1) + } + } + }, + "millis" : 0, + "planSummary" : "IXSCAN { a: 1 }", + "execStats" : { + "stage" : "DELETE", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "nWouldDelete" : 1, + "nInvalidateSkips" : 0, + "inputStage" : { + "stage" : "FETCH", + "filter" : { + "b" : { + "$gte" : 2 + } + }, + "nReturned" : 1, + "executionTimeMillisEstimate" : 0, + "works" : 4, + "advanced" : 1, + "needTime" : 3, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 0, + "invalidates" : 0, + "docsExamined" : 4, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 4, + "executionTimeMillisEstimate" : 0, + "works" : 4, + "advanced" : 4, + "needTime" : 0, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 0, + "invalidates" : 0, + "keyPattern" : { + "a" : 1 + }, + "indexName" : "a_1", + "isMultiKey" : false, + "multiKeyPaths" : { + "a" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "a" : [ + "[2.0, inf.0]" + ] + }, + "keysExamined" : 4, + "seeks" : 1, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + } + }, + "ts" : ISODate("2017-08-20T15:39:37.279Z"), + "client" : "127.0.0.1", + "appName" : "MongoDB Shell", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/delete_3.5.11 b/src/go/tests/doc/out/delete_3.5.11 new file mode 100644 index 00000000..6c09b73d --- /dev/null +++ b/src/go/tests/doc/out/delete_3.5.11 @@ -0,0 +1,116 @@ +{ + "op" : "remove", + "ns" : "test.coll", + "command" : { + "q" : { + "a" : { + "$gte" : 2 + }, + "b" : { + "$gte" : 2 + } + }, + "limit" : 1 + }, + "keysExamined" : 4, + "docsExamined" : 4, + "ndeleted" : 1, + "keysDeleted" : 2, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(1), + "w" : NumberLong(1) + } + }, + "Database" : { + "acquireCount" : { + "w" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "w" : NumberLong(1) + } + } + }, + "millis" : 0, + "planSummary" : "IXSCAN { a: 1 }", + "execStats" : { + "stage" : "DELETE", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "nWouldDelete" : 1, + "nInvalidateSkips" : 0, + "inputStage" : { + "stage" : "FETCH", + "filter" : { + "b" : { + "$gte" : 2 + } + }, + "nReturned" : 1, + "executionTimeMillisEstimate" : 0, + "works" : 4, + "advanced" : 1, + "needTime" : 3, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 0, + "invalidates" : 0, + "docsExamined" : 4, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 4, + "executionTimeMillisEstimate" : 0, + "works" : 4, + "advanced" : 4, + "needTime" : 0, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 0, + "invalidates" : 0, + "keyPattern" : { + "a" : 1 + }, + "indexName" : "a_1", + "isMultiKey" : false, + "multiKeyPaths" : { + "a" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "a" : [ + "[2.0, inf.0]" + ] + }, + "keysExamined" : 4, + "seeks" : 1, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + } + }, + "ts" : ISODate("2017-08-20T15:39:47.745Z"), + "client" : "127.0.0.1", + "appName" : "MongoDB Shell", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/distinct_2.6.12 b/src/go/tests/doc/out/distinct_2.6.12 new file mode 100644 index 00000000..e7df47a7 --- /dev/null +++ b/src/go/tests/doc/out/distinct_2.6.12 @@ -0,0 +1,34 @@ +{ + "op" : "command", + "ns" : "test.$cmd", + "command" : { + "distinct" : "coll", + "key" : "a", + "query" : { + "b" : { + "$gte" : 5 + } + } + }, + "keyUpdates" : 0, + "numYield" : 0, + "lockStats" : { + "timeLockedMicros" : { + "r" : NumberLong(250), + "w" : NumberLong(0) + }, + "timeAcquiringMicros" : { + "r" : NumberLong(2), + "w" : NumberLong(3) + } + }, + "responseLength" : 254, + "millis" : 0, + "execStats" : { + + }, + "ts" : ISODate("2017-08-20T15:39:15.323Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/distinct_3.0.15 b/src/go/tests/doc/out/distinct_3.0.15 new file mode 100644 index 00000000..955ab924 --- /dev/null +++ b/src/go/tests/doc/out/distinct_3.0.15 @@ -0,0 +1,47 @@ +{ + "op" : "command", + "ns" : "test.$cmd", + "command" : { + "distinct" : "coll", + "key" : "a", + "query" : { + "b" : { + "$gte" : 5 + } + } + }, + "keyUpdates" : 0, + "writeConflicts" : 0, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(2) + } + }, + "MMAPV1Journal" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "R" : NumberLong(1) + } + } + }, + "responseLength" : 261, + "millis" : 0, + "execStats" : { + + }, + "ts" : ISODate("2017-08-20T15:39:21.392Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/distinct_3.2.16 b/src/go/tests/doc/out/distinct_3.2.16 new file mode 100644 index 00000000..474627cf --- /dev/null +++ b/src/go/tests/doc/out/distinct_3.2.16 @@ -0,0 +1,43 @@ +{ + "op" : "command", + "ns" : "test.coll", + "command" : { + "distinct" : "coll", + "key" : "a", + "query" : { + "b" : { + "$gte" : 5 + } + } + }, + "keyUpdates" : 0, + "writeConflicts" : 0, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(2) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "r" : NumberLong(1) + } + } + }, + "responseLength" : 264, + "protocol" : "op_command", + "millis" : 0, + "execStats" : { + + }, + "ts" : ISODate("2017-08-20T15:39:30.748Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/distinct_3.4.7 b/src/go/tests/doc/out/distinct_3.4.7 new file mode 100644 index 00000000..6de98b90 --- /dev/null +++ b/src/go/tests/doc/out/distinct_3.4.7 @@ -0,0 +1,93 @@ +{ + "op" : "command", + "ns" : "test.coll", + "command" : { + "distinct" : "coll", + "key" : "a", + "query" : { + "b" : { + "$gte" : 5 + } + } + }, + "keysExamined" : 10, + "docsExamined" : 10, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(2) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "r" : NumberLong(1) + } + } + }, + "responseLength" : 145, + "protocol" : "op_command", + "millis" : 0, + "planSummary" : "IXSCAN { b: 1 }", + "execStats" : { + "stage" : "FETCH", + "nReturned" : 10, + "executionTimeMillisEstimate" : 0, + "works" : 11, + "advanced" : 10, + "needTime" : 0, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 10, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 10, + "executionTimeMillisEstimate" : 0, + "works" : 11, + "advanced" : 10, + "needTime" : 0, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "b" : 1 + }, + "indexName" : "b_1", + "isMultiKey" : false, + "multiKeyPaths" : { + "b" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "b" : [ + "[5.0, inf.0]" + ] + }, + "keysExamined" : 10, + "seeks" : 1, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + "ts" : ISODate("2017-08-20T15:39:37.511Z"), + "client" : "127.0.0.1", + "appName" : "MongoDB Shell", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/distinct_3.5.11 b/src/go/tests/doc/out/distinct_3.5.11 new file mode 100644 index 00000000..a6144b56 --- /dev/null +++ b/src/go/tests/doc/out/distinct_3.5.11 @@ -0,0 +1,94 @@ +{ + "op" : "command", + "ns" : "test.coll", + "command" : { + "distinct" : "coll", + "key" : "a", + "query" : { + "b" : { + "$gte" : 5 + } + }, + "$db" : "test" + }, + "keysExamined" : 10, + "docsExamined" : 10, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(2) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "r" : NumberLong(1) + } + } + }, + "responseLength" : 145, + "protocol" : "op_msg", + "millis" : 0, + "planSummary" : "IXSCAN { b: 1 }", + "execStats" : { + "stage" : "FETCH", + "nReturned" : 10, + "executionTimeMillisEstimate" : 0, + "works" : 11, + "advanced" : 10, + "needTime" : 0, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 10, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 10, + "executionTimeMillisEstimate" : 0, + "works" : 11, + "advanced" : 10, + "needTime" : 0, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "b" : 1 + }, + "indexName" : "b_1", + "isMultiKey" : false, + "multiKeyPaths" : { + "b" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "b" : [ + "[5.0, inf.0]" + ] + }, + "keysExamined" : 10, + "seeks" : 1, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + "ts" : ISODate("2017-08-20T15:39:47.927Z"), + "client" : "127.0.0.1", + "appName" : "MongoDB Shell", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/find_2.6.12 b/src/go/tests/doc/out/find_2.6.12 new file mode 100644 index 00000000..6f9bc85f --- /dev/null +++ b/src/go/tests/doc/out/find_2.6.12 @@ -0,0 +1,67 @@ +{ + "op" : "query", + "ns" : "test.coll", + "query" : { + "a" : 1 + }, + "ntoreturn" : 0, + "ntoskip" : 0, + "nscanned" : 6, + "nscannedObjects" : 6, + "keyUpdates" : 0, + "numYield" : 0, + "lockStats" : { + "timeLockedMicros" : { + "r" : NumberLong(231), + "w" : NumberLong(0) + }, + "timeAcquiringMicros" : { + "r" : NumberLong(2), + "w" : NumberLong(26) + } + }, + "nreturned" : 6, + "responseLength" : 251, + "millis" : 0, + "execStats" : { + "type" : "FETCH", + "works" : 7, + "yields" : 0, + "unyields" : 0, + "invalidates" : 0, + "advanced" : 6, + "needTime" : 0, + "needFetch" : 0, + "isEOF" : 1, + "alreadyHasObj" : 0, + "forcedFetches" : 0, + "matchTested" : 0, + "children" : [ + { + "type" : "IXSCAN", + "works" : 7, + "yields" : 0, + "unyields" : 0, + "invalidates" : 0, + "advanced" : 6, + "needTime" : 0, + "needFetch" : 0, + "isEOF" : 1, + "keyPattern" : "{ a: 1.0 }", + "isMultiKey" : 0, + "boundsVerbose" : "field #0['a']: [1.0, 1.0]", + "yieldMovedCursor" : 0, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0, + "matchTested" : 0, + "keysExamined" : 6, + "children" : [ ] + } + ] + }, + "ts" : ISODate("2017-08-20T15:39:15.457Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/find_3.0.15 b/src/go/tests/doc/out/find_3.0.15 new file mode 100644 index 00000000..6549dad5 --- /dev/null +++ b/src/go/tests/doc/out/find_3.0.15 @@ -0,0 +1,87 @@ +{ + "op" : "query", + "ns" : "test.coll", + "query" : { + "a" : 1 + }, + "ntoreturn" : 0, + "ntoskip" : 0, + "nscanned" : 6, + "nscannedObjects" : 6, + "keyUpdates" : 0, + "writeConflicts" : 0, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(2) + } + }, + "MMAPV1Journal" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "R" : NumberLong(1) + } + } + }, + "nreturned" : 6, + "responseLength" : 251, + "millis" : 0, + "execStats" : { + "stage" : "FETCH", + "nReturned" : 6, + "executionTimeMillisEstimate" : 0, + "works" : 7, + "advanced" : 6, + "needTime" : 0, + "needFetch" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 6, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 6, + "executionTimeMillisEstimate" : 0, + "works" : 7, + "advanced" : 6, + "needTime" : 0, + "needFetch" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "a" : 1 + }, + "indexName" : "a_1", + "isMultiKey" : false, + "direction" : "forward", + "indexBounds" : { + "a" : [ + "[1.0, 1.0]" + ] + }, + "keysExamined" : 6, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0, + "matchTested" : 0 + } + }, + "ts" : ISODate("2017-08-20T15:39:21.515Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/find_3.2.16 b/src/go/tests/doc/out/find_3.2.16 new file mode 100644 index 00000000..fd84c5d1 --- /dev/null +++ b/src/go/tests/doc/out/find_3.2.16 @@ -0,0 +1,88 @@ +{ + "op" : "query", + "ns" : "test.coll", + "query" : { + "find" : "coll", + "filter" : { + "a" : 1 + } + }, + "keysExamined" : 6, + "docsExamined" : 6, + "cursorExhausted" : true, + "keyUpdates" : 0, + "writeConflicts" : 0, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(2) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "r" : NumberLong(1) + } + } + }, + "nreturned" : 6, + "responseLength" : 349, + "protocol" : "op_command", + "millis" : 0, + "execStats" : { + "stage" : "FETCH", + "nReturned" : 6, + "executionTimeMillisEstimate" : 0, + "works" : 7, + "advanced" : 6, + "needTime" : 0, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 6, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 6, + "executionTimeMillisEstimate" : 0, + "works" : 7, + "advanced" : 6, + "needTime" : 0, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "a" : 1 + }, + "indexName" : "a_1", + "isMultiKey" : false, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 1, + "direction" : "forward", + "indexBounds" : { + "a" : [ + "[1.0, 1.0]" + ] + }, + "keysExamined" : 6, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + "ts" : ISODate("2017-08-20T15:39:30.913Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/find_3.4.7 b/src/go/tests/doc/out/find_3.4.7 new file mode 100644 index 00000000..56512835 --- /dev/null +++ b/src/go/tests/doc/out/find_3.4.7 @@ -0,0 +1,92 @@ +{ + "op" : "query", + "ns" : "test.coll", + "query" : { + "find" : "coll", + "filter" : { + "a" : 1 + } + }, + "keysExamined" : 6, + "docsExamined" : 6, + "cursorExhausted" : true, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(2) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "r" : NumberLong(1) + } + } + }, + "nreturned" : 6, + "responseLength" : 331, + "protocol" : "op_command", + "millis" : 0, + "planSummary" : "IXSCAN { a: 1 }", + "execStats" : { + "stage" : "FETCH", + "nReturned" : 6, + "executionTimeMillisEstimate" : 0, + "works" : 7, + "advanced" : 6, + "needTime" : 0, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 6, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 6, + "executionTimeMillisEstimate" : 0, + "works" : 7, + "advanced" : 6, + "needTime" : 0, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "a" : 1 + }, + "indexName" : "a_1", + "isMultiKey" : false, + "multiKeyPaths" : { + "a" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "a" : [ + "[1.0, 1.0]" + ] + }, + "keysExamined" : 6, + "seeks" : 1, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + "ts" : ISODate("2017-08-20T15:39:37.660Z"), + "client" : "127.0.0.1", + "appName" : "MongoDB Shell", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/find_3.5.11 b/src/go/tests/doc/out/find_3.5.11 new file mode 100644 index 00000000..f81a7832 --- /dev/null +++ b/src/go/tests/doc/out/find_3.5.11 @@ -0,0 +1,93 @@ +{ + "op" : "query", + "ns" : "test.coll", + "command" : { + "find" : "coll", + "filter" : { + "a" : 1 + }, + "$db" : "test" + }, + "keysExamined" : 6, + "docsExamined" : 6, + "cursorExhausted" : true, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(2) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "r" : NumberLong(1) + } + } + }, + "nreturned" : 6, + "responseLength" : 331, + "protocol" : "op_msg", + "millis" : 1, + "planSummary" : "IXSCAN { a: 1 }", + "execStats" : { + "stage" : "FETCH", + "nReturned" : 6, + "executionTimeMillisEstimate" : 0, + "works" : 7, + "advanced" : 6, + "needTime" : 0, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 6, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 6, + "executionTimeMillisEstimate" : 0, + "works" : 7, + "advanced" : 6, + "needTime" : 0, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "a" : 1 + }, + "indexName" : "a_1", + "isMultiKey" : false, + "multiKeyPaths" : { + "a" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "a" : [ + "[1.0, 1.0]" + ] + }, + "keysExamined" : 6, + "seeks" : 1, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + "ts" : ISODate("2017-08-20T15:39:48.107Z"), + "client" : "127.0.0.1", + "appName" : "MongoDB Shell", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/find_andrii_2.6.12 b/src/go/tests/doc/out/find_andrii_2.6.12 new file mode 100644 index 00000000..eca32e6b --- /dev/null +++ b/src/go/tests/doc/out/find_andrii_2.6.12 @@ -0,0 +1,146 @@ +{ + "op" : "query", + "ns" : "test.coll", + "query" : { + "query" : { + "$and" : [ + { + "k" : { + "$gt" : 1 + } + }, + { + "k" : { + "$lt" : 2 + } + }, + { + "$or" : [ + { + "c" : { + "$in" : [ + /^0/, + /^2/, + /^4/, + /^6/ + ] + } + }, + { + "pad" : { + "$in" : [ + /9$/, + /7$/, + /5$/, + /3$/ + ] + } + } + ] + } + ] + }, + "orderby" : { + "k" : -1 + } + }, + "ntoreturn" : 100, + "ntoskip" : 0, + "nscanned" : 98, + "nscannedObjects" : 98, + "keyUpdates" : 0, + "numYield" : 0, + "lockStats" : { + "timeLockedMicros" : { + "r" : NumberLong(951), + "w" : NumberLong(0) + }, + "timeAcquiringMicros" : { + "r" : NumberLong(3), + "w" : NumberLong(2) + } + }, + "nreturned" : 0, + "responseLength" : 20, + "millis" : 0, + "execStats" : { + "type" : "OR", + "works" : 106, + "yields" : 0, + "unyields" : 0, + "invalidates" : 0, + "advanced" : 0, + "needTime" : 105, + "needFetch" : 0, + "isEOF" : 1, + "dupsTested" : 0, + "dupsDropped" : 0, + "locsForgotten" : 0, + "matchTested_0" : 0, + "matchTested_1" : 0, + "children" : [ + { + "type" : "SORT", + "works" : 53, + "yields" : 0, + "unyields" : 0, + "invalidates" : 0, + "advanced" : 0, + "needTime" : 51, + "needFetch" : 0, + "isEOF" : 1, + "forcedFetches" : 0, + "memUsage" : 0, + "memLimit" : 33554432, + "children" : [ + { + "type" : "COLLSCAN", + "works" : 51, + "yields" : 0, + "unyields" : 0, + "invalidates" : 0, + "advanced" : 0, + "needTime" : 50, + "needFetch" : 0, + "isEOF" : 1, + "docsTested" : 49, + "children" : [ ] + } + ] + }, + { + "type" : "SORT", + "works" : 53, + "yields" : 0, + "unyields" : 0, + "invalidates" : 0, + "advanced" : 0, + "needTime" : 51, + "needFetch" : 0, + "isEOF" : 1, + "forcedFetches" : 0, + "memUsage" : 0, + "memLimit" : 33554432, + "children" : [ + { + "type" : "COLLSCAN", + "works" : 51, + "yields" : 0, + "unyields" : 0, + "invalidates" : 0, + "advanced" : 0, + "needTime" : 50, + "needFetch" : 0, + "isEOF" : 1, + "docsTested" : 49, + "children" : [ ] + } + ] + } + ] + }, + "ts" : ISODate("2017-08-20T15:39:15.616Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/find_andrii_3.0.15 b/src/go/tests/doc/out/find_andrii_3.0.15 new file mode 100644 index 00000000..ece88829 --- /dev/null +++ b/src/go/tests/doc/out/find_andrii_3.0.15 @@ -0,0 +1,247 @@ +{ + "op" : "query", + "ns" : "test.coll", + "query" : { + "query" : { + "$and" : [ + { + "k" : { + "$gt" : 1 + } + }, + { + "k" : { + "$lt" : 2 + } + }, + { + "$or" : [ + { + "c" : { + "$in" : [ + /^0/, + /^2/, + /^4/, + /^6/ + ] + } + }, + { + "pad" : { + "$in" : [ + /9$/, + /7$/, + /5$/, + /3$/ + ] + } + } + ] + } + ] + }, + "orderby" : { + "k" : -1 + } + }, + "ntoreturn" : 100, + "ntoskip" : 0, + "nscanned" : 0, + "nscannedObjects" : 98, + "scanAndOrder" : true, + "keyUpdates" : 0, + "writeConflicts" : 0, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(2) + } + }, + "MMAPV1Journal" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "R" : NumberLong(1) + } + } + }, + "nreturned" : 0, + "responseLength" : 20, + "millis" : 0, + "execStats" : { + "stage" : "OR", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 106, + "advanced" : 0, + "needTime" : 105, + "needFetch" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "dupsTested" : 0, + "dupsDropped" : 0, + "locsForgotten" : 0, + "matchTested_0" : 0, + "matchTested_1" : 0, + "inputStages" : [ + { + "stage" : "SORT", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 53, + "advanced" : 0, + "needTime" : 51, + "needFetch" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "sortPattern" : { + "k" : -1 + }, + "memUsage" : 0, + "memLimit" : 33554432, + "limitAmount" : 100, + "inputStage" : { + "stage" : "COLLSCAN", + "filter" : { + "$and" : [ + { + "$or" : [ + { + "c" : { + "$in" : [ + /^0/, + /^2/, + /^4/, + /^6/ + ] + } + }, + { + "pad" : { + "$in" : [ + /9$/, + /7$/, + /5$/, + /3$/ + ] + } + } + ] + }, + { + "k" : { + "$lt" : 2 + } + }, + { + "k" : { + "$gt" : 1 + } + } + ] + }, + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 51, + "advanced" : 0, + "needTime" : 50, + "needFetch" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "direction" : "forward", + "docsExamined" : 49 + } + }, + { + "stage" : "SORT", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 53, + "advanced" : 0, + "needTime" : 51, + "needFetch" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "sortPattern" : { + "k" : -1 + }, + "memUsage" : 0, + "memLimit" : 33554432, + "inputStage" : { + "stage" : "COLLSCAN", + "filter" : { + "$and" : [ + { + "$or" : [ + { + "c" : { + "$in" : [ + /^0/, + /^2/, + /^4/, + /^6/ + ] + } + }, + { + "pad" : { + "$in" : [ + /9$/, + /7$/, + /5$/, + /3$/ + ] + } + } + ] + }, + { + "k" : { + "$lt" : 2 + } + }, + { + "k" : { + "$gt" : 1 + } + } + ] + }, + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 51, + "advanced" : 0, + "needTime" : 50, + "needFetch" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "direction" : "forward", + "docsExamined" : 49 + } + } + ] + }, + "ts" : ISODate("2017-08-20T15:39:21.656Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/find_andrii_3.2.16 b/src/go/tests/doc/out/find_andrii_3.2.16 new file mode 100644 index 00000000..91d6e62a --- /dev/null +++ b/src/go/tests/doc/out/find_andrii_3.2.16 @@ -0,0 +1,167 @@ +{ + "op" : "query", + "ns" : "test.coll", + "query" : { + "find" : "coll", + "filter" : { + "$and" : [ + { + "k" : { + "$gt" : 1 + } + }, + { + "k" : { + "$lt" : 2 + } + }, + { + "$or" : [ + { + "c" : { + "$in" : [ + /^0/, + /^2/, + /^4/, + /^6/ + ] + } + }, + { + "pad" : { + "$in" : [ + /9$/, + /7$/, + /5$/, + /3$/ + ] + } + } + ] + } + ] + }, + "limit" : 100, + "singleBatch" : false, + "sort" : { + "k" : -1 + } + }, + "keysExamined" : 0, + "docsExamined" : 49, + "hasSortStage" : true, + "cursorExhausted" : true, + "keyUpdates" : 0, + "writeConflicts" : 0, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(2) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "r" : NumberLong(1) + } + } + }, + "nreturned" : 0, + "responseLength" : 100, + "protocol" : "op_command", + "millis" : 0, + "execStats" : { + "stage" : "SORT", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 53, + "advanced" : 0, + "needTime" : 52, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "sortPattern" : { + "k" : -1 + }, + "memUsage" : 0, + "memLimit" : 33554432, + "limitAmount" : 100, + "inputStage" : { + "stage" : "SORT_KEY_GENERATOR", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 52, + "advanced" : 0, + "needTime" : 51, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "inputStage" : { + "stage" : "COLLSCAN", + "filter" : { + "$and" : [ + { + "$or" : [ + { + "c" : { + "$in" : [ + /^0/, + /^2/, + /^4/, + /^6/ + ] + } + }, + { + "pad" : { + "$in" : [ + /9$/, + /7$/, + /5$/, + /3$/ + ] + } + } + ] + }, + { + "k" : { + "$lt" : 2 + } + }, + { + "k" : { + "$gt" : 1 + } + } + ] + }, + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 51, + "advanced" : 0, + "needTime" : 50, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "direction" : "forward", + "docsExamined" : 49 + } + } + }, + "ts" : ISODate("2017-08-20T15:39:31.085Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/find_andrii_3.4.7 b/src/go/tests/doc/out/find_andrii_3.4.7 new file mode 100644 index 00000000..ba079ebd --- /dev/null +++ b/src/go/tests/doc/out/find_andrii_3.4.7 @@ -0,0 +1,167 @@ +{ + "op" : "query", + "ns" : "test.coll", + "query" : { + "find" : "coll", + "filter" : { + "$and" : [ + { + "k" : { + "$gt" : 1 + } + }, + { + "k" : { + "$lt" : 2 + } + }, + { + "$or" : [ + { + "c" : { + "$in" : [ + /^0/, + /^2/, + /^4/, + /^6/ + ] + } + }, + { + "pad" : { + "$in" : [ + /9$/, + /7$/, + /5$/, + /3$/ + ] + } + } + ] + } + ] + }, + "limit" : 100, + "singleBatch" : false, + "sort" : { + "k" : -1 + } + }, + "keysExamined" : 0, + "docsExamined" : 49, + "hasSortStage" : true, + "cursorExhausted" : true, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(2) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "r" : NumberLong(1) + } + } + }, + "nreturned" : 0, + "responseLength" : 82, + "protocol" : "op_command", + "millis" : 0, + "planSummary" : "COLLSCAN", + "execStats" : { + "stage" : "SORT", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 53, + "advanced" : 0, + "needTime" : 52, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "sortPattern" : { + "k" : -1 + }, + "memUsage" : 0, + "memLimit" : 33554432, + "limitAmount" : 100, + "inputStage" : { + "stage" : "SORT_KEY_GENERATOR", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 52, + "advanced" : 0, + "needTime" : 51, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "inputStage" : { + "stage" : "COLLSCAN", + "filter" : { + "$and" : [ + { + "$or" : [ + { + "c" : { + "$in" : [ + /^0/, + /^2/, + /^4/, + /^6/ + ] + } + }, + { + "pad" : { + "$in" : [ + /9$/, + /7$/, + /5$/, + /3$/ + ] + } + } + ] + }, + { + "k" : { + "$lt" : 2 + } + }, + { + "k" : { + "$gt" : 1 + } + } + ] + }, + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 51, + "advanced" : 0, + "needTime" : 50, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "direction" : "forward", + "docsExamined" : 49 + } + } + }, + "ts" : ISODate("2017-08-20T15:39:37.823Z"), + "client" : "127.0.0.1", + "appName" : "MongoDB Shell", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/find_andrii_3.5.11 b/src/go/tests/doc/out/find_andrii_3.5.11 new file mode 100644 index 00000000..b2a38573 --- /dev/null +++ b/src/go/tests/doc/out/find_andrii_3.5.11 @@ -0,0 +1,168 @@ +{ + "op" : "query", + "ns" : "test.coll", + "command" : { + "find" : "coll", + "filter" : { + "$and" : [ + { + "k" : { + "$gt" : 1 + } + }, + { + "k" : { + "$lt" : 2 + } + }, + { + "$or" : [ + { + "c" : { + "$in" : [ + /^0/, + /^2/, + /^4/, + /^6/ + ] + } + }, + { + "pad" : { + "$in" : [ + /9$/, + /7$/, + /5$/, + /3$/ + ] + } + } + ] + } + ] + }, + "limit" : 100, + "singleBatch" : false, + "sort" : { + "k" : -1 + }, + "$db" : "test" + }, + "keysExamined" : 0, + "docsExamined" : 49, + "hasSortStage" : true, + "cursorExhausted" : true, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(2) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "r" : NumberLong(1) + } + } + }, + "nreturned" : 0, + "responseLength" : 82, + "protocol" : "op_msg", + "millis" : 0, + "planSummary" : "COLLSCAN", + "execStats" : { + "stage" : "SORT", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 53, + "advanced" : 0, + "needTime" : 52, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "sortPattern" : { + "k" : -1 + }, + "memUsage" : 0, + "memLimit" : 33554432, + "limitAmount" : 100, + "inputStage" : { + "stage" : "SORT_KEY_GENERATOR", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 52, + "advanced" : 0, + "needTime" : 51, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "inputStage" : { + "stage" : "COLLSCAN", + "filter" : { + "$and" : [ + { + "$or" : [ + { + "c" : { + "$in" : [ + /^0/, + /^2/, + /^4/, + /^6/ + ] + } + }, + { + "pad" : { + "$in" : [ + /9$/, + /7$/, + /5$/, + /3$/ + ] + } + } + ] + }, + { + "k" : { + "$lt" : 2 + } + }, + { + "k" : { + "$gt" : 1 + } + } + ] + }, + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 51, + "advanced" : 0, + "needTime" : 50, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "direction" : "forward", + "docsExamined" : 49 + } + } + }, + "ts" : ISODate("2017-08-20T15:39:48.277Z"), + "client" : "127.0.0.1", + "appName" : "MongoDB Shell", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/find_empty_2.6.12 b/src/go/tests/doc/out/find_empty_2.6.12 new file mode 100644 index 00000000..3d3a4728 --- /dev/null +++ b/src/go/tests/doc/out/find_empty_2.6.12 @@ -0,0 +1,43 @@ +{ + "op" : "query", + "ns" : "test.coll", + "query" : { + + }, + "ntoreturn" : 0, + "ntoskip" : 0, + "nscanned" : 49, + "nscannedObjects" : 49, + "keyUpdates" : 0, + "numYield" : 0, + "lockStats" : { + "timeLockedMicros" : { + "r" : NumberLong(65), + "w" : NumberLong(0) + }, + "timeAcquiringMicros" : { + "r" : NumberLong(9), + "w" : NumberLong(2) + } + }, + "nreturned" : 49, + "responseLength" : 1846, + "millis" : 0, + "execStats" : { + "type" : "COLLSCAN", + "works" : 51, + "yields" : 0, + "unyields" : 0, + "invalidates" : 0, + "advanced" : 49, + "needTime" : 1, + "needFetch" : 0, + "isEOF" : 1, + "docsTested" : 49, + "children" : [ ] + }, + "ts" : ISODate("2017-08-20T15:39:15.750Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/find_empty_3.0.15 b/src/go/tests/doc/out/find_empty_3.0.15 new file mode 100644 index 00000000..9747461d --- /dev/null +++ b/src/go/tests/doc/out/find_empty_3.0.15 @@ -0,0 +1,61 @@ +{ + "op" : "query", + "ns" : "test.coll", + "query" : { + + }, + "ntoreturn" : 0, + "ntoskip" : 0, + "nscanned" : 0, + "nscannedObjects" : 49, + "keyUpdates" : 0, + "writeConflicts" : 0, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(2) + } + }, + "MMAPV1Journal" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "R" : NumberLong(1) + } + } + }, + "nreturned" : 49, + "responseLength" : 1846, + "millis" : 0, + "execStats" : { + "stage" : "COLLSCAN", + "filter" : { + "$and" : [ ] + }, + "nReturned" : 49, + "executionTimeMillisEstimate" : 0, + "works" : 51, + "advanced" : 49, + "needTime" : 1, + "needFetch" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "direction" : "forward", + "docsExamined" : 49 + }, + "ts" : ISODate("2017-08-20T15:39:21.769Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/find_empty_3.2.16 b/src/go/tests/doc/out/find_empty_3.2.16 new file mode 100644 index 00000000..9d953ee0 --- /dev/null +++ b/src/go/tests/doc/out/find_empty_3.2.16 @@ -0,0 +1,59 @@ +{ + "op" : "query", + "ns" : "test.coll", + "query" : { + "find" : "coll", + "filter" : { + + } + }, + "keysExamined" : 0, + "docsExamined" : 49, + "cursorExhausted" : true, + "keyUpdates" : 0, + "writeConflicts" : 0, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(2) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "r" : NumberLong(1) + } + } + }, + "nreturned" : 49, + "responseLength" : 2112, + "protocol" : "op_command", + "millis" : 0, + "execStats" : { + "stage" : "COLLSCAN", + "filter" : { + "$and" : [ ] + }, + "nReturned" : 49, + "executionTimeMillisEstimate" : 0, + "works" : 51, + "advanced" : 49, + "needTime" : 1, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "direction" : "forward", + "docsExamined" : 49 + }, + "ts" : ISODate("2017-08-20T15:39:31.294Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/find_empty_3.4.7 b/src/go/tests/doc/out/find_empty_3.4.7 new file mode 100644 index 00000000..09699967 --- /dev/null +++ b/src/go/tests/doc/out/find_empty_3.4.7 @@ -0,0 +1,56 @@ +{ + "op" : "query", + "ns" : "test.coll", + "query" : { + "find" : "coll", + "filter" : { + + } + }, + "keysExamined" : 0, + "docsExamined" : 49, + "cursorExhausted" : true, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(2) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "r" : NumberLong(1) + } + } + }, + "nreturned" : 49, + "responseLength" : 2094, + "protocol" : "op_command", + "millis" : 0, + "planSummary" : "COLLSCAN", + "execStats" : { + "stage" : "COLLSCAN", + "nReturned" : 49, + "executionTimeMillisEstimate" : 0, + "works" : 51, + "advanced" : 49, + "needTime" : 1, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "direction" : "forward", + "docsExamined" : 49 + }, + "ts" : ISODate("2017-08-20T15:39:37.964Z"), + "client" : "127.0.0.1", + "appName" : "MongoDB Shell", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/find_empty_3.5.11 b/src/go/tests/doc/out/find_empty_3.5.11 new file mode 100644 index 00000000..608637f7 --- /dev/null +++ b/src/go/tests/doc/out/find_empty_3.5.11 @@ -0,0 +1,57 @@ +{ + "op" : "query", + "ns" : "test.coll", + "command" : { + "find" : "coll", + "filter" : { + + }, + "$db" : "test" + }, + "keysExamined" : 0, + "docsExamined" : 49, + "cursorExhausted" : true, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(2) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "r" : NumberLong(1) + } + } + }, + "nreturned" : 49, + "responseLength" : 2094, + "protocol" : "op_msg", + "millis" : 0, + "planSummary" : "COLLSCAN", + "execStats" : { + "stage" : "COLLSCAN", + "nReturned" : 49, + "executionTimeMillisEstimate" : 0, + "works" : 51, + "advanced" : 49, + "needTime" : 1, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "direction" : "forward", + "docsExamined" : 49 + }, + "ts" : ISODate("2017-08-20T15:39:48.429Z"), + "client" : "127.0.0.1", + "appName" : "MongoDB Shell", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/findandmodify_2.6.12 b/src/go/tests/doc/out/findandmodify_2.6.12 new file mode 100644 index 00000000..ee7a4657 --- /dev/null +++ b/src/go/tests/doc/out/findandmodify_2.6.12 @@ -0,0 +1,45 @@ +{ + "op" : "command", + "ns" : "test.$cmd", + "command" : { + "findandmodify" : "coll", + "query" : { + "a" : 2 + }, + "update" : { + "$inc" : { + "b" : 1 + } + } + }, + "updateobj" : { + "$inc" : { + "b" : 1 + } + }, + "nscanned" : 1, + "nscannedObjects" : 1, + "nMatched" : 1, + "nModified" : 1, + "keyUpdates" : 1, + "numYield" : 0, + "lockStats" : { + "timeLockedMicros" : { + "r" : NumberLong(0), + "w" : NumberLong(155) + }, + "timeAcquiringMicros" : { + "r" : NumberLong(0), + "w" : NumberLong(5) + } + }, + "responseLength" : 131, + "millis" : 0, + "execStats" : { + + }, + "ts" : ISODate("2017-08-20T15:39:15.903Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/findandmodify_3.0.15 b/src/go/tests/doc/out/findandmodify_3.0.15 new file mode 100644 index 00000000..8d5a3ea0 --- /dev/null +++ b/src/go/tests/doc/out/findandmodify_3.0.15 @@ -0,0 +1,59 @@ +{ + "op" : "command", + "ns" : "test.$cmd", + "command" : { + "findandmodify" : "coll", + "query" : { + "a" : 2 + }, + "update" : { + "$inc" : { + "b" : 1 + } + } + }, + "updateobj" : { + "$inc" : { + "b" : 1 + } + }, + "nscanned" : 1, + "nscannedObjects" : 1, + "nMatched" : 1, + "nModified" : 1, + "keyUpdates" : 1, + "writeConflicts" : 0, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(1), + "w" : NumberLong(1) + } + }, + "MMAPV1Journal" : { + "acquireCount" : { + "w" : NumberLong(2) + } + }, + "Database" : { + "acquireCount" : { + "w" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "W" : NumberLong(1) + } + } + }, + "responseLength" : 131, + "millis" : 0, + "execStats" : { + + }, + "ts" : ISODate("2017-08-20T15:39:21.902Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/findandmodify_3.2.16 b/src/go/tests/doc/out/findandmodify_3.2.16 new file mode 100644 index 00000000..62a5c07e --- /dev/null +++ b/src/go/tests/doc/out/findandmodify_3.2.16 @@ -0,0 +1,55 @@ +{ + "op" : "command", + "ns" : "test.coll", + "command" : { + "findandmodify" : "coll", + "query" : { + "a" : 2 + }, + "update" : { + "$inc" : { + "b" : 1 + } + } + }, + "updateobj" : { + "$inc" : { + "b" : 1 + } + }, + "keysExamined" : 0, + "docsExamined" : 3, + "nMatched" : 1, + "nModified" : 1, + "keyUpdates" : 1, + "writeConflicts" : 0, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(1), + "w" : NumberLong(1) + } + }, + "Database" : { + "acquireCount" : { + "w" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "w" : NumberLong(1) + } + } + }, + "responseLength" : 116, + "protocol" : "op_command", + "millis" : 0, + "execStats" : { + + }, + "ts" : ISODate("2017-08-20T15:39:31.548Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/findandmodify_3.4.7 b/src/go/tests/doc/out/findandmodify_3.4.7 new file mode 100644 index 00000000..88c74ca4 --- /dev/null +++ b/src/go/tests/doc/out/findandmodify_3.4.7 @@ -0,0 +1,92 @@ +{ + "op" : "command", + "ns" : "test.coll", + "command" : { + "findandmodify" : "coll", + "query" : { + "a" : 2 + }, + "update" : { + "$inc" : { + "b" : 1 + } + } + }, + "updateobj" : { + "$inc" : { + "b" : 1 + } + }, + "keysExamined" : 0, + "docsExamined" : 3, + "nMatched" : 1, + "nModified" : 1, + "keysInserted" : 1, + "keysDeleted" : 1, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(1), + "w" : NumberLong(1) + } + }, + "Database" : { + "acquireCount" : { + "w" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "w" : NumberLong(1) + } + } + }, + "responseLength" : 116, + "protocol" : "op_command", + "millis" : 0, + "planSummary" : "COLLSCAN", + "execStats" : { + "stage" : "UPDATE", + "nReturned" : 1, + "executionTimeMillisEstimate" : 0, + "works" : 4, + "advanced" : 1, + "needTime" : 3, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "nMatched" : 1, + "nWouldModify" : 1, + "nInvalidateSkips" : 0, + "wouldInsert" : false, + "fastmodinsert" : false, + "inputStage" : { + "stage" : "COLLSCAN", + "filter" : { + "a" : { + "$eq" : 2 + } + }, + "nReturned" : 1, + "executionTimeMillisEstimate" : 0, + "works" : 4, + "advanced" : 1, + "needTime" : 3, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 0, + "invalidates" : 0, + "direction" : "forward", + "docsExamined" : 3 + } + }, + "ts" : ISODate("2017-08-20T15:39:38.196Z"), + "client" : "127.0.0.1", + "appName" : "MongoDB Shell", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/findandmodify_3.5.11 b/src/go/tests/doc/out/findandmodify_3.5.11 new file mode 100644 index 00000000..93c970ef --- /dev/null +++ b/src/go/tests/doc/out/findandmodify_3.5.11 @@ -0,0 +1,88 @@ +{ + "op" : "command", + "ns" : "test.coll", + "command" : { + "findandmodify" : "coll", + "query" : { + "a" : 2 + }, + "update" : { + "$inc" : { + "b" : 1 + } + }, + "$db" : "test" + }, + "keysExamined" : 0, + "docsExamined" : 3, + "nMatched" : 1, + "nModified" : 1, + "keysInserted" : 1, + "keysDeleted" : 1, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(1), + "w" : NumberLong(1) + } + }, + "Database" : { + "acquireCount" : { + "w" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "w" : NumberLong(1) + } + } + }, + "responseLength" : 116, + "protocol" : "op_msg", + "millis" : 0, + "planSummary" : "COLLSCAN", + "execStats" : { + "stage" : "UPDATE", + "nReturned" : 1, + "executionTimeMillisEstimate" : 0, + "works" : 4, + "advanced" : 1, + "needTime" : 3, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "nMatched" : 1, + "nWouldModify" : 1, + "nInvalidateSkips" : 0, + "wouldInsert" : false, + "fastmodinsert" : false, + "inputStage" : { + "stage" : "COLLSCAN", + "filter" : { + "a" : { + "$eq" : 2 + } + }, + "nReturned" : 1, + "executionTimeMillisEstimate" : 0, + "works" : 4, + "advanced" : 1, + "needTime" : 3, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 0, + "invalidates" : 0, + "direction" : "forward", + "docsExamined" : 3 + } + }, + "ts" : ISODate("2017-08-20T15:39:48.636Z"), + "client" : "127.0.0.1", + "appName" : "MongoDB Shell", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/geonear_2.6.12 b/src/go/tests/doc/out/geonear_2.6.12 new file mode 100644 index 00000000..1d63c6e5 --- /dev/null +++ b/src/go/tests/doc/out/geonear_2.6.12 @@ -0,0 +1,36 @@ +{ + "op" : "command", + "ns" : "test.$cmd", + "command" : { + "geoNear" : "coll", + "near" : { + "type" : "Point", + "coordinates" : [ + 1, + 1 + ] + }, + "spherical" : true + }, + "keyUpdates" : 0, + "numYield" : 0, + "lockStats" : { + "timeLockedMicros" : { + "r" : NumberLong(1851), + "w" : NumberLong(0) + }, + "timeAcquiringMicros" : { + "r" : NumberLong(3), + "w" : NumberLong(3) + } + }, + "responseLength" : 1406, + "millis" : 1, + "execStats" : { + + }, + "ts" : ISODate("2017-08-20T15:39:16.061Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/geonear_3.0.15 b/src/go/tests/doc/out/geonear_3.0.15 new file mode 100644 index 00000000..236a1e58 --- /dev/null +++ b/src/go/tests/doc/out/geonear_3.0.15 @@ -0,0 +1,49 @@ +{ + "op" : "command", + "ns" : "test.$cmd", + "command" : { + "geoNear" : "coll", + "near" : { + "type" : "Point", + "coordinates" : [ + 1, + 1 + ] + }, + "spherical" : true + }, + "keyUpdates" : 0, + "writeConflicts" : 0, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(2) + } + }, + "MMAPV1Journal" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "R" : NumberLong(1) + } + } + }, + "responseLength" : 1398, + "millis" : 3, + "execStats" : { + + }, + "ts" : ISODate("2017-08-20T15:39:22.055Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/geonear_3.2.16 b/src/go/tests/doc/out/geonear_3.2.16 new file mode 100644 index 00000000..08279c1b --- /dev/null +++ b/src/go/tests/doc/out/geonear_3.2.16 @@ -0,0 +1,45 @@ +{ + "op" : "command", + "ns" : "test.coll", + "command" : { + "geoNear" : "coll", + "near" : { + "type" : "Point", + "coordinates" : [ + 1, + 1 + ] + }, + "spherical" : true + }, + "keyUpdates" : 0, + "writeConflicts" : 0, + "numYield" : 1, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(4) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(2) + } + }, + "Collection" : { + "acquireCount" : { + "r" : NumberLong(2) + } + } + }, + "responseLength" : 1401, + "protocol" : "op_command", + "millis" : 8, + "execStats" : { + + }, + "ts" : ISODate("2017-08-20T15:39:31.797Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/geonear_3.4.7 b/src/go/tests/doc/out/geonear_3.4.7 new file mode 100644 index 00000000..574ae61a --- /dev/null +++ b/src/go/tests/doc/out/geonear_3.4.7 @@ -0,0 +1,3565 @@ +{ + "op" : "command", + "ns" : "test.coll", + "command" : { + "geoNear" : "coll", + "near" : { + "type" : "Point", + "coordinates" : [ + 1, + 1 + ] + }, + "spherical" : true + }, + "keysExamined" : 82, + "docsExamined" : 10, + "numYield" : 1, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(4) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(2) + } + }, + "Collection" : { + "acquireCount" : { + "r" : NumberLong(2) + } + } + }, + "responseLength" : 1383, + "protocol" : "op_command", + "millis" : 11, + "planSummary" : "GEO_NEAR_2DSPHERE { loc: \"2dsphere\" }", + "execStats" : { + "stage" : "LIMIT", + "nReturned" : 10, + "executionTimeMillisEstimate" : 0, + "works" : 139, + "advanced" : 10, + "needTime" : 128, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "limitAmount" : 100, + "inputStage" : { + "stage" : "PROJECTION", + "nReturned" : 10, + "executionTimeMillisEstimate" : 0, + "works" : 139, + "advanced" : 10, + "needTime" : 128, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "transformBy" : { + "$pt" : { + "$meta" : "geoNearPoint" + }, + "$dis" : { + "$meta" : "geoNearDistance" + } + }, + "inputStage" : { + "stage" : "GEO_NEAR_2DSPHERE", + "nReturned" : 10, + "executionTimeMillisEstimate" : 0, + "works" : 139, + "advanced" : 10, + "needTime" : 128, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "indexVersion" : 2, + "searchIntervals" : [ + { + "minDistance" : 0, + "maxDistance" : 3.3284465774864755, + "maxInclusive" : false, + "nBuffered" : 1, + "nReturned" : 1 + }, + { + "minDistance" : 3.3284465774864755, + "maxDistance" : 9.985339732459426, + "maxInclusive" : false, + "nBuffered" : 0, + "nReturned" : 0 + }, + { + "minDistance" : 9.985339732459426, + "maxDistance" : 23.299126042405327, + "maxInclusive" : false, + "nBuffered" : 0, + "nReturned" : 0 + }, + { + "minDistance" : 23.299126042405327, + "maxDistance" : 49.92669866229713, + "maxInclusive" : false, + "nBuffered" : 0, + "nReturned" : 0 + }, + { + "minDistance" : 49.92669866229713, + "maxDistance" : 103.18184390208074, + "maxInclusive" : false, + "nBuffered" : 0, + "nReturned" : 0 + }, + { + "minDistance" : 103.18184390208074, + "maxDistance" : 209.69213438164797, + "maxInclusive" : false, + "nBuffered" : 0, + "nReturned" : 0 + }, + { + "minDistance" : 209.69213438164797, + "maxDistance" : 422.71271534078244, + "maxInclusive" : false, + "nBuffered" : 0, + "nReturned" : 0 + }, + { + "minDistance" : 422.71271534078244, + "maxDistance" : 848.7538772590513, + "maxInclusive" : false, + "nBuffered" : 0, + "nReturned" : 0 + }, + { + "minDistance" : 848.7538772590513, + "maxDistance" : 1700.8362010955889, + "maxInclusive" : false, + "nBuffered" : 0, + "nReturned" : 0 + }, + { + "minDistance" : 1700.8362010955889, + "maxDistance" : 3405.0008487686646, + "maxInclusive" : false, + "nBuffered" : 0, + "nReturned" : 0 + }, + { + "minDistance" : 3405.0008487686646, + "maxDistance" : 6813.330144114816, + "maxInclusive" : false, + "nBuffered" : 0, + "nReturned" : 0 + }, + { + "minDistance" : 6813.330144114816, + "maxDistance" : 13629.988734807117, + "maxInclusive" : false, + "nBuffered" : 0, + "nReturned" : 0 + }, + { + "minDistance" : 13629.988734807117, + "maxDistance" : 27263.30591619172, + "maxInclusive" : false, + "nBuffered" : 0, + "nReturned" : 0 + }, + { + "minDistance" : 27263.30591619172, + "maxDistance" : 54529.94027896093, + "maxInclusive" : false, + "nBuffered" : 0, + "nReturned" : 0 + }, + { + "minDistance" : 54529.94027896093, + "maxDistance" : 109063.20900449934, + "maxInclusive" : false, + "nBuffered" : 0, + "nReturned" : 0 + }, + { + "minDistance" : 109063.20900449934, + "maxDistance" : 218129.74645557615, + "maxInclusive" : false, + "nBuffered" : 2, + "nReturned" : 2 + }, + { + "minDistance" : 218129.74645557615, + "maxDistance" : 436262.82135772984, + "maxInclusive" : false, + "nBuffered" : 3, + "nReturned" : 1 + }, + { + "minDistance" : 436262.82135772984, + "maxDistance" : 872528.9711620372, + "maxInclusive" : false, + "nBuffered" : 2, + "nReturned" : 3 + }, + { + "minDistance" : 872528.9711620372, + "maxDistance" : 1745061.2707706518, + "maxInclusive" : false, + "nBuffered" : 2, + "nReturned" : 3 + }, + { + "minDistance" : 1745061.2707706518, + "maxDistance" : 3490125.869987881, + "maxInclusive" : false, + "nBuffered" : 0, + "nReturned" : 0 + }, + { + "minDistance" : 3490125.869987881, + "maxDistance" : 6980255.06842234, + "maxInclusive" : false, + "nBuffered" : 0, + "nReturned" : 0 + }, + { + "minDistance" : 6980255.06842234, + "maxDistance" : 13960513.465291258, + "maxInclusive" : false, + "nBuffered" : 0, + "nReturned" : 0 + }, + { + "minDistance" : 13960513.465291258, + "maxDistance" : 20037392.10386106, + "maxInclusive" : true, + "nBuffered" : 0, + "nReturned" : 0 + } + ], + "inputStages" : [ + { + "stage" : "FETCH", + "nReturned" : 1, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 1, + "needTime" : 3, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 1, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 1, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 1, + "needTime" : 3, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[1153202979583557632, 1153202979583557632]", + "[1153273348327735296, 1153273348327735296]", + "[1153277746374246400, 1153277746374246400]", + "[1153277815093723136, 1153277815093723136]", + "[1153277832273592320, 1153277832273592320]", + "[1153277836568559616, 1153277836568559616]", + "[1153277837373865984, 1153277837373865984]", + "[1153277837575192576, 1153277837575192576]", + "[1153277837625524224, 1153277837625524224]", + "[1153277837629718528, 1153277837629718528]", + "[1153277837631979521, 1153277837632012287]", + "[1153277837632012288, 1153277837632012288]", + "[1153277837632077824, 1153277837632077824]", + "[1153277837632864256, 1153277837632864256]", + "[1153277837633421313, 1153277837633454079]", + "[1153277837633454080, 1153277837633454080]", + "[1153277837633454081, 1153277837633486847]", + "[1153277837633585152, 1153277837633585152]", + "[1153277837633617921, 1153277837633650687]", + "[1153277837633650688, 1153277837633650688]", + "[1153277837633650689, 1153277837633781759]", + "[1153277837633781761, 1153277837633912831]", + "[1153277837633912833, 1153277837634043903]", + "[1153277837634043905, 1153277837634076671]", + "[1153277837634109440, 1153277837634109440]", + "[1153277837634142209, 1153277837634174975]", + "[1153277837634174976, 1153277837634174976]", + "[1153277837634371584, 1153277837634371584]", + "[1153277837634371585, 1153277837634404351]", + "[1153277837634961408, 1153277837634961408]", + "[1153277837638107136, 1153277837638107136]", + "[1153277837642301440, 1153277837642301440]", + "[1153277837646495744, 1153277837646495744]", + "[1153277837649641472, 1153277837649641472]", + "[1153277837650198529, 1153277837650231295]", + "[1153277837650231296, 1153277837650231296]", + "[1153277837650231297, 1153277837650264063]", + "[1153277837650427904, 1153277837650427904]", + "[1153277837650427905, 1153277837650558975]", + "[1153277837650558977, 1153277837650690047]", + "[1153277837650690049, 1153277837651214335]", + "[1153277837651738624, 1153277837651738624]", + "[1153277837652525056, 1153277837652525056]", + "[1153277837652557825, 1153277837652590591]", + "[1153277837652590592, 1153277837652590592]", + "[1153277837652590593, 1153277837652623359]", + "[1153277837654884352, 1153277837654884352]", + "[1153277837659078656, 1153277837659078656]", + "[1153277837709410304, 1153277837709410304]", + "[1153277837910736896, 1153277837910736896]", + "[1153278021252153344, 1153278021252153344]", + "[1153278845885874176, 1153278845885874176]", + "[1153290940513779712, 1153290940513779712]", + "[1154047404513689600, 1154047404513689600]", + "[1157425104234217472, 1157425104234217472]", + "[1170935903116328960, 1170935903116328960]", + "[1224979098644774912, 1224979098644774912]" + ] + }, + "keysExamined" : 4, + "seeks" : 4, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 0, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[1153202979583557632, 1153202979583557632]", + "[1153273348327735296, 1153273348327735296]", + "[1153277746374246400, 1153277746374246400]", + "[1153277815093723136, 1153277815093723136]", + "[1153277832273592320, 1153277832273592320]", + "[1153277836568559616, 1153277836568559616]", + "[1153277837373865984, 1153277837373865984]", + "[1153277837575192576, 1153277837575192576]", + "[1153277837625524224, 1153277837625524224]", + "[1153277837626048513, 1153277837626572799]", + "[1153277837626572800, 1153277837626572800]", + "[1153277837626703873, 1153277837626834943]", + "[1153277837626834944, 1153277837626834944]", + "[1153277837629718528, 1153277837629718528]", + "[1153277837629849601, 1153277837629980671]", + "[1153277837629980672, 1153277837629980672]", + "[1153277837630767104, 1153277837630767104]", + "[1153277837631291393, 1153277837631815679]", + "[1153277837631815681, 1153277837631946751]", + "[1153277837631946753, 1153277837631979519]", + "[1153277837632012288, 1153277837632012288]", + "[1153277837632012289, 1153277837632045055]", + "[1153277837632045057, 1153277837632077823]", + "[1153277837632077824, 1153277837632077824]", + "[1153277837632077825, 1153277837632208895]", + "[1153277837632208897, 1153277837632339967]", + "[1153277837632339969, 1153277837632864255]", + "[1153277837632864256, 1153277837632864256]", + "[1153277837632864257, 1153277837633388543]", + "[1153277837633388545, 1153277837633421311]", + "[1153277837633454080, 1153277837633454080]", + "[1153277837633486849, 1153277837633519615]", + "[1153277837633519617, 1153277837633552383]", + "[1153277837633552385, 1153277837633585151]", + "[1153277837633585152, 1153277837633585152]", + "[1153277837633585153, 1153277837633617919]", + "[1153277837633650688, 1153277837633650688]", + "[1153277837634076673, 1153277837634109439]", + "[1153277837634109440, 1153277837634109440]", + "[1153277837634109441, 1153277837634142207]", + "[1153277837634174976, 1153277837634174976]", + "[1153277837634174977, 1153277837634306047]", + "[1153277837634306049, 1153277837634338815]", + "[1153277837634338817, 1153277837634371583]", + "[1153277837634371584, 1153277837634371584]", + "[1153277837634404353, 1153277837634437119]", + "[1153277837634437121, 1153277837634961407]", + "[1153277837634961408, 1153277837634961408]", + "[1153277837634961409, 1153277837635485695]", + "[1153277837635485697, 1153277837636009983]", + "[1153277837636009985, 1153277837636141055]", + "[1153277837636141057, 1153277837636272127]", + "[1153277837636272128, 1153277837636272128]", + "[1153277837637058560, 1153277837637058560]", + "[1153277837638107136, 1153277837638107136]", + "[1153277837641252864, 1153277837641252864]", + "[1153277837641252865, 1153277837641777151]", + "[1153277837642301440, 1153277837642301440]", + "[1153277837642825729, 1153277837643350015]", + "[1153277837643350016, 1153277837643350016]", + "[1153277837643513857, 1153277837643546623]", + "[1153277837643546624, 1153277837643546624]", + "[1153277837643612160, 1153277837643612160]", + "[1153277837646495744, 1153277837646495744]", + "[1153277837646626817, 1153277837646757887]", + "[1153277837646757888, 1153277837646757888]", + "[1153277837647544320, 1153277837647544320]", + "[1153277837648068609, 1153277837648592895]", + "[1153277837648592897, 1153277837649117183]", + "[1153277837649117185, 1153277837649641471]", + "[1153277837649641472, 1153277837649641472]", + "[1153277837649641473, 1153277837650165759]", + "[1153277837650165761, 1153277837650198527]", + "[1153277837650231296, 1153277837650231296]", + "[1153277837650264065, 1153277837650296831]", + "[1153277837650296833, 1153277837650427903]", + "[1153277837650427904, 1153277837650427904]", + "[1153277837651214337, 1153277837651738623]", + "[1153277837651738624, 1153277837651738624]", + "[1153277837651738625, 1153277837652262911]", + "[1153277837652262913, 1153277837652393983]", + "[1153277837652393985, 1153277837652525055]", + "[1153277837652525056, 1153277837652525056]", + "[1153277837652525057, 1153277837652557823]", + "[1153277837652590592, 1153277837652590592]", + "[1153277837652623361, 1153277837652656127]", + "[1153277837652656129, 1153277837652787199]", + "[1153277837652787201, 1153277837653311487]", + "[1153277837653835776, 1153277837653835776]", + "[1153277837654360065, 1153277837654884351]", + "[1153277837654884352, 1153277837654884352]", + "[1153277837657702400, 1153277837657702400]", + "[1153277837657702401, 1153277837657735167]", + "[1153277837657767936, 1153277837657767936]", + "[1153277837657767937, 1153277837657899007]", + "[1153277837658030080, 1153277837658030080]", + "[1153277837658030081, 1153277837658554367]", + "[1153277837659078656, 1153277837659078656]", + "[1153277837709410304, 1153277837709410304]", + "[1153277837910736896, 1153277837910736896]", + "[1153278021252153344, 1153278021252153344]", + "[1153278845885874176, 1153278845885874176]", + "[1153290940513779712, 1153290940513779712]", + "[1154047404513689600, 1154047404513689600]", + "[1157425104234217472, 1157425104234217472]", + "[1170935903116328960, 1170935903116328960]", + "[1224979098644774912, 1224979098644774912]" + ] + }, + "keysExamined" : 4, + "seeks" : 5, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 0, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[1153202979583557632, 1153202979583557632]", + "[1153273348327735296, 1153273348327735296]", + "[1153277746374246400, 1153277746374246400]", + "[1153277815093723136, 1153277815093723136]", + "[1153277832273592320, 1153277832273592320]", + "[1153277836568559616, 1153277836568559616]", + "[1153277836836995072, 1153277836836995072]", + "[1153277836904103936, 1153277836904103936]", + "[1153277836920881152, 1153277836920881152]", + "[1153277836925075456, 1153277836925075456]", + "[1153277836925075457, 1153277836927172607]", + "[1153277836927172609, 1153277836929269759]", + "[1153277837373865984, 1153277837373865984]", + "[1153277837518569473, 1153277837520666623]", + "[1153277837520666624, 1153277837520666624]", + "[1153277837520666625, 1153277837522763775]", + "[1153277837524860928, 1153277837524860928]", + "[1153277837575192576, 1153277837575192576]", + "[1153277837610844161, 1153277837612941311]", + "[1153277837612941312, 1153277837612941312]", + "[1153277837612941313, 1153277837615038463]", + "[1153277837617135617, 1153277837625524223]", + "[1153277837625524224, 1153277837625524224]", + "[1153277837625524225, 1153277837626048511]", + "[1153277837626572800, 1153277837626572800]", + "[1153277837626572801, 1153277837626703871]", + "[1153277837626834944, 1153277837626834944]", + "[1153277837626834945, 1153277837626966015]", + "[1153277837626966017, 1153277837627097087]", + "[1153277837627097089, 1153277837627621375]", + "[1153277837627621377, 1153277837629718527]", + "[1153277837629718528, 1153277837629718528]", + "[1153277837629718529, 1153277837629849599]", + "[1153277837629980672, 1153277837629980672]", + "[1153277837629980673, 1153277837630111743]", + "[1153277837630111745, 1153277837630242815]", + "[1153277837630242817, 1153277837630767103]", + "[1153277837630767104, 1153277837630767104]", + "[1153277837630767105, 1153277837631291391]", + "[1153277837636272128, 1153277837636272128]", + "[1153277837636272129, 1153277837636403199]", + "[1153277837636403201, 1153277837636534271]", + "[1153277837636534273, 1153277837637058559]", + "[1153277837637058560, 1153277837637058560]", + "[1153277837637058561, 1153277837637582847]", + "[1153277837637582849, 1153277837638107135]", + "[1153277837638107136, 1153277837638107136]", + "[1153277837638107137, 1153277837640204287]", + "[1153277837640204289, 1153277837640728575]", + "[1153277837640728577, 1153277837641252863]", + "[1153277837641252864, 1153277837641252864]", + "[1153277837641777153, 1153277837642301439]", + "[1153277837642301440, 1153277837642301440]", + "[1153277837642301441, 1153277837642825727]", + "[1153277837643350016, 1153277837643350016]", + "[1153277837643350017, 1153277837643481087]", + "[1153277837643481089, 1153277837643513855]", + "[1153277837643546624, 1153277837643546624]", + "[1153277837643546625, 1153277837643579391]", + "[1153277837643579393, 1153277837643612159]", + "[1153277837643612160, 1153277837643612160]", + "[1153277837643612161, 1153277837643743231]", + "[1153277837643743233, 1153277837643874303]", + "[1153277837643874305, 1153277837644398591]", + "[1153277837644398593, 1153277837646495743]", + "[1153277837646495744, 1153277837646495744]", + "[1153277837646495745, 1153277837646626815]", + "[1153277837646757888, 1153277837646757888]", + "[1153277837646757889, 1153277837646888959]", + "[1153277837646888961, 1153277837647020031]", + "[1153277837647020033, 1153277837647544319]", + "[1153277837647544320, 1153277837647544320]", + "[1153277837647544321, 1153277837648068607]", + "[1153277837653311489, 1153277837653835775]", + "[1153277837653835776, 1153277837653835776]", + "[1153277837653835777, 1153277837654360063]", + "[1153277837654884352, 1153277837654884352]", + "[1153277837654884353, 1153277837656981503]", + "[1153277837656981505, 1153277837657505791]", + "[1153277837657505793, 1153277837657636863]", + "[1153277837657636865, 1153277837657669631]", + "[1153277837657669633, 1153277837657702399]", + "[1153277837657702400, 1153277837657702400]", + "[1153277837657735169, 1153277837657767935]", + "[1153277837657767936, 1153277837657767936]", + "[1153277837657899009, 1153277837658030079]", + "[1153277837658030080, 1153277837658030080]", + "[1153277837658554369, 1153277837659078655]", + "[1153277837659078656, 1153277837659078656]", + "[1153277837659078657, 1153277837661175807]", + "[1153277837661175809, 1153277837663272959]", + "[1153277837663272960, 1153277837663272960]", + "[1153277837669564417, 1153277837671661567]", + "[1153277837671661568, 1153277837671661568]", + "[1153277837671661569, 1153277837673758719]", + "[1153277837709410304, 1153277837709410304]", + "[1153277837755547648, 1153277837755547648]", + "[1153277837756596224, 1153277837756596224]", + "[1153277837756858368, 1153277837756858368]", + "[1153277837756858369, 1153277837756989439]", + "[1153277837759741952, 1153277837759741952]", + "[1153277837761839105, 1153277837763936255]", + "[1153277837763936256, 1153277837763936256]", + "[1153277837763936257, 1153277837766033407]", + "[1153277837910736896, 1153277837910736896]", + "[1153277838355333121, 1153277838357430271]", + "[1153277838357430273, 1153277838359527423]", + "[1153277838359527424, 1153277838359527424]", + "[1153277838363721728, 1153277838363721728]", + "[1153277838380498944, 1153277838380498944]", + "[1153277838447607808, 1153277838447607808]", + "[1153278021252153344, 1153278021252153344]", + "[1153278845885874176, 1153278845885874176]", + "[1153290940513779712, 1153290940513779712]", + "[1154047404513689600, 1154047404513689600]", + "[1157425104234217472, 1157425104234217472]", + "[1170935903116328960, 1170935903116328960]", + "[1224979098644774912, 1224979098644774912]" + ] + }, + "keysExamined" : 4, + "seeks" : 5, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 0, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[1153202979583557632, 1153202979583557632]", + "[1153273348327735296, 1153273348327735296]", + "[1153277746374246400, 1153277746374246400]", + "[1153277815093723136, 1153277815093723136]", + "[1153277832273592320, 1153277832273592320]", + "[1153277836568559616, 1153277836568559616]", + "[1153277836836995072, 1153277836836995072]", + "[1153277836904103936, 1153277836904103936]", + "[1153277836904103937, 1153277836912492543]", + "[1153277836912492545, 1153277836920881151]", + "[1153277836920881152, 1153277836920881152]", + "[1153277836920881153, 1153277836922978303]", + "[1153277836922978305, 1153277836925075455]", + "[1153277836925075456, 1153277836925075456]", + "[1153277836929269761, 1153277836937658367]", + "[1153277836937658369, 1153277836946046975]", + "[1153277836946046977, 1153277836946571263]", + "[1153277836947095552, 1153277836947095552]", + "[1153277836950241280, 1153277836950241280]", + "[1153277836954435584, 1153277836954435584]", + "[1153277837373865984, 1153277837373865984]", + "[1153277837440974848, 1153277837440974848]", + "[1153277837491306496, 1153277837491306496]", + "[1153277837500383233, 1153277837500415999]", + "[1153277837500416000, 1153277837500416000]", + "[1153277837500481536, 1153277837500481536]", + "[1153277837500743680, 1153277837500743680]", + "[1153277837503889408, 1153277837503889408]", + "[1153277837505986561, 1153277837508083711]", + "[1153277837508083713, 1153277837516472319]", + "[1153277837516472321, 1153277837518569471]", + "[1153277837520666624, 1153277837520666624]", + "[1153277837522763777, 1153277837524860927]", + "[1153277837524860928, 1153277837524860928]", + "[1153277837524860929, 1153277837533249535]", + "[1153277837533249537, 1153277837541638143]", + "[1153277837543735297, 1153277837545832447]", + "[1153277837545832448, 1153277837545832448]", + "[1153277837558415360, 1153277837558415360]", + "[1153277837566803969, 1153277837575192575]", + "[1153277837575192576, 1153277837575192576]", + "[1153277837575192577, 1153277837583581183]", + "[1153277837591969792, 1153277837591969792]", + "[1153277837600358401, 1153277837608747007]", + "[1153277837608747009, 1153277837610844159]", + "[1153277837612941312, 1153277837612941312]", + "[1153277837615038465, 1153277837617135615]", + "[1153277837625524224, 1153277837625524224]", + "[1153277837642301440, 1153277837642301440]", + "[1153277837659078656, 1153277837659078656]", + "[1153277837663272960, 1153277837663272960]", + "[1153277837663272961, 1153277837665370111]", + "[1153277837665370113, 1153277837667467263]", + "[1153277837667467265, 1153277837669564415]", + "[1153277837671661568, 1153277837671661568]", + "[1153277837673758721, 1153277837675855871]", + "[1153277837675855873, 1153277837709410303]", + "[1153277837709410304, 1153277837709410304]", + "[1153277837709410305, 1153277837717798911]", + "[1153277837726187520, 1153277837726187520]", + "[1153277837738770432, 1153277837738770432]", + "[1153277837738770433, 1153277837740867583]", + "[1153277837742964737, 1153277837751353343]", + "[1153277837751353345, 1153277837753450495]", + "[1153277837753450497, 1153277837755547647]", + "[1153277837755547648, 1153277837755547648]", + "[1153277837755547649, 1153277837756071935]", + "[1153277837756071937, 1153277837756596223]", + "[1153277837756596224, 1153277837756596224]", + "[1153277837756596225, 1153277837756727295]", + "[1153277837756727297, 1153277837756858367]", + "[1153277837756858368, 1153277837756858368]", + "[1153277837756989441, 1153277837757120511]", + "[1153277837757120513, 1153277837757644799]", + "[1153277837757644801, 1153277837759741951]", + "[1153277837759741952, 1153277837759741952]", + "[1153277837759741953, 1153277837761839103]", + "[1153277837763936256, 1153277837763936256]", + "[1153277837766033409, 1153277837768130559]", + "[1153277837768130561, 1153277837776519167]", + "[1153277837776519169, 1153277837784907775]", + "[1153277837793296384, 1153277837793296384]", + "[1153277837843628032, 1153277837843628032]", + "[1153277837910736896, 1153277837910736896]", + "[1153277838330167296, 1153277838330167296]", + "[1153277838334361600, 1153277838334361600]", + "[1153277838337507328, 1153277838337507328]", + "[1153277838338031617, 1153277838338555903]", + "[1153277838338555905, 1153277838346944511]", + "[1153277838346944513, 1153277838355333119]", + "[1153277838359527424, 1153277838359527424]", + "[1153277838359527425, 1153277838361624575]", + "[1153277838361624577, 1153277838363721727]", + "[1153277838363721728, 1153277838363721728]", + "[1153277838363721729, 1153277838372110335]", + "[1153277838372110337, 1153277838380498943]", + "[1153277838380498944, 1153277838380498944]", + "[1153277838447607808, 1153277838447607808]", + "[1153278021252153344, 1153278021252153344]", + "[1153278845885874176, 1153278845885874176]", + "[1153290940513779712, 1153290940513779712]", + "[1154047404513689600, 1154047404513689600]", + "[1157425104234217472, 1157425104234217472]", + "[1170935903116328960, 1170935903116328960]", + "[1224979098644774912, 1224979098644774912]" + ] + }, + "keysExamined" : 4, + "seeks" : 5, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 0, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[1153202979583557632, 1153202979583557632]", + "[1153273348327735296, 1153273348327735296]", + "[1153277746374246400, 1153277746374246400]", + "[1153277815093723136, 1153277815093723136]", + "[1153277832273592320, 1153277832273592320]", + "[1153277836568559616, 1153277836568559616]", + "[1153277836769886208, 1153277836769886208]", + "[1153277836769886209, 1153277836803440639]", + "[1153277836803440641, 1153277836836995071]", + "[1153277836836995072, 1153277836836995072]", + "[1153277836836995073, 1153277836870549503]", + "[1153277836870549505, 1153277836904103935]", + "[1153277836904103936, 1153277836904103936]", + "[1153277836946571265, 1153277836947095551]", + "[1153277836947095552, 1153277836947095552]", + "[1153277836947095553, 1153277836947619839]", + "[1153277836947619841, 1153277836948144127]", + "[1153277836948144129, 1153277836950241279]", + "[1153277836950241280, 1153277836950241280]", + "[1153277836950241281, 1153277836952338431]", + "[1153277836952338433, 1153277836954435583]", + "[1153277836954435584, 1153277836954435584]", + "[1153277836954435585, 1153277836962824191]", + "[1153277836962824193, 1153277836971212799]", + "[1153277836971212801, 1153277837004767231]", + "[1153277837004767233, 1153277837038321663]", + "[1153277837038321664, 1153277837038321664]", + "[1153277837088653312, 1153277837088653312]", + "[1153277837092847616, 1153277837092847616]", + "[1153277837092847617, 1153277837094944767]", + "[1153277837105430529, 1153277837239648255]", + "[1153277837306757120, 1153277837306757120]", + "[1153277837340311553, 1153277837373865983]", + "[1153277837373865984, 1153277837373865984]", + "[1153277837373865985, 1153277837407420415]", + "[1153277837407420417, 1153277837440974847]", + "[1153277837440974848, 1153277837440974848]", + "[1153277837440974849, 1153277837474529279]", + "[1153277837474529281, 1153277837482917887]", + "[1153277837482917889, 1153277837491306495]", + "[1153277837491306496, 1153277837491306496]", + "[1153277837491306497, 1153277837499695103]", + "[1153277837499695105, 1153277837500219391]", + "[1153277837500219393, 1153277837500350463]", + "[1153277837500350465, 1153277837500383231]", + "[1153277837500416000, 1153277837500416000]", + "[1153277837500416001, 1153277837500448767]", + "[1153277837500448769, 1153277837500481535]", + "[1153277837500481536, 1153277837500481536]", + "[1153277837500481537, 1153277837500612607]", + "[1153277837500612609, 1153277837500743679]", + "[1153277837500743680, 1153277837500743680]", + "[1153277837500743681, 1153277837501267967]", + "[1153277837501267969, 1153277837501792255]", + "[1153277837501792257, 1153277837503889407]", + "[1153277837503889408, 1153277837503889408]", + "[1153277837503889409, 1153277837505986559]", + "[1153277837541638145, 1153277837543735295]", + "[1153277837545832448, 1153277837545832448]", + "[1153277837545832449, 1153277837547929599]", + "[1153277837547929601, 1153277837550026751]", + "[1153277837550026753, 1153277837558415359]", + "[1153277837558415360, 1153277837558415360]", + "[1153277837558415361, 1153277837566803967]", + "[1153277837575192576, 1153277837575192576]", + "[1153277837583581185, 1153277837591969791]", + "[1153277837591969792, 1153277837591969792]", + "[1153277837591969793, 1153277837600358399]", + "[1153277837642301440, 1153277837642301440]", + "[1153277837709410304, 1153277837709410304]", + "[1153277837717798913, 1153277837726187519]", + "[1153277837726187520, 1153277837726187520]", + "[1153277837726187521, 1153277837734576127]", + "[1153277837734576129, 1153277837736673279]", + "[1153277837736673281, 1153277837738770431]", + "[1153277837738770432, 1153277837738770432]", + "[1153277837740867585, 1153277837742964735]", + "[1153277837784907777, 1153277837793296383]", + "[1153277837793296384, 1153277837793296384]", + "[1153277837793296385, 1153277837801684991]", + "[1153277837801684993, 1153277837810073599]", + "[1153277837810073601, 1153277837843628031]", + "[1153277837843628032, 1153277837843628032]", + "[1153277837843628033, 1153277837877182463]", + "[1153277837877182465, 1153277837910736895]", + "[1153277837910736896, 1153277837910736896]", + "[1153277837910736897, 1153277837944291327]", + "[1153277837977845760, 1153277837977845760]", + "[1153277838044954625, 1153277838179172351]", + "[1153277838179172353, 1153277838313390079]", + "[1153277838313390081, 1153277838321778687]", + "[1153277838321778689, 1153277838330167295]", + "[1153277838330167296, 1153277838330167296]", + "[1153277838330167297, 1153277838332264447]", + "[1153277838332264449, 1153277838334361599]", + "[1153277838334361600, 1153277838334361600]", + "[1153277838334361601, 1153277838336458751]", + "[1153277838336458753, 1153277838336983039]", + "[1153277838336983041, 1153277838337507327]", + "[1153277838337507328, 1153277838337507328]", + "[1153277838337507329, 1153277838338031615]", + "[1153277838380498944, 1153277838380498944]", + "[1153277838380498945, 1153277838414053375]", + "[1153277838414053377, 1153277838447607807]", + "[1153277838447607808, 1153277838447607808]", + "[1153277838447607809, 1153277838481162239]", + "[1153277838481162241, 1153277838514716671]", + "[1153277838514716672, 1153277838514716672]", + "[1153278021252153344, 1153278021252153344]", + "[1153278845885874176, 1153278845885874176]", + "[1153290940513779712, 1153290940513779712]", + "[1154047404513689600, 1154047404513689600]", + "[1157425104234217472, 1157425104234217472]", + "[1170935903116328960, 1170935903116328960]", + "[1224979098644774912, 1224979098644774912]" + ] + }, + "keysExamined" : 4, + "seeks" : 5, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 0, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[1153202979583557632, 1153202979583557632]", + "[1153273348327735296, 1153273348327735296]", + "[1153277746374246400, 1153277746374246400]", + "[1153277815093723136, 1153277815093723136]", + "[1153277832273592320, 1153277832273592320]", + "[1153277833347334144, 1153277833347334144]", + "[1153277833615769600, 1153277833615769600]", + "[1153277833682878464, 1153277833682878464]", + "[1153277833699655680, 1153277833699655680]", + "[1153277833699655681, 1153277833708044287]", + "[1153277835494817792, 1153277835494817792]", + "[1153277835494817793, 1153277836031688703]", + "[1153277836031688705, 1153277836165906431]", + "[1153277836165906433, 1153277836300124159]", + "[1153277836300124160, 1153277836300124160]", + "[1153277836434341889, 1153277836568559615]", + "[1153277836568559616, 1153277836568559616]", + "[1153277836568559617, 1153277836702777343]", + "[1153277836702777345, 1153277836736331775]", + "[1153277836736331777, 1153277836769886207]", + "[1153277836769886208, 1153277836769886208]", + "[1153277836836995072, 1153277836836995072]", + "[1153277837038321664, 1153277837038321664]", + "[1153277837038321665, 1153277837071876095]", + "[1153277837071876097, 1153277837080264703]", + "[1153277837080264705, 1153277837088653311]", + "[1153277837088653312, 1153277837088653312]", + "[1153277837088653313, 1153277837090750463]", + "[1153277837090750465, 1153277837092847615]", + "[1153277837092847616, 1153277837092847616]", + "[1153277837094944769, 1153277837097041919]", + "[1153277837097041921, 1153277837105430527]", + "[1153277837239648257, 1153277837273202687]", + "[1153277837273202689, 1153277837306757119]", + "[1153277837306757120, 1153277837306757120]", + "[1153277837306757121, 1153277837340311551]", + "[1153277837373865984, 1153277837373865984]", + "[1153277837642301440, 1153277837642301440]", + "[1153277837910736896, 1153277837910736896]", + "[1153277837944291329, 1153277837977845759]", + "[1153277837977845760, 1153277837977845760]", + "[1153277837977845761, 1153277838011400191]", + "[1153277838011400193, 1153277838044954623]", + "[1153277838447607808, 1153277838447607808]", + "[1153277838514716672, 1153277838514716672]", + "[1153277838514716673, 1153277838548271103]", + "[1153277838548271105, 1153277838581825535]", + "[1153277838581825537, 1153277838716043263]", + "[1153277838716043265, 1153277838850260991]", + "[1153277838984478720, 1153277838984478720]", + "[1153277839118696449, 1153277839252914175]", + "[1153277839252914177, 1153277839387131903]", + "[1153277839387131905, 1153277839521349631]", + "[1153277839521349632, 1153277839521349632]", + "[1153277839789785088, 1153277839789785088]", + "[1153277952532676608, 1153277952532676608]", + "[1153278004072284160, 1153278004072284160]", + "[1153278013375250433, 1153278013383639039]", + "[1153278013383639040, 1153278013383639040]", + "[1153278013400416256, 1153278013400416256]", + "[1153278013467525120, 1153278013467525120]", + "[1153278013735960576, 1153278013735960576]", + "[1153278016957186048, 1153278016957186048]", + "[1153278020178411520, 1153278020178411520]", + "[1153278020178411521, 1153278020715282431]", + "[1153278020715282433, 1153278021252153343]", + "[1153278021252153344, 1153278021252153344]", + "[1153278021252153345, 1153278021386371071]", + "[1153278021520588800, 1153278021520588800]", + "[1153278022325895168, 1153278022325895168]", + "[1153278025547120640, 1153278025547120640]", + "[1153278038432022528, 1153278038432022528]", + "[1153278089971630080, 1153278089971630080]", + "[1153278204325134337, 1153278204862005247]", + "[1153278204862005248, 1153278204862005248]", + "[1153278204862005249, 1153278205398876159]", + "[1153278205935747072, 1153278205935747072]", + "[1153278206606835713, 1153278206741053439]", + "[1153278206741053440, 1153278206741053440]", + "[1153278207009488896, 1153278207009488896]", + "[1153278210230714368, 1153278210230714368]", + "[1153278227410583552, 1153278227410583552]", + "[1153278845885874176, 1153278845885874176]", + "[1153290940513779712, 1153290940513779712]", + "[1154047404513689600, 1154047404513689600]", + "[1157425104234217472, 1157425104234217472]", + "[1170935903116328960, 1170935903116328960]", + "[1224979098644774912, 1224979098644774912]" + ] + }, + "keysExamined" : 4, + "seeks" : 5, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 0, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[1153202979583557632, 1153202979583557632]", + "[1153273348327735296, 1153273348327735296]", + "[1153277746374246400, 1153277746374246400]", + "[1153277815093723136, 1153277815093723136]", + "[1153277827978625024, 1153277827978625024]", + "[1153277829052366848, 1153277829052366848]", + "[1153277829052366849, 1153277829589237759]", + "[1153277829589237761, 1153277830126108671]", + "[1153277832273592320, 1153277832273592320]", + "[1153277832273592321, 1153277832810463231]", + "[1153277832810463233, 1153277833347334143]", + "[1153277833347334144, 1153277833347334144]", + "[1153277833347334145, 1153277833481551871]", + "[1153277833481551873, 1153277833615769599]", + "[1153277833615769600, 1153277833615769600]", + "[1153277833615769601, 1153277833649324031]", + "[1153277833649324033, 1153277833682878463]", + "[1153277833682878464, 1153277833682878464]", + "[1153277833682878465, 1153277833691267071]", + "[1153277833691267073, 1153277833699655679]", + "[1153277833699655680, 1153277833699655680]", + "[1153277833708044289, 1153277833716432895]", + "[1153277833716432897, 1153277833749987327]", + "[1153277833749987329, 1153277833884205055]", + "[1153277833884205057, 1153277834421075967]", + "[1153277834421075969, 1153277834957946879]", + "[1153277834957946881, 1153277835494817791]", + "[1153277835494817792, 1153277835494817792]", + "[1153277836300124160, 1153277836300124160]", + "[1153277836300124161, 1153277836434341887]", + "[1153277836568559616, 1153277836568559616]", + "[1153277838850260993, 1153277838984478719]", + "[1153277838984478720, 1153277838984478720]", + "[1153277838984478721, 1153277839118696447]", + "[1153277839521349632, 1153277839521349632]", + "[1153277839521349633, 1153277839655567359]", + "[1153277839655567361, 1153277839789785087]", + "[1153277839789785088, 1153277839789785088]", + "[1153277839789785089, 1153277840326655999]", + "[1153277840326656001, 1153277840863526911]", + "[1153277840863526913, 1153277841400397823]", + "[1153277841937268736, 1153277841937268736]", + "[1153277842474139649, 1153277843011010559]", + "[1153277845158494208, 1153277845158494208]", + "[1153277952532676608, 1153277952532676608]", + "[1153278004072284160, 1153278004072284160]", + "[1153278012662218753, 1153278013199089663]", + "[1153278013199089665, 1153278013333307391]", + "[1153278013333307393, 1153278013366861823]", + "[1153278013366861825, 1153278013375250431]", + "[1153278013383639040, 1153278013383639040]", + "[1153278013383639041, 1153278013392027647]", + "[1153278013392027649, 1153278013400416255]", + "[1153278013400416256, 1153278013400416256]", + "[1153278013400416257, 1153278013433970687]", + "[1153278013433970689, 1153278013467525119]", + "[1153278013467525120, 1153278013467525120]", + "[1153278013467525121, 1153278013601742847]", + "[1153278013601742849, 1153278013735960575]", + "[1153278013735960576, 1153278013735960576]", + "[1153278013735960577, 1153278014272831487]", + "[1153278014272831489, 1153278014809702399]", + "[1153278016957186048, 1153278016957186048]", + "[1153278016957186049, 1153278017494056959]", + "[1153278018030927872, 1153278018030927872]", + "[1153278018567798785, 1153278019104669695]", + "[1153278019104669697, 1153278019641540607]", + "[1153278019641540609, 1153278020178411519]", + "[1153278020178411520, 1153278020178411520]", + "[1153278021252153344, 1153278021252153344]", + "[1153278021386371073, 1153278021520588799]", + "[1153278021520588800, 1153278021520588800]", + "[1153278021520588801, 1153278021654806527]", + "[1153278021654806529, 1153278021789024255]", + "[1153278021789024257, 1153278022325895167]", + "[1153278022325895168, 1153278022325895168]", + "[1153278022325895169, 1153278022862766079]", + "[1153278022862766081, 1153278023399636991]", + "[1153278023399636993, 1153278023433191423]", + "[1153278023466745856, 1153278023466745856]", + "[1153278023668072448, 1153278023668072448]", + "[1153278024473378816, 1153278024473378816]", + "[1153278025547120640, 1153278025547120640]", + "[1153278028768346112, 1153278028768346112]", + "[1153278029036781568, 1153278029036781568]", + "[1153278029036781569, 1153278029170999295]", + "[1153278038432022528, 1153278038432022528]", + "[1153278089971630080, 1153278089971630080]", + "[1153278202714521600, 1153278202714521600]", + "[1153278202714521601, 1153278203251392511]", + "[1153278203251392513, 1153278203788263423]", + "[1153278203788263425, 1153278204325134335]", + "[1153278204862005248, 1153278204862005248]", + "[1153278205398876161, 1153278205935747071]", + "[1153278205935747072, 1153278205935747072]", + "[1153278205935747073, 1153278206472617983]", + "[1153278206472617985, 1153278206606835711]", + "[1153278206741053440, 1153278206741053440]", + "[1153278206741053441, 1153278206875271167]", + "[1153278206875271169, 1153278207009488895]", + "[1153278207009488896, 1153278207009488896]", + "[1153278207009488897, 1153278207546359807]", + "[1153278207546359809, 1153278208083230719]", + "[1153278208754319361, 1153278208888537087]", + "[1153278208888537088, 1153278208888537088]", + "[1153278209156972544, 1153278209156972544]", + "[1153278210230714368, 1153278210230714368]", + "[1153278213082841089, 1153278213116395519]", + "[1153278213116395520, 1153278213116395520]", + "[1153278213183504384, 1153278213183504384]", + "[1153278213451939840, 1153278213451939840]", + "[1153278214525681664, 1153278214525681664]", + "[1153278227410583552, 1153278227410583552]", + "[1153278845885874176, 1153278845885874176]", + "[1153290940513779712, 1153290940513779712]", + "[1154047404513689600, 1154047404513689600]", + "[1157425104234217472, 1157425104234217472]", + "[1170935903116328960, 1170935903116328960]", + "[1224979098644774912, 1224979098644774912]" + ] + }, + "keysExamined" : 4, + "seeks" : 5, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 0, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[1153202979583557632, 1153202979583557632]", + "[1153273348327735296, 1153273348327735296]", + "[1153277746374246400, 1153277746374246400]", + "[1153277815093723136, 1153277815093723136]", + "[1153277815093723137, 1153277823683657727]", + "[1153277823683657729, 1153277825831141375]", + "[1153277825831141377, 1153277827978625023]", + "[1153277827978625024, 1153277827978625024]", + "[1153277827978625025, 1153277828515495935]", + "[1153277828515495937, 1153277829052366847]", + "[1153277829052366848, 1153277829052366848]", + "[1153277830126108673, 1153277832273592319]", + "[1153277832273592320, 1153277832273592320]", + "[1153277841400397825, 1153277841937268735]", + "[1153277841937268736, 1153277841937268736]", + "[1153277841937268737, 1153277842474139647]", + "[1153277843011010561, 1153277845158494207]", + "[1153277845158494208, 1153277845158494208]", + "[1153277845158494209, 1153277847305977855]", + "[1153277847305977857, 1153277849453461503]", + "[1153277952532676608, 1153277952532676608]", + "[1153277989039898625, 1153277991187382271]", + "[1153277991187382272, 1153277991187382272]", + "[1153277991187382273, 1153277993334865919]", + "[1153277999777316864, 1153277999777316864]", + "[1153278002998542336, 1153278002998542336]", + "[1153278003535413249, 1153278004072284159]", + "[1153278004072284160, 1153278004072284160]", + "[1153278004072284161, 1153278012662218751]", + "[1153278014809702401, 1153278016957186047]", + "[1153278016957186048, 1153278016957186048]", + "[1153278017494056961, 1153278018030927871]", + "[1153278018030927872, 1153278018030927872]", + "[1153278018030927873, 1153278018567798783]", + "[1153278021252153344, 1153278021252153344]", + "[1153278023433191425, 1153278023466745855]", + "[1153278023466745856, 1153278023466745856]", + "[1153278023466745857, 1153278023500300287]", + "[1153278023500300289, 1153278023533854719]", + "[1153278023533854721, 1153278023668072447]", + "[1153278023668072448, 1153278023668072448]", + "[1153278023668072449, 1153278023802290175]", + "[1153278023802290177, 1153278023936507903]", + "[1153278023936507905, 1153278024473378815]", + "[1153278024473378816, 1153278024473378816]", + "[1153278024473378817, 1153278025010249727]", + "[1153278025010249729, 1153278025547120639]", + "[1153278025547120640, 1153278025547120640]", + "[1153278025547120641, 1153278027694604287]", + "[1153278027694604289, 1153278028231475199]", + "[1153278028231475201, 1153278028768346111]", + "[1153278028768346112, 1153278028768346112]", + "[1153278028768346113, 1153278028902563839]", + "[1153278028902563841, 1153278029036781567]", + "[1153278029036781568, 1153278029036781568]", + "[1153278029170999297, 1153278029305217023]", + "[1153278029305217025, 1153278029842087935]", + "[1153278029842087937, 1153278031989571583]", + "[1153278034137055232, 1153278034137055232]", + "[1153278036284538881, 1153278038432022527]", + "[1153278038432022528, 1153278038432022528]", + "[1153278049974747136, 1153278049974747136]", + "[1153278050041856000, 1153278050041856000]", + "[1153278050058633216, 1153278050058633216]", + "[1153278050058633217, 1153278050067021823]", + "[1153278050243182592, 1153278050243182592]", + "[1153278050243182593, 1153278050780053503]", + "[1153278051316924416, 1153278051316924416]", + "[1153278051316924417, 1153278053464408063]", + "[1153278089971630080, 1153278089971630080]", + "[1153278197345812480, 1153278197345812480]", + "[1153278197345812481, 1153278199493296127]", + "[1153278199493296129, 1153278201640779775]", + "[1153278201640779777, 1153278202177650687]", + "[1153278202177650689, 1153278202714521599]", + "[1153278202714521600, 1153278202714521600]", + "[1153278205935747072, 1153278205935747072]", + "[1153278208083230721, 1153278208620101631]", + "[1153278208620101633, 1153278208754319359]", + "[1153278208888537088, 1153278208888537088]", + "[1153278208888537089, 1153278209022754815]", + "[1153278209022754817, 1153278209156972543]", + "[1153278209156972544, 1153278209156972544]", + "[1153278209156972545, 1153278209693843455]", + "[1153278209693843457, 1153278210230714367]", + "[1153278210230714368, 1153278210230714368]", + "[1153278210230714369, 1153278212378198015]", + "[1153278212378198017, 1153278212915068927]", + "[1153278212915068929, 1153278213049286655]", + "[1153278213049286657, 1153278213082841087]", + "[1153278213116395520, 1153278213116395520]", + "[1153278213116395521, 1153278213149949951]", + "[1153278213149949953, 1153278213183504383]", + "[1153278213183504384, 1153278213183504384]", + "[1153278213183504385, 1153278213317722111]", + "[1153278213317722113, 1153278213451939839]", + "[1153278213451939840, 1153278213451939840]", + "[1153278213451939841, 1153278213988810751]", + "[1153278213988810753, 1153278214525681663]", + "[1153278214525681664, 1153278214525681664]", + "[1153278214525681665, 1153278216673165311]", + "[1153278216673165313, 1153278218820648959]", + "[1153278220968132609, 1153278223115616255]", + "[1153278223115616256, 1153278223115616256]", + "[1153278227410583552, 1153278227410583552]", + "[1153278845885874176, 1153278845885874176]", + "[1153290940513779712, 1153290940513779712]", + "[1154047404513689600, 1154047404513689600]", + "[1157425104234217472, 1157425104234217472]", + "[1170935903116328960, 1170935903116328960]", + "[1224979098644774912, 1224979098644774912]" + ] + }, + "keysExamined" : 4, + "seeks" : 5, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 0, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[1153202979583557632, 1153202979583557632]", + "[1153273348327735296, 1153273348327735296]", + "[1153277746374246400, 1153277746374246400]", + "[1153277763554115584, 1153277763554115584]", + "[1153277763554115585, 1153277772144050175]", + "[1153277780733984769, 1153277815093723135]", + "[1153277815093723136, 1153277815093723136]", + "[1153277849453461505, 1153277883813199871]", + "[1153277883813199873, 1153277918172938239]", + "[1153277935352807424, 1153277935352807424]", + "[1153277948237709312, 1153277948237709312]", + "[1153277950385192961, 1153277952532676607]", + "[1153277952532676608, 1153277952532676608]", + "[1153277952532676609, 1153277961122611199]", + "[1153277969712545792, 1153277969712545792]", + "[1153277978302480385, 1153277986892414975]", + "[1153277986892414977, 1153277989039898623]", + "[1153277991187382272, 1153277991187382272]", + "[1153277993334865921, 1153277995482349567]", + "[1153277995482349569, 1153277997629833215]", + "[1153277997629833217, 1153277999777316863]", + "[1153277999777316864, 1153277999777316864]", + "[1153277999777316865, 1153278001924800511]", + "[1153278001924800513, 1153278002461671423]", + "[1153278002461671425, 1153278002998542335]", + "[1153278002998542336, 1153278002998542336]", + "[1153278002998542337, 1153278003535413247]", + "[1153278004072284160, 1153278004072284160]", + "[1153278021252153344, 1153278021252153344]", + "[1153278031989571585, 1153278034137055231]", + "[1153278034137055232, 1153278034137055232]", + "[1153278034137055233, 1153278036284538879]", + "[1153278038432022528, 1153278038432022528]", + "[1153278038432022529, 1153278047021957119]", + "[1153278047021957121, 1153278049169440767]", + "[1153278049169440769, 1153278049706311679]", + "[1153278049706311681, 1153278049840529407]", + "[1153278049840529409, 1153278049974747135]", + "[1153278049974747136, 1153278049974747136]", + "[1153278049974747137, 1153278050008301567]", + "[1153278050008301569, 1153278050041855999]", + "[1153278050041856000, 1153278050041856000]", + "[1153278050041856001, 1153278050050244607]", + "[1153278050050244609, 1153278050058633215]", + "[1153278050058633216, 1153278050058633216]", + "[1153278050067021825, 1153278050075410431]", + "[1153278050075410433, 1153278050108964863]", + "[1153278050108964865, 1153278050243182591]", + "[1153278050243182592, 1153278050243182592]", + "[1153278050780053505, 1153278051316924415]", + "[1153278051316924416, 1153278051316924416]", + "[1153278053464408065, 1153278055611891711]", + "[1153278055611891713, 1153278064201826303]", + "[1153278072791760896, 1153278072791760896]", + "[1153278081381695489, 1153278089971630079]", + "[1153278089971630080, 1153278089971630080]", + "[1153278089971630081, 1153278090005184511]", + "[1153278090038738944, 1153278090038738944]", + "[1153278090240065536, 1153278090240065536]", + "[1153278091045371904, 1153278091045371904]", + "[1153278094266597376, 1153278094266597376]", + "[1153278107151499264, 1153278107151499264]", + "[1153278132921303041, 1153278141511237631]", + "[1153278141511237632, 1153278141511237632]", + "[1153278141511237633, 1153278150101172223]", + "[1153278175870976000, 1153278175870976000]", + "[1153278175870976001, 1153278184460910591]", + "[1153278184460910593, 1153278193050845183]", + "[1153278193050845185, 1153278195198328831]", + "[1153278195198328833, 1153278197345812479]", + "[1153278197345812480, 1153278197345812480]", + "[1153278210230714368, 1153278210230714368]", + "[1153278218820648961, 1153278220968132607]", + "[1153278223115616256, 1153278223115616256]", + "[1153278223115616257, 1153278225263099903]", + "[1153278225263099905, 1153278227410583551]", + "[1153278227410583552, 1153278227410583552]", + "[1153278227410583553, 1153278261770321919]", + "[1153278270360256513, 1153278278950191103]", + "[1153278278950191104, 1153278278950191104]", + "[1153278845885874176, 1153278845885874176]", + "[1153290940513779712, 1153290940513779712]", + "[1154047404513689600, 1154047404513689600]", + "[1157425104234217472, 1157425104234217472]", + "[1170935903116328960, 1170935903116328960]", + "[1224979098644774912, 1224979098644774912]" + ] + }, + "keysExamined" : 4, + "seeks" : 5, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 0, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[1153202979583557632, 1153202979583557632]", + "[1153273348327735296, 1153273348327735296]", + "[1153274447839363072, 1153274447839363072]", + "[1153274722717270016, 1153274722717270016]", + "[1153274791436746752, 1153274791436746752]", + "[1153274791436746753, 1153274825796485119]", + "[1153276646862618624, 1153276646862618624]", + "[1153276921740525568, 1153276921740525568]", + "[1153277127898955776, 1153277127898955776]", + "[1153277162258694145, 1153277196618432511]", + "[1153277196618432513, 1153277334057385983]", + "[1153277471496339456, 1153277471496339456]", + "[1153277608935292929, 1153277746374246399]", + "[1153277746374246400, 1153277746374246400]", + "[1153277746374246401, 1153277754964180991]", + "[1153277754964180993, 1153277763554115583]", + "[1153277763554115584, 1153277763554115584]", + "[1153277772144050177, 1153277780733984767]", + "[1153277815093723136, 1153277815093723136]", + "[1153277918172938241, 1153277926762872831]", + "[1153277926762872833, 1153277935352807423]", + "[1153277935352807424, 1153277935352807424]", + "[1153277935352807425, 1153277943942742015]", + "[1153277943942742017, 1153277946090225663]", + "[1153277946090225665, 1153277948237709311]", + "[1153277948237709312, 1153277948237709312]", + "[1153277948237709313, 1153277950385192959]", + "[1153277952532676608, 1153277952532676608]", + "[1153277961122611201, 1153277969712545791]", + "[1153277969712545792, 1153277969712545792]", + "[1153277969712545793, 1153277978302480383]", + "[1153278021252153344, 1153278021252153344]", + "[1153278064201826305, 1153278072791760895]", + "[1153278072791760896, 1153278072791760896]", + "[1153278072791760897, 1153278081381695487]", + "[1153278089971630080, 1153278089971630080]", + "[1153278090005184513, 1153278090038738943]", + "[1153278090038738944, 1153278090038738944]", + "[1153278090038738945, 1153278090072293375]", + "[1153278090072293377, 1153278090105847807]", + "[1153278090105847809, 1153278090240065535]", + "[1153278090240065536, 1153278090240065536]", + "[1153278090240065537, 1153278090374283263]", + "[1153278090374283265, 1153278090508500991]", + "[1153278090508500993, 1153278091045371903]", + "[1153278091045371904, 1153278091045371904]", + "[1153278091045371905, 1153278091582242815]", + "[1153278091582242817, 1153278092119113727]", + "[1153278092119113729, 1153278094266597375]", + "[1153278094266597376, 1153278094266597376]", + "[1153278094266597377, 1153278096414081023]", + "[1153278096414081025, 1153278098561564671]", + "[1153278098561564673, 1153278107151499263]", + "[1153278107151499264, 1153278107151499264]", + "[1153278107151499265, 1153278115741433855]", + "[1153278115741433857, 1153278124331368447]", + "[1153278124331368449, 1153278132921303039]", + "[1153278141511237632, 1153278141511237632]", + "[1153278150101172225, 1153278158691106815]", + "[1153278158691106817, 1153278167281041407]", + "[1153278167281041409, 1153278175870975999]", + "[1153278175870976000, 1153278175870976000]", + "[1153278227410583552, 1153278227410583552]", + "[1153278261770321921, 1153278270360256511]", + "[1153278278950191104, 1153278278950191104]", + "[1153278278950191105, 1153278287540125695]", + "[1153278287540125697, 1153278296130060287]", + "[1153278296130060289, 1153278433569013759]", + "[1153278571007967232, 1153278571007967232]", + "[1153278708446920705, 1153278845885874175]", + "[1153278845885874176, 1153278845885874176]", + "[1153278845885874177, 1153278854475808767]", + "[1153278863065743360, 1153278863065743360]", + "[1153278914605350912, 1153278914605350912]", + "[1153279120763781120, 1153279120763781120]", + "[1153279533080641537, 1153279670519595007]", + "[1153279670519595008, 1153279670519595008]", + "[1153279670519595009, 1153279807958548479]", + "[1153280220275408896, 1153280220275408896]", + "[1153280426433839104, 1153280426433839104]", + "[1153280477973446656, 1153280477973446656]", + "[1153280486563381249, 1153280495153315839]", + "[1153280495153315841, 1153280632592269311]", + "[1153280632592269313, 1153280770031222783]", + "[1153280770031222784, 1153280770031222784]", + "[1153281044909129728, 1153281044909129728]", + "[1153290940513779712, 1153290940513779712]", + "[1154047404513689600, 1154047404513689600]", + "[1157425104234217472, 1157425104234217472]", + "[1170935903116328960, 1170935903116328960]", + "[1224979098644774912, 1224979098644774912]" + ] + }, + "keysExamined" : 4, + "seeks" : 5, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 0, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[1153202979583557632, 1153202979583557632]", + "[1153273348327735296, 1153273348327735296]", + "[1153274172961456128, 1153274172961456128]", + "[1153274241680932864, 1153274241680932864]", + "[1153274241680932865, 1153274276040671231]", + "[1153274447839363072, 1153274447839363072]", + "[1153274447839363073, 1153274585278316543]", + "[1153274585278316545, 1153274722717270015]", + "[1153274722717270016, 1153274722717270016]", + "[1153274722717270017, 1153274757077008383]", + "[1153274757077008385, 1153274791436746751]", + "[1153274791436746752, 1153274791436746752]", + "[1153274825796485121, 1153274860156223487]", + "[1153274860156223489, 1153274997595176959]", + "[1153274997595176961, 1153275031954915327]", + "[1153275066314653696, 1153275066314653696]", + "[1153275272473083904, 1153275272473083904]", + "[1153275684789944321, 1153275822228897791]", + "[1153275822228897792, 1153275822228897792]", + "[1153275822228897793, 1153275959667851263]", + "[1153276371984711680, 1153276371984711680]", + "[1153276578143141888, 1153276578143141888]", + "[1153276629682749440, 1153276629682749440]", + "[1153276638272684033, 1153276646862618623]", + "[1153276646862618624, 1153276646862618624]", + "[1153276646862618625, 1153276784301572095]", + "[1153276784301572097, 1153276921740525567]", + "[1153276921740525568, 1153276921740525568]", + "[1153276921740525569, 1153277059179479039]", + "[1153277059179479041, 1153277093539217407]", + "[1153277093539217409, 1153277127898955775]", + "[1153277127898955776, 1153277127898955776]", + "[1153277127898955777, 1153277162258694143]", + "[1153277334057385985, 1153277471496339455]", + "[1153277471496339456, 1153277471496339456]", + "[1153277471496339457, 1153277608935292927]", + "[1153277746374246400, 1153277746374246400]", + "[1153278433569013761, 1153278571007967231]", + "[1153278571007967232, 1153278571007967232]", + "[1153278571007967233, 1153278708446920703]", + "[1153278845885874176, 1153278845885874176]", + "[1153278854475808769, 1153278863065743359]", + "[1153278863065743360, 1153278863065743360]", + "[1153278863065743361, 1153278871655677951]", + "[1153278871655677953, 1153278880245612543]", + "[1153278880245612545, 1153278914605350911]", + "[1153278914605350912, 1153278914605350912]", + "[1153278914605350913, 1153278948965089279]", + "[1153278948965089281, 1153278983324827647]", + "[1153278983324827649, 1153279120763781119]", + "[1153279120763781120, 1153279120763781120]", + "[1153279120763781121, 1153279258202734591]", + "[1153279258202734593, 1153279395641688063]", + "[1153279395641688065, 1153279533080641535]", + "[1153279670519595008, 1153279670519595008]", + "[1153279807958548481, 1153279945397501951]", + "[1153279945397501953, 1153280082836455423]", + "[1153280082836455425, 1153280220275408895]", + "[1153280220275408896, 1153280220275408896]", + "[1153280220275408897, 1153280357714362367]", + "[1153280357714362369, 1153280392074100735]", + "[1153280392074100737, 1153280426433839103]", + "[1153280426433839104, 1153280426433839104]", + "[1153280426433839105, 1153280460793577471]", + "[1153280460793577473, 1153280469383512063]", + "[1153280469383512065, 1153280477973446655]", + "[1153280477973446656, 1153280477973446656]", + "[1153280477973446657, 1153280486563381247]", + "[1153280770031222784, 1153280770031222784]", + "[1153280770031222785, 1153280907470176255]", + "[1153280907470176257, 1153281044909129727]", + "[1153281044909129728, 1153281044909129728]", + "[1153281044909129729, 1153281182348083199]", + "[1153281182348083201, 1153281319787036671]", + "[1153281319787036672, 1153281319787036672]", + "[1153281775053570049, 1153281783643504639]", + "[1153281783643504640, 1153281783643504640]", + "[1153281800823373824, 1153281800823373824]", + "[1153281869542850560, 1153281869542850560]", + "[1153286542467268608, 1153286542467268608]", + "[1153289841002151936, 1153289841002151936]", + "[1153290115880058880, 1153290115880058880]", + "[1153290115880058881, 1153290253319012351]", + "[1153290253319012353, 1153290390757965823]", + "[1153290940513779712, 1153290940513779712]", + "[1153303035141685248, 1153303035141685248]", + "[1153303035141685249, 1153303584897499135]", + "[1153304134653313024, 1153304134653313024]", + "[1153304867649880065, 1153304867683434495]", + "[1153304867683434496, 1153304867683434496]", + "[1153304867750543360, 1153304867750543360]", + "[1153304868018978816, 1153304868018978816]", + "[1153304869092720640, 1153304869092720640]", + "[1153304873387687936, 1153304873387687936]", + "[1153304890567557120, 1153304890567557120]", + "[1153304959287033856, 1153304959287033856]", + "[1153305234164940800, 1153305234164940800]", + "[1154047404513689600, 1154047404513689600]", + "[1157425104234217472, 1157425104234217472]", + "[1170935903116328960, 1170935903116328960]", + "[1224979098644774912, 1224979098644774912]" + ] + }, + "keysExamined" : 4, + "seeks" : 5, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 0, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[1153202979583557632, 1153202979583557632]", + "[1153255756141690880, 1153255756141690880]", + "[1153260154188201984, 1153260154188201984]", + "[1153263452723085312, 1153263452723085312]", + "[1153264277356806144, 1153264277356806144]", + "[1153264346076282880, 1153264346076282880]", + "[1153264397615890432, 1153264397615890432]", + "[1153264410500792320, 1153264410500792320]", + "[1153264413722017792, 1153264413722017792]", + "[1153264414527324160, 1153264414527324160]", + "[1153264414728650752, 1153264414728650752]", + "[1153264414778982400, 1153264414778982400]", + "[1153264414787371009, 1153264414795759615]", + "[1153264414795759617, 1153264552234713087]", + "[1153264552234713089, 1153265101990526975]", + "[1153265101990526977, 1153265651746340863]", + "[1153265651746340864, 1153265651746340864]", + "[1153268950281224192, 1153268950281224192]", + "[1153272248816107520, 1153272248816107520]", + "[1153272248816107521, 1153272798571921407]", + "[1153272798571921409, 1153273348327735295]", + "[1153273348327735296, 1153273348327735296]", + "[1153273348327735297, 1153273898083549183]", + "[1153273898083549185, 1153274035522502655]", + "[1153274035522502657, 1153274172961456127]", + "[1153274172961456128, 1153274172961456128]", + "[1153274172961456129, 1153274207321194495]", + "[1153274207321194497, 1153274241680932863]", + "[1153274241680932864, 1153274241680932864]", + "[1153274276040671233, 1153274310400409599]", + "[1153274310400409601, 1153274447839363071]", + "[1153274447839363072, 1153274447839363072]", + "[1153275031954915329, 1153275066314653695]", + "[1153275066314653696, 1153275066314653696]", + "[1153275066314653697, 1153275100674392063]", + "[1153275100674392065, 1153275135034130431]", + "[1153275135034130433, 1153275272473083903]", + "[1153275272473083904, 1153275272473083904]", + "[1153275272473083905, 1153275409912037375]", + "[1153275409912037377, 1153275547350990847]", + "[1153275547350990849, 1153275684789944319]", + "[1153275822228897792, 1153275822228897792]", + "[1153275959667851265, 1153276097106804735]", + "[1153276097106804737, 1153276234545758207]", + "[1153276234545758209, 1153276371984711679]", + "[1153276371984711680, 1153276371984711680]", + "[1153276371984711681, 1153276509423665151]", + "[1153276509423665153, 1153276543783403519]", + "[1153276543783403521, 1153276578143141887]", + "[1153276578143141888, 1153276578143141888]", + "[1153276578143141889, 1153276612502880255]", + "[1153276612502880257, 1153276621092814847]", + "[1153276621092814849, 1153276629682749439]", + "[1153276629682749440, 1153276629682749440]", + "[1153276629682749441, 1153276638272684031]", + "[1153276646862618624, 1153276646862618624]", + "[1153277746374246400, 1153277746374246400]", + "[1153281044909129728, 1153281044909129728]", + "[1153281319787036672, 1153281319787036672]", + "[1153281319787036673, 1153281457225990143]", + "[1153281457225990145, 1153281594664943615]", + "[1153281594664943617, 1153281732103897087]", + "[1153281732103897089, 1153281766463635455]", + "[1153281766463635457, 1153281775053570047]", + "[1153281783643504640, 1153281783643504640]", + "[1153281783643504641, 1153281792233439231]", + "[1153281792233439233, 1153281800823373823]", + "[1153281800823373824, 1153281800823373824]", + "[1153281800823373825, 1153281835183112191]", + "[1153281835183112193, 1153281869542850559]", + "[1153281869542850560, 1153281869542850560]", + "[1153281869542850561, 1153282006981804031]", + "[1153282006981804033, 1153282144420757503]", + "[1153282144420757505, 1153284343444013055]", + "[1153286542467268608, 1153286542467268608]", + "[1153288741490524161, 1153289291246338047]", + "[1153289291246338049, 1153289841002151935]", + "[1153289841002151936, 1153289841002151936]", + "[1153289841002151937, 1153289978441105407]", + "[1153289978441105409, 1153290115880058879]", + "[1153290115880058880, 1153290115880058880]", + "[1153290390757965825, 1153290940513779711]", + "[1153290940513779712, 1153290940513779712]", + "[1153290940513779713, 1153293139537035263]", + "[1153295338560290816, 1153295338560290816]", + "[1153301935630057473, 1153302485385871359]", + "[1153302485385871361, 1153303035141685247]", + "[1153303035141685248, 1153303035141685248]", + "[1153303584897499137, 1153304134653313023]", + "[1153304134653313024, 1153304134653313024]", + "[1153304134653313025, 1153304684409126911]", + "[1153304684409126913, 1153304821848080383]", + "[1153304821848080385, 1153304856207818751]", + "[1153304856207818753, 1153304864797753343]", + "[1153304864797753345, 1153304866945236991]", + "[1153304866945236993, 1153304867482107903]", + "[1153304867482107905, 1153304867616325631]", + "[1153304867616325633, 1153304867649880063]", + "[1153304867683434496, 1153304867683434496]", + "[1153304867683434497, 1153304867716988927]", + "[1153304867716988929, 1153304867750543359]", + "[1153304867750543360, 1153304867750543360]", + "[1153304867750543361, 1153304867884761087]", + "[1153304867884761089, 1153304868018978815]", + "[1153304868018978816, 1153304868018978816]", + "[1153304868018978817, 1153304868555849727]", + "[1153304868555849729, 1153304869092720639]", + "[1153304869092720640, 1153304869092720640]", + "[1153304869092720641, 1153304871240204287]", + "[1153304871240204289, 1153304873387687935]", + "[1153304873387687936, 1153304873387687936]", + "[1153304873387687937, 1153304881977622527]", + "[1153304881977622529, 1153304890567557119]", + "[1153304890567557120, 1153304890567557120]", + "[1153304890567557121, 1153304924927295487]", + "[1153304924927295489, 1153304959287033855]", + "[1153304959287033856, 1153304959287033856]", + "[1153304959287033857, 1153305096725987327]", + "[1153305096725987329, 1153305234164940799]", + "[1153305234164940800, 1153305234164940800]", + "[1153305234164940801, 1153305783920754687]", + "[1153305783920754689, 1153306333676568575]", + "[1153312930746335232, 1153312930746335232]", + "[1153316229281218560, 1153316229281218560]", + "[1153316779037032449, 1153317328792846335]", + "[1153317328792846337, 1153317878548660223]", + "[1153318428304474112, 1153318428304474112]", + "[1153318978060288001, 1153319527816101887]", + "[1153319527816101889, 1153320077571915775]", + "[1153320077571915777, 1153320627327729663]", + "[1153320627327729664, 1153320627327729664]", + "[1153321726839357440, 1153321726839357440]", + "[1153326124885868544, 1153326124885868544]", + "[1154047404513689600, 1154047404513689600]", + "[1157425104234217472, 1157425104234217472]", + "[1170935903116328960, 1170935903116328960]", + "[1224979098644774912, 1224979098644774912]" + ] + }, + "keysExamined" : 4, + "seeks" : 5, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 0, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[1153202979583557632, 1153202979583557632]", + "[1153220571769602048, 1153220571769602048]", + "[1153220571769602049, 1153229367862624255]", + "[1153255756141690880, 1153255756141690880]", + "[1153255756141690881, 1153257955164946431]", + "[1153257955164946433, 1153260154188201983]", + "[1153260154188201984, 1153260154188201984]", + "[1153260154188201985, 1153262353211457535]", + "[1153262353211457537, 1153262902967271423]", + "[1153262902967271425, 1153263452723085311]", + "[1153263452723085312, 1153263452723085312]", + "[1153263452723085313, 1153264002478899199]", + "[1153264002478899201, 1153264139917852671]", + "[1153264139917852673, 1153264277356806143]", + "[1153264277356806144, 1153264277356806144]", + "[1153264277356806145, 1153264311716544511]", + "[1153264311716544513, 1153264346076282879]", + "[1153264346076282880, 1153264346076282880]", + "[1153264346076282881, 1153264380436021247]", + "[1153264380436021249, 1153264389025955839]", + "[1153264389025955841, 1153264397615890431]", + "[1153264397615890432, 1153264397615890432]", + "[1153264397615890433, 1153264406205825023]", + "[1153264406205825025, 1153264408353308671]", + "[1153264408353308673, 1153264410500792319]", + "[1153264410500792320, 1153264410500792320]", + "[1153264410500792321, 1153264412648275967]", + "[1153264412648275969, 1153264413185146879]", + "[1153264413185146881, 1153264413722017791]", + "[1153264413722017792, 1153264413722017792]", + "[1153264413722017793, 1153264414258888703]", + "[1153264414258888705, 1153264414393106431]", + "[1153264414393106433, 1153264414527324159]", + "[1153264414527324160, 1153264414527324160]", + "[1153264414527324161, 1153264414661541887]", + "[1153264414661541889, 1153264414695096319]", + "[1153264414695096321, 1153264414728650751]", + "[1153264414728650752, 1153264414728650752]", + "[1153264414728650753, 1153264414762205183]", + "[1153264414762205185, 1153264414770593791]", + "[1153264414770593793, 1153264414778982399]", + "[1153264414778982400, 1153264414778982400]", + "[1153264414778982401, 1153264414787371007]", + "[1153265651746340864, 1153265651746340864]", + "[1153265651746340865, 1153266201502154751]", + "[1153266201502154753, 1153266751257968639]", + "[1153266751257968641, 1153268950281224191]", + "[1153268950281224192, 1153268950281224192]", + "[1153268950281224193, 1153271149304479743]", + "[1153271149304479745, 1153271699060293631]", + "[1153271699060293633, 1153272248816107519]", + "[1153272248816107520, 1153272248816107520]", + "[1153273348327735296, 1153273348327735296]", + "[1153284343444013057, 1153286542467268607]", + "[1153286542467268608, 1153286542467268608]", + "[1153286542467268609, 1153288741490524159]", + "[1153290940513779712, 1153290940513779712]", + "[1153293139537035265, 1153295338560290815]", + "[1153295338560290816, 1153295338560290816]", + "[1153295338560290817, 1153297537583546367]", + "[1153297537583546369, 1153299736606801919]", + "[1153299736606801921, 1153301935630057471]", + "[1153304134653313024, 1153304134653313024]", + "[1153306333676568577, 1153308532699824127]", + "[1153308532699824129, 1153310731723079679]", + "[1153310731723079681, 1153312930746335231]", + "[1153312930746335232, 1153312930746335232]", + "[1153312930746335233, 1153315129769590783]", + "[1153315129769590785, 1153315679525404671]", + "[1153315679525404673, 1153316229281218559]", + "[1153316229281218560, 1153316229281218560]", + "[1153316229281218561, 1153316779037032447]", + "[1153317878548660225, 1153318428304474111]", + "[1153318428304474112, 1153318428304474112]", + "[1153318428304474113, 1153318978060287999]", + "[1153320627327729664, 1153320627327729664]", + "[1153320627327729665, 1153321177083543551]", + "[1153321177083543553, 1153321726839357439]", + "[1153321726839357440, 1153321726839357440]", + "[1153321726839357441, 1153323925862612991]", + "[1153323925862612993, 1153326124885868543]", + "[1153326124885868544, 1153326124885868544]", + "[1153765929536978944, 1153765929536978944]", + "[1153977035769511936, 1153977035769511936]", + "[1153994627955556352, 1153994627955556352]", + "[1154007822095089664, 1154007822095089664]", + "[1154011120629972992, 1154011120629972992]", + "[1154011670385786881, 1154012220141600767]", + "[1154012220141600769, 1154014419164856319]", + "[1154014419164856321, 1154016618188111871]", + "[1154016618188111872, 1154016618188111872]", + "[1154029812327645184, 1154029812327645184]", + "[1154043006467178496, 1154043006467178496]", + "[1154043006467178497, 1154045205490434047]", + "[1154047404513689600, 1154047404513689600]", + "[1154799470467088384, 1154799470467088384]", + "[1154799470467088385, 1154801669490343935]", + "[1154803868513599488, 1154803868513599488]", + "[1154806067536855041, 1154808266560110591]", + "[1154808266560110592, 1154808266560110592]", + "[1154808266560110593, 1154810465583366143]", + "[1154821460699643904, 1154821460699643904]", + "[1154833005571735553, 1154833555327549439]", + "[1154833555327549440, 1154833555327549440]", + "[1154834654839177216, 1154834654839177216]", + "[1154839052885688320, 1154839052885688320]", + "[1154891829443821568, 1154891829443821568]", + "[1157425104234217472, 1157425104234217472]", + "[1170935903116328960, 1170935903116328960]", + "[1224979098644774912, 1224979098644774912]" + ] + }, + "keysExamined" : 4, + "seeks" : 5, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 0, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[1153132610839379968, 1153132610839379968]", + "[1153150203025424384, 1153150203025424384]", + "[1153150203025424385, 1153158999118446591]", + "[1153158999118446593, 1153167795211468799]", + "[1153167795211468801, 1153176591304491007]", + "[1153185387397513216, 1153185387397513216]", + "[1153198581537046528, 1153198581537046528]", + "[1153198581537046529, 1153200780560302079]", + "[1153202979583557632, 1153202979583557632]", + "[1153202979583557633, 1153211775676579839]", + "[1153211775676579841, 1153220571769602047]", + "[1153220571769602048, 1153220571769602048]", + "[1153229367862624257, 1153238163955646463]", + "[1153238163955646465, 1153246960048668671]", + "[1153246960048668673, 1153255756141690879]", + "[1153255756141690880, 1153255756141690880]", + "[1153273348327735296, 1153273348327735296]", + "[1153326124885868544, 1153326124885868544]", + "[1153326124885868545, 1153334920978890751]", + "[1153334920978890753, 1153343717071912959]", + "[1153343717071912961, 1153352513164935167]", + "[1153361309257957376, 1153361309257957376]", + "[1153370105350979585, 1153378901444001791]", + "[1153378901444001793, 1153387697537023999]", + "[1153387697537024001, 1153388247292837887]", + "[1153388797048651776, 1153388797048651776]", + "[1153389621682372608, 1153389621682372608]", + "[1153389690401849344, 1153389690401849344]", + "[1153389707581718528, 1153389707581718528]", + "[1153389711876685824, 1153389711876685824]", + "[1153389712950427648, 1153389712950427648]", + "[1153389713218863104, 1153389713218863104]", + "[1153389713285971968, 1153389713285971968]", + "[1153389713302749184, 1153389713302749184]", + "[1153389713302749185, 1153389713311137791]", + "[1153392095583535104, 1153392095583535104]", + "[1153396493630046208, 1153396493630046208]", + "[1153414085816090624, 1153414085816090624]", + "[1153530634048634881, 1153532833071890431]", + "[1153532833071890432, 1153532833071890432]", + "[1153537231118401536, 1153537231118401536]", + "[1153554823304445952, 1153554823304445952]", + "[1153765929536978944, 1153765929536978944]", + "[1153977035769511936, 1153977035769511936]", + "[1153977035769511937, 1153985831862534143]", + "[1153985831862534145, 1153994627955556351]", + "[1153994627955556352, 1153994627955556352]", + "[1153994627955556353, 1154003424048578559]", + "[1154003424048578561, 1154005623071834111]", + "[1154005623071834113, 1154007822095089663]", + "[1154007822095089664, 1154007822095089664]", + "[1154007822095089665, 1154010021118345215]", + "[1154010021118345217, 1154010570874159103]", + "[1154010570874159105, 1154011120629972991]", + "[1154011120629972992, 1154011120629972992]", + "[1154011120629972993, 1154011670385786879]", + "[1154016618188111872, 1154016618188111872]", + "[1154016618188111873, 1154018817211367423]", + "[1154018817211367425, 1154021016234622975]", + "[1154021016234622977, 1154029812327645183]", + "[1154029812327645184, 1154029812327645184]", + "[1154029812327645185, 1154038608420667391]", + "[1154038608420667393, 1154040807443922943]", + "[1154040807443922945, 1154043006467178495]", + "[1154043006467178496, 1154043006467178496]", + "[1154045205490434049, 1154047404513689599]", + "[1154047404513689600, 1154047404513689600]", + "[1154047404513689601, 1154082588885778431]", + "[1154117773257867264, 1154117773257867264]", + "[1154328879490400256, 1154328879490400256]", + "[1154786276327555073, 1154795072420577279]", + "[1154795072420577281, 1154797271443832831]", + "[1154797271443832833, 1154799470467088383]", + "[1154799470467088384, 1154799470467088384]", + "[1154801669490343937, 1154803868513599487]", + "[1154803868513599488, 1154803868513599488]", + "[1154803868513599489, 1154806067536855039]", + "[1154808266560110592, 1154808266560110592]", + "[1154810465583366145, 1154812664606621695]", + "[1154812664606621697, 1154821460699643903]", + "[1154821460699643904, 1154821460699643904]", + "[1154821460699643905, 1154830256792666111]", + "[1154830256792666113, 1154832455815921663]", + "[1154832455815921665, 1154833005571735551]", + "[1154833555327549440, 1154833555327549440]", + "[1154833555327549441, 1154834105083363327]", + "[1154834105083363329, 1154834654839177215]", + "[1154834654839177216, 1154834654839177216]", + "[1154834654839177217, 1154836853862432767]", + "[1154836853862432769, 1154839052885688319]", + "[1154839052885688320, 1154839052885688320]", + "[1154839052885688321, 1154847848978710527]", + "[1154847848978710529, 1154856645071732735]", + "[1154891829443821568, 1154891829443821568]", + "[1154938008932188161, 1154940207955443711]", + "[1154940207955443712, 1154940207955443712]", + "[1154944606001954816, 1154944606001954816]", + "[1154962198187999232, 1154962198187999232]", + "[1157425104234217472, 1157425104234217472]", + "[1170935903116328960, 1170935903116328960]", + "[1224979098644774912, 1224979098644774912]" + ] + }, + "keysExamined" : 4, + "seeks" : 5, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 0, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[1152956688978935809, 1152991873351024639]", + "[1152991873351024640, 1152991873351024640]", + "[1152991873351024641, 1153027057723113471]", + "[1153027057723113473, 1153062242095202303]", + "[1153062242095202305, 1153097426467291135]", + "[1153097426467291137, 1153132610839379967]", + "[1153132610839379968, 1153132610839379968]", + "[1153132610839379969, 1153141406932402175]", + "[1153141406932402177, 1153150203025424383]", + "[1153150203025424384, 1153150203025424384]", + "[1153176591304491009, 1153185387397513215]", + "[1153185387397513216, 1153185387397513216]", + "[1153185387397513217, 1153194183490535423]", + "[1153194183490535425, 1153196382513790975]", + "[1153196382513790977, 1153198581537046527]", + "[1153198581537046528, 1153198581537046528]", + "[1153200780560302081, 1153202979583557631]", + "[1153202979583557632, 1153202979583557632]", + "[1153352513164935169, 1153361309257957375]", + "[1153361309257957376, 1153361309257957376]", + "[1153361309257957377, 1153370105350979583]", + "[1153388247292837889, 1153388797048651775]", + "[1153388797048651776, 1153388797048651776]", + "[1153388797048651777, 1153389346804465663]", + "[1153389346804465665, 1153389484243419135]", + "[1153389484243419137, 1153389621682372607]", + "[1153389621682372608, 1153389621682372608]", + "[1153389621682372609, 1153389656042110975]", + "[1153389656042110977, 1153389690401849343]", + "[1153389690401849344, 1153389690401849344]", + "[1153389690401849345, 1153389698991783935]", + "[1153389698991783937, 1153389707581718527]", + "[1153389707581718528, 1153389707581718528]", + "[1153389707581718529, 1153389709729202175]", + "[1153389709729202177, 1153389711876685823]", + "[1153389711876685824, 1153389711876685824]", + "[1153389711876685825, 1153389712413556735]", + "[1153389712413556737, 1153389712950427647]", + "[1153389712950427648, 1153389712950427648]", + "[1153389712950427649, 1153389713084645375]", + "[1153389713084645377, 1153389713218863103]", + "[1153389713218863104, 1153389713218863104]", + "[1153389713218863105, 1153389713252417535]", + "[1153389713252417537, 1153389713285971967]", + "[1153389713285971968, 1153389713285971968]", + "[1153389713285971969, 1153389713294360575]", + "[1153389713294360577, 1153389713302749183]", + "[1153389713302749184, 1153389713302749184]", + "[1153389713311137793, 1153389713319526399]", + "[1153389713319526401, 1153389713353080831]", + "[1153389713353080833, 1153389713487298559]", + "[1153389713487298561, 1153389714024169471]", + "[1153389714024169473, 1153389716171653119]", + "[1153389716171653121, 1153389724761587711]", + "[1153389724761587713, 1153389759121326079]", + "[1153389759121326081, 1153389896560279551]", + "[1153389896560279553, 1153392095583535103]", + "[1153392095583535104, 1153392095583535104]", + "[1153392095583535105, 1153394294606790655]", + "[1153394294606790657, 1153396493630046207]", + "[1153396493630046208, 1153396493630046208]", + "[1153396493630046209, 1153405289723068415]", + "[1153405289723068417, 1153414085816090623]", + "[1153414085816090624, 1153414085816090624]", + "[1153414085816090625, 1153449270188179455]", + "[1153449270188179457, 1153484454560268287]", + "[1153484454560268289, 1153519638932357119]", + "[1153519638932357121, 1153528435025379327]", + "[1153528435025379329, 1153530634048634879]", + "[1153532833071890432, 1153532833071890432]", + "[1153532833071890433, 1153535032095145983]", + "[1153535032095145985, 1153537231118401535]", + "[1153537231118401536, 1153537231118401536]", + "[1153537231118401537, 1153546027211423743]", + "[1153546027211423745, 1153554823304445951]", + "[1153554823304445952, 1153554823304445952]", + "[1153554823304445953, 1153590007676534783]", + "[1153590007676534785, 1153625192048623615]", + "[1153695560792801280, 1153695560792801280]", + "[1153748337350934528, 1153748337350934528]", + "[1153757133443956737, 1153765929536978943]", + "[1153765929536978944, 1153765929536978944]", + "[1153765929536978945, 1153774725630001151]", + "[1153774725630001153, 1153783521723023359]", + "[1153783521723023360, 1153783521723023360]", + "[1153836298281156608, 1153836298281156608]", + "[1153871482653245441, 1153906667025334271]", + "[1153906667025334273, 1153941851397423103]", + "[1153941851397423105, 1153977035769511935]", + "[1153977035769511936, 1153977035769511936]", + "[1154047404513689600, 1154047404513689600]", + "[1154082588885778433, 1154117773257867263]", + "[1154117773257867264, 1154117773257867264]", + "[1154117773257867265, 1154152957629956095]", + "[1154152957629956097, 1154188142002044927]", + "[1154188142002044929, 1154223326374133759]", + "[1154258510746222592, 1154258510746222592]", + "[1154328879490400256, 1154328879490400256]", + "[1154539985722933248, 1154539985722933248]", + "[1154539985722933249, 1154575170095022079]", + "[1154680723211288576, 1154680723211288576]", + "[1154680723211288577, 1154715907583377407]", + "[1154715907583377409, 1154751091955466239]", + "[1154751091955466241, 1154786276327555071]", + "[1154821460699643904, 1154821460699643904]", + "[1154856645071732737, 1154891829443821567]", + "[1154891829443821568, 1154891829443821568]", + "[1154891829443821569, 1154927013815910399]", + "[1154927013815910401, 1154935809908932607]", + "[1154935809908932609, 1154938008932188159]", + "[1154940207955443712, 1154940207955443712]", + "[1154940207955443713, 1154942406978699263]", + "[1154942406978699265, 1154944606001954815]", + "[1154944606001954816, 1154944606001954816]", + "[1154944606001954817, 1154953402094977023]", + "[1154953402094977025, 1154962198187999231]", + "[1154962198187999232, 1154962198187999232]", + "[1154962198187999233, 1154997382560088063]", + "[1154997382560088065, 1155032566932176895]", + "[1155076547397287937, 1155085343490310143]", + "[1155085343490310144, 1155085343490310144]", + "[1155102935676354560, 1155102935676354560]", + "[1157425104234217472, 1157425104234217472]", + "[1170935903116328960, 1170935903116328960]", + "[1224979098644774912, 1224979098644774912]" + ] + }, + "keysExamined" : 4, + "seeks" : 5, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 2, + "executionTimeMillisEstimate" : 0, + "works" : 6, + "advanced" : 2, + "needTime" : 3, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 2, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 2, + "executionTimeMillisEstimate" : 0, + "works" : 6, + "advanced" : 2, + "needTime" : 3, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[360287970189639680, 360287970189639680]", + "[378302368699121664, 378302368699121664]", + "[382805968326492160, 382805968326492160]", + "[383931868233334784, 383931868233334784]", + "[383931868233334785, 384494818186756095]", + "[1080863910568919040, 1080863910568919040]", + "[1134907106097364992, 1134907106097364992]", + "[1144653177165971457, 1144688361538060287]", + "[1144688361538060288, 1144688361538060288]", + "[1144700078208843777, 1144700112568582143]", + "[1144700112568582144, 1144700112568582144]", + "[1144700181288058880, 1144700181288058880]", + "[1144700456165965824, 1144700456165965824]", + "[1144701555677593600, 1144701555677593600]", + "[1144705953724104704, 1144705953724104704]", + "[1144758730282237952, 1144758730282237952]", + "[1145040205258948608, 1145040205258948608]", + "[1148417904979476480, 1148417904979476480]", + "[1151795604700004352, 1151795604700004352]", + "[1151795604700004353, 1152358554653425663]", + "[1152358554653425665, 1152921504606846975]", + "[1152921504606846977, 1152956688978935807]", + "[1152991873351024640, 1152991873351024640]", + "[1153202979583557632, 1153202979583557632]", + "[1153625192048623617, 1153660376420712447]", + "[1153660376420712449, 1153695560792801279]", + "[1153695560792801280, 1153695560792801280]", + "[1153695560792801281, 1153730745164890111]", + "[1153730745164890113, 1153739541257912319]", + "[1153739541257912321, 1153748337350934527]", + "[1153748337350934528, 1153748337350934528]", + "[1153748337350934529, 1153757133443956735]", + "[1153765929536978944, 1153765929536978944]", + "[1153783521723023360, 1153783521723023360]", + "[1153783521723023361, 1153792317816045567]", + "[1153792317816045569, 1153801113909067775]", + "[1153801113909067777, 1153836298281156607]", + "[1153836298281156608, 1153836298281156608]", + "[1153836298281156609, 1153871482653245439]", + "[1154047404513689600, 1154047404513689600]", + "[1154223326374133761, 1154258510746222591]", + "[1154258510746222592, 1154258510746222592]", + "[1154258510746222593, 1154293695118311423]", + "[1154293695118311425, 1154328879490400255]", + "[1154328879490400256, 1154328879490400256]", + "[1154328879490400257, 1154469616978755583]", + "[1154469616978755585, 1154504801350844415]", + "[1154504801350844417, 1154539985722933247]", + "[1154539985722933248, 1154539985722933248]", + "[1154575170095022081, 1154610354467110911]", + "[1154610354467110913, 1154645538839199743]", + "[1154645538839199745, 1154680723211288575]", + "[1154680723211288576, 1154680723211288576]", + "[1154891829443821568, 1154891829443821568]", + "[1155032566932176897, 1155067751304265727]", + "[1155067751304265729, 1155076547397287935]", + "[1155085343490310144, 1155085343490310144]", + "[1155085343490310145, 1155094139583332351]", + "[1155094139583332353, 1155102935676354559]", + "[1155102935676354560, 1155102935676354560]", + "[1155102935676354561, 1155138120048443391]", + "[1155138120048443393, 1155173304420532223]", + "[1155173304420532225, 1155314041908887551]", + "[1155314041908887553, 1155454779397242879]", + "[1155454779397242880, 1155454779397242880]", + "[1156299204327374848, 1156299204327374848]", + "[1157143629257506816, 1157143629257506816]", + "[1157143629257506817, 1157284366745862143]", + "[1157284366745862145, 1157425104234217471]", + "[1157425104234217472, 1157425104234217472]", + "[1160380591489679361, 1160521328978034687]", + "[1160521328978034688, 1160521328978034688]", + "[1160521328978034689, 1160662066466390015]", + "[1160802803954745344, 1160802803954745344]", + "[1160943541443100673, 1161084278931455999]", + "[1161084278931456000, 1161084278931456000]", + "[1161084278931456001, 1161225016419811327]", + "[1170935903116328960, 1170935903116328960]", + "[1224979098644774912, 1224979098644774912]", + "[1919659341166673920, 1919659341166673920]", + "[1920503766096805888, 1920503766096805888]", + "[1920644503585161217, 1920785241073516543]", + "[1920785241073516545, 1921348191026937855]", + "[1921348191026937857, 1921911140980359167]", + "[1921911140980359168, 1921911140980359168]", + "[1923037040887201792, 1923037040887201792]", + "[1927540640514572288, 1927540640514572288]", + "[1945555039024054272, 1945555039024054272]" + ] + }, + "keysExamined" : 5, + "seeks" : 4, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 3, + "executionTimeMillisEstimate" : 0, + "works" : 6, + "advanced" : 3, + "needTime" : 2, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 3, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 3, + "executionTimeMillisEstimate" : 0, + "works" : 6, + "advanced" : 3, + "needTime" : 2, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[360287970189639680, 360287970189639680]", + "[378302368699121664, 378302368699121664]", + "[381680068419649536, 381680068419649536]", + "[381680068419649537, 382243018373070847]", + "[382805968326492160, 382805968326492160]", + "[382805968326492161, 383368918279913471]", + "[383368918279913473, 383931868233334783]", + "[383931868233334784, 383931868233334784]", + "[384494818186756097, 385057768140177407]", + "[385057768140177409, 385620718093598719]", + "[386183668047020032, 386183668047020032]", + "[1080863910568919040, 1080863910568919040]", + "[1134907106097364992, 1134907106097364992]", + "[1143914305352105985, 1144477255305527295]", + "[1144477255305527297, 1144617992793882623]", + "[1144617992793882625, 1144653177165971455]", + "[1144688361538060288, 1144688361538060288]", + "[1144688361538060289, 1144697157631082495]", + "[1144697157631082497, 1144699356654338047]", + "[1144699356654338049, 1144699906410151935]", + "[1144699906410151937, 1144700043849105407]", + "[1144700043849105409, 1144700078208843775]", + "[1144700112568582144, 1144700112568582144]", + "[1144700112568582145, 1144700146928320511]", + "[1144700146928320513, 1144700181288058879]", + "[1144700181288058880, 1144700181288058880]", + "[1144700181288058881, 1144700318727012351]", + "[1144700318727012353, 1144700456165965823]", + "[1144700456165965824, 1144700456165965824]", + "[1144700456165965825, 1144701005921779711]", + "[1144701005921779713, 1144701555677593599]", + "[1144701555677593600, 1144701555677593600]", + "[1144701555677593601, 1144703754700849151]", + "[1144703754700849153, 1144705953724104703]", + "[1144705953724104704, 1144705953724104704]", + "[1144705953724104705, 1144714749817126911]", + "[1144714749817126913, 1144723545910149119]", + "[1144723545910149121, 1144758730282237951]", + "[1144758730282237952, 1144758730282237952]", + "[1144758730282237953, 1144899467770593279]", + "[1144899467770593281, 1145040205258948607]", + "[1145040205258948608, 1145040205258948608]", + "[1145040205258948609, 1145603155212369919]", + "[1145603155212369921, 1146166105165791231]", + "[1147292005072633856, 1147292005072633856]", + "[1148136430002765824, 1148136430002765824]", + "[1148277167491121153, 1148417904979476479]", + "[1148417904979476480, 1148417904979476480]", + "[1148417904979476481, 1148980854932897791]", + "[1149543804886319104, 1149543804886319104]", + "[1150106754839740417, 1150669704793161727]", + "[1150669704793161729, 1151232654746583039]", + "[1151232654746583041, 1151795604700004351]", + "[1151795604700004352, 1151795604700004352]", + "[1155454779397242880, 1155454779397242880]", + "[1155454779397242881, 1155595516885598207]", + "[1155595516885598209, 1155736254373953535]", + "[1155736254373953537, 1156299204327374847]", + "[1156299204327374848, 1156299204327374848]", + "[1156299204327374849, 1156862154280796159]", + "[1156862154280796161, 1157002891769151487]", + "[1157002891769151489, 1157143629257506815]", + "[1157143629257506816, 1157143629257506816]", + "[1157425104234217472, 1157425104234217472]", + "[1157425104234217473, 1159676904047902719]", + "[1159676904047902721, 1160239854001324031]", + "[1160239854001324033, 1160380591489679359]", + "[1160521328978034688, 1160521328978034688]", + "[1160662066466390017, 1160802803954745343]", + "[1160802803954745344, 1160802803954745344]", + "[1160802803954745345, 1160943541443100671]", + "[1161084278931456000, 1161084278931456000]", + "[1161225016419811329, 1161365753908166655]", + "[1161365753908166657, 1161928703861587967]", + "[1170935903116328960, 1170935903116328960]", + "[1224979098644774912, 1224979098644774912]", + "[1918533441259831297, 1919096391213252607]", + "[1919096391213252609, 1919659341166673919]", + "[1919659341166673920, 1919659341166673920]", + "[1919659341166673921, 1920222291120095231]", + "[1920222291120095233, 1920363028608450559]", + "[1920363028608450561, 1920503766096805887]", + "[1920503766096805888, 1920503766096805888]", + "[1920503766096805889, 1920644503585161215]", + "[1921911140980359168, 1921911140980359168]", + "[1921911140980359169, 1922474090933780479]", + "[1922474090933780481, 1923037040887201791]", + "[1923037040887201792, 1923037040887201792]", + "[1923037040887201793, 1923599990840623103]", + "[1923599990840623105, 1924162940794044415]", + "[1924162940794044416, 1924162940794044416]", + "[1925992528142663681, 1926133265631019007]", + "[1926133265631019008, 1926133265631019008]", + "[1926414740607729664, 1926414740607729664]", + "[1927540640514572288, 1927540640514572288]", + "[1945555039024054272, 1945555039024054272]" + ] + }, + "keysExamined" : 5, + "seeks" : 3, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 2, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 2, + "needTime" : 2, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 2, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 2, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 2, + "needTime" : 2, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[360287970189639680, 360287970189639680]", + "[373798769071751168, 373798769071751168]", + "[373798769071751169, 376050568885436415]", + "[376050568885436417, 376613518838857727]", + "[377176468792279040, 377176468792279040]", + "[378020893722411008, 378020893722411008]", + "[378091262466588672, 378091262466588672]", + "[378091262466588673, 378126446838677503]", + "[378302368699121664, 378302368699121664]", + "[378302368699121665, 380554168512806911]", + "[380554168512806913, 381117118466228223]", + "[381117118466228225, 381680068419649535]", + "[381680068419649536, 381680068419649536]", + "[382243018373070849, 382805968326492159]", + "[382805968326492160, 382805968326492160]", + "[385620718093598721, 386183668047020031]", + "[386183668047020032, 386183668047020032]", + "[386183668047020033, 386746618000441343]", + "[386746618000441345, 387309567953862655]", + "[387309567953862657, 389561367767547903]", + "[389561367767547905, 391813167581233151]", + "[391813167581233152, 391813167581233152]", + "[1080863910568919040, 1080863910568919040]", + "[1119144507401568257, 1121396307215253503]", + "[1121396307215253504, 1121396307215253504]", + "[1121396307215253505, 1123648107028938751]", + "[1130403506469994496, 1130403506469994496]", + "[1133781206190522368, 1133781206190522368]", + "[1134344156143943681, 1134907106097364991]", + "[1134907106097364992, 1134907106097364992]", + "[1134907106097364993, 1143914305352105983]", + "[1146166105165791233, 1146729055119212543]", + "[1146729055119212545, 1147292005072633855]", + "[1147292005072633856, 1147292005072633856]", + "[1147292005072633857, 1147854955026055167]", + "[1147854955026055169, 1147995692514410495]", + "[1147995692514410497, 1148136430002765823]", + "[1148136430002765824, 1148136430002765824]", + "[1148136430002765825, 1148277167491121151]", + "[1148417904979476480, 1148417904979476480]", + "[1148980854932897793, 1149543804886319103]", + "[1149543804886319104, 1149543804886319104]", + "[1149543804886319105, 1150106754839740415]", + "[1161928703861587969, 1170935903116328959]", + "[1170935903116328960, 1170935903116328960]", + "[1170935903116328961, 1173187702930014207]", + "[1175439502743699456, 1175439502743699456]", + "[1179943102371069953, 1188950301625810943]", + "[1224979098644774912, 1224979098644774912]", + "[1909526242005090305, 1918533441259831295]", + "[1923037040887201792, 1923037040887201792]", + "[1924162940794044416, 1924162940794044416]", + "[1924162940794044417, 1924725890747465727]", + "[1924725890747465729, 1925288840700887039]", + "[1925288840700887041, 1925851790654308351]", + "[1925851790654308353, 1925992528142663679]", + "[1926133265631019008, 1926133265631019008]", + "[1926133265631019009, 1926274003119374335]", + "[1926274003119374337, 1926414740607729663]", + "[1926414740607729664, 1926414740607729664]", + "[1926414740607729665, 1926977690561150975]", + "[1926977690561150977, 1927540640514572287]", + "[1927540640514572288, 1927540640514572288]", + "[1927540640514572289, 1929792440328257535]", + "[1929792440328257537, 1932044240141942783]", + "[1932044240141942784, 1932044240141942784]", + "[1939362589536419841, 1939925539489841151]", + "[1939925539489841152, 1939925539489841152]", + "[1941051439396683776, 1941051439396683776]", + "[1945555039024054272, 1945555039024054272]" + ] + }, + "keysExamined" : 4, + "seeks" : 3, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 2, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 2, + "needTime" : 2, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 2, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 2, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 2, + "needTime" : 2, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[342273571680157696, 342273571680157696]", + "[342273571680157697, 351280770934898687]", + "[351280770934898689, 353532570748583935]", + "[355784370562269184, 355784370562269184]", + "[358036170375954433, 360287970189639679]", + "[360287970189639680, 360287970189639680]", + "[360287970189639681, 369295169444380671]", + "[369295169444380673, 371546969258065919]", + "[371546969258065921, 373798769071751167]", + "[373798769071751168, 373798769071751168]", + "[376613518838857729, 377176468792279039]", + "[377176468792279040, 377176468792279040]", + "[377176468792279041, 377739418745700351]", + "[377739418745700353, 377880156234055679]", + "[377880156234055681, 378020893722411007]", + "[378020893722411008, 378020893722411008]", + "[378020893722411009, 378056078094499839]", + "[378056078094499841, 378091262466588671]", + "[378091262466588672, 378091262466588672]", + "[378126446838677505, 378161631210766335]", + "[378161631210766337, 378302368699121663]", + "[378302368699121664, 378302368699121664]", + "[391813167581233152, 391813167581233152]", + "[391813167581233153, 394064967394918399]", + "[394064967394918401, 396316767208603647]", + "[396316767208603649, 405323966463344639]", + "[405323966463344641, 414331165718085631]", + "[414331165718085632, 414331165718085632]", + "[1008806316530991105, 1044835113549955071]", + "[1062849512059437056, 1062849512059437056]", + "[1076360310941548544, 1076360310941548544]", + "[1079738010662076416, 1079738010662076416]", + "[1080300960615497729, 1080863910568919039]", + "[1080863910568919040, 1080863910568919040]", + "[1080863910568919041, 1089871109823660031]", + "[1098878309078401024, 1098878309078401024]", + "[1107885508333142017, 1116892707587883007]", + "[1116892707587883009, 1119144507401568255]", + "[1121396307215253504, 1121396307215253504]", + "[1123648107028938753, 1125899906842623999]", + "[1125899906842624001, 1128151706656309247]", + "[1128151706656309249, 1130403506469994495]", + "[1130403506469994496, 1130403506469994496]", + "[1130403506469994497, 1132655306283679743]", + "[1132655306283679745, 1133218256237101055]", + "[1133218256237101057, 1133781206190522367]", + "[1133781206190522368, 1133781206190522368]", + "[1133781206190522369, 1134344156143943679]", + "[1134907106097364992, 1134907106097364992]", + "[1170935903116328960, 1170935903116328960]", + "[1173187702930014209, 1175439502743699455]", + "[1175439502743699456, 1175439502743699456]", + "[1175439502743699457, 1177691302557384703]", + "[1177691302557384705, 1179943102371069951]", + "[1188950301625810945, 1224979098644774911]", + "[1224979098644774912, 1224979098644774912]", + "[1224979098644774913, 1233986297899515903]", + "[1242993497154256896, 1242993497154256896]", + "[1261007895663738881, 1297036692682702847]", + "[1873497444986126337, 1909526242005090303]", + "[1927540640514572288, 1927540640514572288]", + "[1932044240141942784, 1932044240141942784]", + "[1932044240141942785, 1934296039955628031]", + "[1934296039955628033, 1936547839769313279]", + "[1936547839769313281, 1938799639582998527]", + "[1938799639582998529, 1939362589536419839]", + "[1939925539489841152, 1939925539489841152]", + "[1939925539489841153, 1940488489443262463]", + "[1940488489443262465, 1941051439396683775]", + "[1941051439396683776, 1941051439396683776]", + "[1941051439396683777, 1943303239210369023]", + "[1943303239210369025, 1945555039024054271]", + "[1945555039024054272, 1945555039024054272]", + "[1945555039024054273, 1954562238278795263]", + "[1954562238278795265, 1963569437533536255]", + "[1963569437533536256, 1963569437533536256]", + "[1993405785064865793, 1993968735018287103]", + "[1993968735018287104, 1993968735018287104]", + "[1995094634925129728, 1995094634925129728]", + "[1999598234552500224, 1999598234552500224]" + ] + }, + "keysExamined" : 4, + "seeks" : 3, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 2, + "advanced" : 0, + "needTime" : 1, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 0, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 2, + "advanced" : 0, + "needTime" : 1, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[144115188075855873, 288230376151711743]", + "[288230376151711745, 324259173170675711]", + "[324259173170675713, 333266372425416703]", + "[333266372425416705, 342273571680157695]", + "[342273571680157696, 342273571680157696]", + "[353532570748583937, 355784370562269183]", + "[355784370562269184, 355784370562269184]", + "[355784370562269185, 358036170375954431]", + "[360287970189639680, 360287970189639680]", + "[414331165718085632, 414331165718085632]", + "[414331165718085633, 423338364972826623]", + "[423338364972826625, 432345564227567615]", + "[432345564227567617, 468374361246531583]", + "[468374361246531585, 504403158265495551]", + "[504403158265495552, 504403158265495552]", + "[612489549322387457, 648518346341351423]", + "[648518346341351424, 648518346341351424]", + "[648518346341351425, 684547143360315391]", + "[792633534417207296, 792633534417207296]", + "[846676729945653248, 846676729945653248]", + "[860187528827764736, 860187528827764736]", + "[863565228548292608, 863565228548292608]", + "[864128178501713921, 864691128455135231]", + "[864691128455135233, 900719925474099199]", + "[936748722493063168, 936748722493063168]", + "[972777519512027137, 1008806316530991103]", + "[1044835113549955073, 1053842312804696063]", + "[1053842312804696065, 1062849512059437055]", + "[1062849512059437056, 1062849512059437056]", + "[1062849512059437057, 1071856711314178047]", + "[1071856711314178049, 1074108511127863295]", + "[1074108511127863297, 1076360310941548543]", + "[1076360310941548544, 1076360310941548544]", + "[1076360310941548545, 1078612110755233791]", + "[1078612110755233793, 1079175060708655103]", + "[1079175060708655105, 1079738010662076415]", + "[1079738010662076416, 1079738010662076416]", + "[1079738010662076417, 1080300960615497727]", + "[1080863910568919040, 1080863910568919040]", + "[1089871109823660033, 1098878309078401023]", + "[1098878309078401024, 1098878309078401024]", + "[1098878309078401025, 1107885508333142015]", + "[1224979098644774912, 1224979098644774912]", + "[1233986297899515905, 1242993497154256895]", + "[1242993497154256896, 1242993497154256896]", + "[1242993497154256897, 1252000696408997887]", + "[1252000696408997889, 1261007895663738879]", + "[1297036692682702849, 1333065489701666815]", + "[1369094286720630784, 1369094286720630784]", + "[1405123083739594753, 1441151880758558719]", + "[1441151880758558721, 1450159080013299711]", + "[1459166279268040704, 1459166279268040704]", + "[1513209474796486656, 1513209474796486656]", + "[1585267068834414593, 1729382256910270463]", + "[1729382256910270465, 1873497444986126335]", + "[1945555039024054272, 1945555039024054272]", + "[1963569437533536256, 1963569437533536256]", + "[1963569437533536257, 1972576636788277247]", + "[1972576636788277249, 1981583836043018239]", + "[1981583836043018241, 1990591035297759231]", + "[1990591035297759233, 1992842835111444479]", + "[1992842835111444481, 1993405785064865791]", + "[1993968735018287104, 1993968735018287104]", + "[1993968735018287105, 1994531684971708415]", + "[1994531684971708417, 1995094634925129727]", + "[1995094634925129728, 1995094634925129728]", + "[1995094634925129729, 1997346434738814975]", + "[1997346434738814977, 1999598234552500223]", + "[1999598234552500224, 1999598234552500224]", + "[1999598234552500225, 2008605433807241215]", + "[2008605433807241217, 2017612633061982207]", + "[2017612633061982209, 2053641430080946175]", + "[2053641430080946177, 2089670227099910143]", + "[2089670227099910144, 2089670227099910144]", + "[2209578567178649601, 2210141517132070911]", + "[2210141517132070912, 2210141517132070912]", + "[2211267417038913536, 2211267417038913536]", + "[2215771016666284032, 2215771016666284032]", + "[2233785415175766016, 2233785415175766016]" + ] + }, + "keysExamined" : 1, + "seeks" : 2, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 2, + "advanced" : 0, + "needTime" : 1, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 0, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 2, + "advanced" : 0, + "needTime" : 1, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[-8502796096475496447, -8358680908399640577]", + "[-8358680908399640575, -8214565720323784705]", + "[-7926335344172072959, -7782220156096217089]", + "[-7782220156096217087, -7638104968020361217]", + "[-5476377146882523135, -5332261958806667265]", + "[-5332261958806667263, -5188146770730811393]", + "[-5188146770730811391, -5044031582654955521]", + "[-4755801206503243775, -4611686018427387905]", + "[1, 144115188075855871]", + "[504403158265495552, 504403158265495552]", + "[504403158265495553, 540431955284459519]", + "[540431955284459521, 576460752303423487]", + "[576460752303423489, 612489549322387455]", + "[648518346341351424, 648518346341351424]", + "[684547143360315393, 720575940379279359]", + "[720575940379279361, 756604737398243327]", + "[756604737398243329, 792633534417207295]", + "[792633534417207296, 792633534417207296]", + "[792633534417207297, 828662331436171263]", + "[828662331436171265, 837669530690912255]", + "[837669530690912257, 846676729945653247]", + "[846676729945653248, 846676729945653248]", + "[846676729945653249, 855683929200394239]", + "[855683929200394241, 857935729014079487]", + "[857935729014079489, 860187528827764735]", + "[860187528827764736, 860187528827764736]", + "[860187528827764737, 862439328641449983]", + "[862439328641449985, 863002278594871295]", + "[863002278594871297, 863565228548292607]", + "[863565228548292608, 863565228548292608]", + "[863565228548292609, 864128178501713919]", + "[900719925474099201, 936748722493063167]", + "[936748722493063168, 936748722493063168]", + "[936748722493063169, 972777519512027135]", + "[1333065489701666817, 1369094286720630783]", + "[1369094286720630784, 1369094286720630784]", + "[1369094286720630785, 1405123083739594751]", + "[1450159080013299713, 1459166279268040703]", + "[1459166279268040704, 1459166279268040704]", + "[1459166279268040705, 1468173478522781695]", + "[1468173478522781697, 1477180677777522687]", + "[1477180677777522689, 1513209474796486655]", + "[1513209474796486656, 1513209474796486656]", + "[1513209474796486657, 1549238271815450623]", + "[1549238271815450625, 1585267068834414591]", + "[2089670227099910144, 2089670227099910144]", + "[2089670227099910145, 2125699024118874111]", + "[2125699024118874113, 2161727821137838079]", + "[2161727821137838081, 2197756618156802047]", + "[2197756618156802049, 2206763817411543039]", + "[2206763817411543041, 2209015617225228287]", + "[2209015617225228289, 2209578567178649599]", + "[2210141517132070912, 2210141517132070912]", + "[2210141517132070913, 2210704467085492223]", + "[2210704467085492225, 2211267417038913535]", + "[2211267417038913536, 2211267417038913536]", + "[2211267417038913537, 2213519216852598783]", + "[2213519216852598785, 2215771016666284031]", + "[2215771016666284032, 2215771016666284032]", + "[2215771016666284033, 2224778215921025023]", + "[2224778215921025025, 2233785415175766015]", + "[2233785415175766016, 2233785415175766016]", + "[2233785415175766017, 2269814212194729983]", + "[2269814212194729985, 2305843009213693951]", + "[2305843009213693953, 2449958197289549823]", + "[2449958197289549825, 2594073385365405695]", + "[4323455642275676161, 4467570830351532031]", + "[4467570830351532033, 4611686018427387903]", + "[4611686018427387905, 4755801206503243775]", + "[5044031582654955521, 5188146770730811391]", + "[5188146770730811393, 5332261958806667263]", + "[5332261958806667265, 5476377146882523135]" + ] + }, + "keysExamined" : 1, + "seeks" : 2, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 2, + "advanced" : 0, + "needTime" : 1, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 0, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 2, + "advanced" : 0, + "needTime" : 1, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[-9223372036854775807, -8646911284551352321]", + "[-8646911284551352319, -8502796096475496449]", + "[-8214565720323784703, -8070450532247928833]", + "[-8070450532247928831, -7926335344172072961]", + "[-7638104968020361215, -7493989779944505345]", + "[-7493989779944505343, -6917529027641081857]", + "[-6917529027641081855, -6341068275337658369]", + "[-6341068275337658367, -5764607523034234881]", + "[-5764607523034234879, -5620492334958379009]", + "[-5620492334958379007, -5476377146882523137]", + "[-5044031582654955519, -4899916394579099649]", + "[-4899916394579099647, -4755801206503243777]", + "[2594073385365405697, 2738188573441261567]", + "[2738188573441261569, 2882303761517117439]", + "[2882303761517117441, 3458764513820540927]", + "[3458764513820540929, 4035225266123964415]", + "[4035225266123964417, 4179340454199820287]", + "[4179340454199820289, 4323455642275676159]", + "[4755801206503243777, 4899916394579099647]", + "[4899916394579099649, 5044031582654955519]", + "[5476377146882523137, 5620492334958379007]", + "[5620492334958379009, 5764607523034234879]", + "[5764607523034234881, 6341068275337658367]", + "[6341068275337658369, 6917529027641081855]", + "[6917529027641081857, 6926536226895822847]", + "[6935543426150563840, 6935543426150563840]", + "[6989586621679009792, 6989586621679009792]", + "[7686096451549528065, 7686237189037883391]", + "[7686237189037883392, 7686237189037883392]", + "[7686518664014594048, 7686518664014594048]", + "[7687644563921436672, 7687644563921436672]", + "[7692148163548807168, 7692148163548807168]", + "[7710162562058289152, 7710162562058289152]", + "[9151314442816847872, 9151314442816847872]", + "[9205357638345293824, 9205357638345293824]", + "[9218868437227405312, 9218868437227405312]", + "[9222246136947933184, 9222246136947933184]", + "[9223090561878065152, 9223090561878065152]", + "[9223231299366420481, 9223372036854775807]" + ] + }, + "keysExamined" : 1, + "seeks" : 2, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 1, + "advanced" : 0, + "needTime" : 0, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 0, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 1, + "advanced" : 0, + "needTime" : 0, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[6926536226895822849, 6935543426150563839]", + "[6935543426150563840, 6935543426150563840]", + "[6935543426150563841, 6944550625405304831]", + "[6944550625405304833, 6953557824660045823]", + "[6953557824660045825, 6989586621679009791]", + "[6989586621679009792, 6989586621679009792]", + "[6989586621679009793, 7025615418697973759]", + "[7025615418697973761, 7061644215716937727]", + "[7061644215716937729, 7205759403792793599]", + "[7205759403792793601, 7349874591868649471]", + "[7349874591868649473, 7493989779944505343]", + "[7493989779944505345, 7638104968020361215]", + "[7638104968020361217, 7674133765039325183]", + "[7674133765039325185, 7683140964294066175]", + "[7683140964294066177, 7685392764107751423]", + "[7685392764107751425, 7685955714061172735]", + "[7685955714061172737, 7686096451549528063]", + "[7686237189037883392, 7686237189037883392]", + "[7686237189037883393, 7686377926526238719]", + "[7686377926526238721, 7686518664014594047]", + "[7686518664014594048, 7686518664014594048]", + "[7686518664014594049, 7687081613968015359]", + "[7687081613968015361, 7687644563921436671]", + "[7687644563921436672, 7687644563921436672]", + "[7687644563921436673, 7689896363735121919]", + "[7689896363735121921, 7692148163548807167]", + "[7692148163548807168, 7692148163548807168]", + "[7692148163548807169, 7701155362803548159]", + "[7701155362803548161, 7710162562058289151]", + "[7710162562058289152, 7710162562058289152]", + "[7710162562058289153, 7746191359077253119]", + "[7746191359077253121, 7782220156096217087]", + "[7782220156096217089, 7926335344172072959]", + "[7926335344172072961, 8070450532247928831]", + "[8070450532247928833, 8646911284551352319]", + "[8646911284551352321, 8791026472627208191]", + "[8791026472627208193, 8935141660703064063]", + "[8935141660703064065, 9079256848778919935]", + "[9079256848778919937, 9115285645797883903]", + "[9115285645797883905, 9151314442816847871]", + "[9151314442816847872, 9151314442816847872]", + "[9151314442816847873, 9187343239835811839]", + "[9187343239835811841, 9196350439090552831]", + "[9196350439090552833, 9205357638345293823]", + "[9205357638345293824, 9205357638345293824]", + "[9205357638345293825, 9214364837600034815]", + "[9214364837600034817, 9216616637413720063]", + "[9216616637413720065, 9218868437227405311]", + "[9218868437227405312, 9218868437227405312]", + "[9218868437227405313, 9221120237041090559]", + "[9221120237041090561, 9221683186994511871]", + "[9221683186994511873, 9222246136947933183]", + "[9222246136947933184, 9222246136947933184]", + "[9222246136947933185, 9222809086901354495]", + "[9222809086901354497, 9222949824389709823]", + "[9222949824389709825, 9223090561878065151]", + "[9223090561878065152, 9223090561878065152]", + "[9223090561878065153, 9223231299366420479]" + ] + }, + "keysExamined" : 0, + "seeks" : 1, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + } + ] + } + } + }, + "ts" : ISODate("2017-08-20T15:39:38.432Z"), + "client" : "127.0.0.1", + "appName" : "MongoDB Shell", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/geonear_3.5.11 b/src/go/tests/doc/out/geonear_3.5.11 new file mode 100644 index 00000000..8d9b532f --- /dev/null +++ b/src/go/tests/doc/out/geonear_3.5.11 @@ -0,0 +1,3566 @@ +{ + "op" : "command", + "ns" : "test.coll", + "command" : { + "geoNear" : "coll", + "near" : { + "type" : "Point", + "coordinates" : [ + 1, + 1 + ] + }, + "spherical" : true, + "$db" : "test" + }, + "keysExamined" : 82, + "docsExamined" : 10, + "numYield" : 1, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(4) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(2) + } + }, + "Collection" : { + "acquireCount" : { + "r" : NumberLong(2) + } + } + }, + "responseLength" : 1383, + "protocol" : "op_msg", + "millis" : 7, + "planSummary" : "GEO_NEAR_2DSPHERE { loc: \"2dsphere\" }", + "execStats" : { + "stage" : "LIMIT", + "nReturned" : 10, + "executionTimeMillisEstimate" : 10, + "works" : 139, + "advanced" : 10, + "needTime" : 128, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "limitAmount" : 100, + "inputStage" : { + "stage" : "PROJECTION", + "nReturned" : 10, + "executionTimeMillisEstimate" : 10, + "works" : 139, + "advanced" : 10, + "needTime" : 128, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "transformBy" : { + "$pt" : { + "$meta" : "geoNearPoint" + }, + "$dis" : { + "$meta" : "geoNearDistance" + } + }, + "inputStage" : { + "stage" : "GEO_NEAR_2DSPHERE", + "nReturned" : 10, + "executionTimeMillisEstimate" : 10, + "works" : 139, + "advanced" : 10, + "needTime" : 128, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "indexVersion" : 2, + "searchIntervals" : [ + { + "minDistance" : 0, + "maxDistance" : 3.3284465774864755, + "maxInclusive" : false, + "nBuffered" : 1, + "nReturned" : 1 + }, + { + "minDistance" : 3.3284465774864755, + "maxDistance" : 9.985339732459426, + "maxInclusive" : false, + "nBuffered" : 0, + "nReturned" : 0 + }, + { + "minDistance" : 9.985339732459426, + "maxDistance" : 23.299126042405327, + "maxInclusive" : false, + "nBuffered" : 0, + "nReturned" : 0 + }, + { + "minDistance" : 23.299126042405327, + "maxDistance" : 49.92669866229713, + "maxInclusive" : false, + "nBuffered" : 0, + "nReturned" : 0 + }, + { + "minDistance" : 49.92669866229713, + "maxDistance" : 103.18184390208074, + "maxInclusive" : false, + "nBuffered" : 0, + "nReturned" : 0 + }, + { + "minDistance" : 103.18184390208074, + "maxDistance" : 209.69213438164797, + "maxInclusive" : false, + "nBuffered" : 0, + "nReturned" : 0 + }, + { + "minDistance" : 209.69213438164797, + "maxDistance" : 422.71271534078244, + "maxInclusive" : false, + "nBuffered" : 0, + "nReturned" : 0 + }, + { + "minDistance" : 422.71271534078244, + "maxDistance" : 848.7538772590513, + "maxInclusive" : false, + "nBuffered" : 0, + "nReturned" : 0 + }, + { + "minDistance" : 848.7538772590513, + "maxDistance" : 1700.8362010955889, + "maxInclusive" : false, + "nBuffered" : 0, + "nReturned" : 0 + }, + { + "minDistance" : 1700.8362010955889, + "maxDistance" : 3405.0008487686646, + "maxInclusive" : false, + "nBuffered" : 0, + "nReturned" : 0 + }, + { + "minDistance" : 3405.0008487686646, + "maxDistance" : 6813.330144114816, + "maxInclusive" : false, + "nBuffered" : 0, + "nReturned" : 0 + }, + { + "minDistance" : 6813.330144114816, + "maxDistance" : 13629.988734807117, + "maxInclusive" : false, + "nBuffered" : 0, + "nReturned" : 0 + }, + { + "minDistance" : 13629.988734807117, + "maxDistance" : 27263.30591619172, + "maxInclusive" : false, + "nBuffered" : 0, + "nReturned" : 0 + }, + { + "minDistance" : 27263.30591619172, + "maxDistance" : 54529.94027896093, + "maxInclusive" : false, + "nBuffered" : 0, + "nReturned" : 0 + }, + { + "minDistance" : 54529.94027896093, + "maxDistance" : 109063.20900449934, + "maxInclusive" : false, + "nBuffered" : 0, + "nReturned" : 0 + }, + { + "minDistance" : 109063.20900449934, + "maxDistance" : 218129.74645557615, + "maxInclusive" : false, + "nBuffered" : 2, + "nReturned" : 2 + }, + { + "minDistance" : 218129.74645557615, + "maxDistance" : 436262.82135772984, + "maxInclusive" : false, + "nBuffered" : 3, + "nReturned" : 1 + }, + { + "minDistance" : 436262.82135772984, + "maxDistance" : 872528.9711620372, + "maxInclusive" : false, + "nBuffered" : 2, + "nReturned" : 3 + }, + { + "minDistance" : 872528.9711620372, + "maxDistance" : 1745061.2707706518, + "maxInclusive" : false, + "nBuffered" : 2, + "nReturned" : 3 + }, + { + "minDistance" : 1745061.2707706518, + "maxDistance" : 3490125.869987881, + "maxInclusive" : false, + "nBuffered" : 0, + "nReturned" : 0 + }, + { + "minDistance" : 3490125.869987881, + "maxDistance" : 6980255.06842234, + "maxInclusive" : false, + "nBuffered" : 0, + "nReturned" : 0 + }, + { + "minDistance" : 6980255.06842234, + "maxDistance" : 13960513.465291258, + "maxInclusive" : false, + "nBuffered" : 0, + "nReturned" : 0 + }, + { + "minDistance" : 13960513.465291258, + "maxDistance" : 20037392.10386106, + "maxInclusive" : true, + "nBuffered" : 0, + "nReturned" : 0 + } + ], + "inputStages" : [ + { + "stage" : "FETCH", + "nReturned" : 1, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 1, + "needTime" : 3, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 1, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 1, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 1, + "needTime" : 3, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[1153202979583557632, 1153202979583557632]", + "[1153273348327735296, 1153273348327735296]", + "[1153277746374246400, 1153277746374246400]", + "[1153277815093723136, 1153277815093723136]", + "[1153277832273592320, 1153277832273592320]", + "[1153277836568559616, 1153277836568559616]", + "[1153277837373865984, 1153277837373865984]", + "[1153277837575192576, 1153277837575192576]", + "[1153277837625524224, 1153277837625524224]", + "[1153277837629718528, 1153277837629718528]", + "[1153277837631979521, 1153277837632012287]", + "[1153277837632012288, 1153277837632012288]", + "[1153277837632077824, 1153277837632077824]", + "[1153277837632864256, 1153277837632864256]", + "[1153277837633421313, 1153277837633454079]", + "[1153277837633454080, 1153277837633454080]", + "[1153277837633454081, 1153277837633486847]", + "[1153277837633585152, 1153277837633585152]", + "[1153277837633617921, 1153277837633650687]", + "[1153277837633650688, 1153277837633650688]", + "[1153277837633650689, 1153277837633781759]", + "[1153277837633781761, 1153277837633912831]", + "[1153277837633912833, 1153277837634043903]", + "[1153277837634043905, 1153277837634076671]", + "[1153277837634109440, 1153277837634109440]", + "[1153277837634142209, 1153277837634174975]", + "[1153277837634174976, 1153277837634174976]", + "[1153277837634371584, 1153277837634371584]", + "[1153277837634371585, 1153277837634404351]", + "[1153277837634961408, 1153277837634961408]", + "[1153277837638107136, 1153277837638107136]", + "[1153277837642301440, 1153277837642301440]", + "[1153277837646495744, 1153277837646495744]", + "[1153277837649641472, 1153277837649641472]", + "[1153277837650198529, 1153277837650231295]", + "[1153277837650231296, 1153277837650231296]", + "[1153277837650231297, 1153277837650264063]", + "[1153277837650427904, 1153277837650427904]", + "[1153277837650427905, 1153277837650558975]", + "[1153277837650558977, 1153277837650690047]", + "[1153277837650690049, 1153277837651214335]", + "[1153277837651738624, 1153277837651738624]", + "[1153277837652525056, 1153277837652525056]", + "[1153277837652557825, 1153277837652590591]", + "[1153277837652590592, 1153277837652590592]", + "[1153277837652590593, 1153277837652623359]", + "[1153277837654884352, 1153277837654884352]", + "[1153277837659078656, 1153277837659078656]", + "[1153277837709410304, 1153277837709410304]", + "[1153277837910736896, 1153277837910736896]", + "[1153278021252153344, 1153278021252153344]", + "[1153278845885874176, 1153278845885874176]", + "[1153290940513779712, 1153290940513779712]", + "[1154047404513689600, 1154047404513689600]", + "[1157425104234217472, 1157425104234217472]", + "[1170935903116328960, 1170935903116328960]", + "[1224979098644774912, 1224979098644774912]" + ] + }, + "keysExamined" : 4, + "seeks" : 4, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 0, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[1153202979583557632, 1153202979583557632]", + "[1153273348327735296, 1153273348327735296]", + "[1153277746374246400, 1153277746374246400]", + "[1153277815093723136, 1153277815093723136]", + "[1153277832273592320, 1153277832273592320]", + "[1153277836568559616, 1153277836568559616]", + "[1153277837373865984, 1153277837373865984]", + "[1153277837575192576, 1153277837575192576]", + "[1153277837625524224, 1153277837625524224]", + "[1153277837626048513, 1153277837626572799]", + "[1153277837626572800, 1153277837626572800]", + "[1153277837626703873, 1153277837626834943]", + "[1153277837626834944, 1153277837626834944]", + "[1153277837629718528, 1153277837629718528]", + "[1153277837629849601, 1153277837629980671]", + "[1153277837629980672, 1153277837629980672]", + "[1153277837630767104, 1153277837630767104]", + "[1153277837631291393, 1153277837631815679]", + "[1153277837631815681, 1153277837631946751]", + "[1153277837631946753, 1153277837631979519]", + "[1153277837632012288, 1153277837632012288]", + "[1153277837632012289, 1153277837632045055]", + "[1153277837632045057, 1153277837632077823]", + "[1153277837632077824, 1153277837632077824]", + "[1153277837632077825, 1153277837632208895]", + "[1153277837632208897, 1153277837632339967]", + "[1153277837632339969, 1153277837632864255]", + "[1153277837632864256, 1153277837632864256]", + "[1153277837632864257, 1153277837633388543]", + "[1153277837633388545, 1153277837633421311]", + "[1153277837633454080, 1153277837633454080]", + "[1153277837633486849, 1153277837633519615]", + "[1153277837633519617, 1153277837633552383]", + "[1153277837633552385, 1153277837633585151]", + "[1153277837633585152, 1153277837633585152]", + "[1153277837633585153, 1153277837633617919]", + "[1153277837633650688, 1153277837633650688]", + "[1153277837634076673, 1153277837634109439]", + "[1153277837634109440, 1153277837634109440]", + "[1153277837634109441, 1153277837634142207]", + "[1153277837634174976, 1153277837634174976]", + "[1153277837634174977, 1153277837634306047]", + "[1153277837634306049, 1153277837634338815]", + "[1153277837634338817, 1153277837634371583]", + "[1153277837634371584, 1153277837634371584]", + "[1153277837634404353, 1153277837634437119]", + "[1153277837634437121, 1153277837634961407]", + "[1153277837634961408, 1153277837634961408]", + "[1153277837634961409, 1153277837635485695]", + "[1153277837635485697, 1153277837636009983]", + "[1153277837636009985, 1153277837636141055]", + "[1153277837636141057, 1153277837636272127]", + "[1153277837636272128, 1153277837636272128]", + "[1153277837637058560, 1153277837637058560]", + "[1153277837638107136, 1153277837638107136]", + "[1153277837641252864, 1153277837641252864]", + "[1153277837641252865, 1153277837641777151]", + "[1153277837642301440, 1153277837642301440]", + "[1153277837642825729, 1153277837643350015]", + "[1153277837643350016, 1153277837643350016]", + "[1153277837643513857, 1153277837643546623]", + "[1153277837643546624, 1153277837643546624]", + "[1153277837643612160, 1153277837643612160]", + "[1153277837646495744, 1153277837646495744]", + "[1153277837646626817, 1153277837646757887]", + "[1153277837646757888, 1153277837646757888]", + "[1153277837647544320, 1153277837647544320]", + "[1153277837648068609, 1153277837648592895]", + "[1153277837648592897, 1153277837649117183]", + "[1153277837649117185, 1153277837649641471]", + "[1153277837649641472, 1153277837649641472]", + "[1153277837649641473, 1153277837650165759]", + "[1153277837650165761, 1153277837650198527]", + "[1153277837650231296, 1153277837650231296]", + "[1153277837650264065, 1153277837650296831]", + "[1153277837650296833, 1153277837650427903]", + "[1153277837650427904, 1153277837650427904]", + "[1153277837651214337, 1153277837651738623]", + "[1153277837651738624, 1153277837651738624]", + "[1153277837651738625, 1153277837652262911]", + "[1153277837652262913, 1153277837652393983]", + "[1153277837652393985, 1153277837652525055]", + "[1153277837652525056, 1153277837652525056]", + "[1153277837652525057, 1153277837652557823]", + "[1153277837652590592, 1153277837652590592]", + "[1153277837652623361, 1153277837652656127]", + "[1153277837652656129, 1153277837652787199]", + "[1153277837652787201, 1153277837653311487]", + "[1153277837653835776, 1153277837653835776]", + "[1153277837654360065, 1153277837654884351]", + "[1153277837654884352, 1153277837654884352]", + "[1153277837657702400, 1153277837657702400]", + "[1153277837657702401, 1153277837657735167]", + "[1153277837657767936, 1153277837657767936]", + "[1153277837657767937, 1153277837657899007]", + "[1153277837658030080, 1153277837658030080]", + "[1153277837658030081, 1153277837658554367]", + "[1153277837659078656, 1153277837659078656]", + "[1153277837709410304, 1153277837709410304]", + "[1153277837910736896, 1153277837910736896]", + "[1153278021252153344, 1153278021252153344]", + "[1153278845885874176, 1153278845885874176]", + "[1153290940513779712, 1153290940513779712]", + "[1154047404513689600, 1154047404513689600]", + "[1157425104234217472, 1157425104234217472]", + "[1170935903116328960, 1170935903116328960]", + "[1224979098644774912, 1224979098644774912]" + ] + }, + "keysExamined" : 4, + "seeks" : 5, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 0, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[1153202979583557632, 1153202979583557632]", + "[1153273348327735296, 1153273348327735296]", + "[1153277746374246400, 1153277746374246400]", + "[1153277815093723136, 1153277815093723136]", + "[1153277832273592320, 1153277832273592320]", + "[1153277836568559616, 1153277836568559616]", + "[1153277836836995072, 1153277836836995072]", + "[1153277836904103936, 1153277836904103936]", + "[1153277836920881152, 1153277836920881152]", + "[1153277836925075456, 1153277836925075456]", + "[1153277836925075457, 1153277836927172607]", + "[1153277836927172609, 1153277836929269759]", + "[1153277837373865984, 1153277837373865984]", + "[1153277837518569473, 1153277837520666623]", + "[1153277837520666624, 1153277837520666624]", + "[1153277837520666625, 1153277837522763775]", + "[1153277837524860928, 1153277837524860928]", + "[1153277837575192576, 1153277837575192576]", + "[1153277837610844161, 1153277837612941311]", + "[1153277837612941312, 1153277837612941312]", + "[1153277837612941313, 1153277837615038463]", + "[1153277837617135617, 1153277837625524223]", + "[1153277837625524224, 1153277837625524224]", + "[1153277837625524225, 1153277837626048511]", + "[1153277837626572800, 1153277837626572800]", + "[1153277837626572801, 1153277837626703871]", + "[1153277837626834944, 1153277837626834944]", + "[1153277837626834945, 1153277837626966015]", + "[1153277837626966017, 1153277837627097087]", + "[1153277837627097089, 1153277837627621375]", + "[1153277837627621377, 1153277837629718527]", + "[1153277837629718528, 1153277837629718528]", + "[1153277837629718529, 1153277837629849599]", + "[1153277837629980672, 1153277837629980672]", + "[1153277837629980673, 1153277837630111743]", + "[1153277837630111745, 1153277837630242815]", + "[1153277837630242817, 1153277837630767103]", + "[1153277837630767104, 1153277837630767104]", + "[1153277837630767105, 1153277837631291391]", + "[1153277837636272128, 1153277837636272128]", + "[1153277837636272129, 1153277837636403199]", + "[1153277837636403201, 1153277837636534271]", + "[1153277837636534273, 1153277837637058559]", + "[1153277837637058560, 1153277837637058560]", + "[1153277837637058561, 1153277837637582847]", + "[1153277837637582849, 1153277837638107135]", + "[1153277837638107136, 1153277837638107136]", + "[1153277837638107137, 1153277837640204287]", + "[1153277837640204289, 1153277837640728575]", + "[1153277837640728577, 1153277837641252863]", + "[1153277837641252864, 1153277837641252864]", + "[1153277837641777153, 1153277837642301439]", + "[1153277837642301440, 1153277837642301440]", + "[1153277837642301441, 1153277837642825727]", + "[1153277837643350016, 1153277837643350016]", + "[1153277837643350017, 1153277837643481087]", + "[1153277837643481089, 1153277837643513855]", + "[1153277837643546624, 1153277837643546624]", + "[1153277837643546625, 1153277837643579391]", + "[1153277837643579393, 1153277837643612159]", + "[1153277837643612160, 1153277837643612160]", + "[1153277837643612161, 1153277837643743231]", + "[1153277837643743233, 1153277837643874303]", + "[1153277837643874305, 1153277837644398591]", + "[1153277837644398593, 1153277837646495743]", + "[1153277837646495744, 1153277837646495744]", + "[1153277837646495745, 1153277837646626815]", + "[1153277837646757888, 1153277837646757888]", + "[1153277837646757889, 1153277837646888959]", + "[1153277837646888961, 1153277837647020031]", + "[1153277837647020033, 1153277837647544319]", + "[1153277837647544320, 1153277837647544320]", + "[1153277837647544321, 1153277837648068607]", + "[1153277837653311489, 1153277837653835775]", + "[1153277837653835776, 1153277837653835776]", + "[1153277837653835777, 1153277837654360063]", + "[1153277837654884352, 1153277837654884352]", + "[1153277837654884353, 1153277837656981503]", + "[1153277837656981505, 1153277837657505791]", + "[1153277837657505793, 1153277837657636863]", + "[1153277837657636865, 1153277837657669631]", + "[1153277837657669633, 1153277837657702399]", + "[1153277837657702400, 1153277837657702400]", + "[1153277837657735169, 1153277837657767935]", + "[1153277837657767936, 1153277837657767936]", + "[1153277837657899009, 1153277837658030079]", + "[1153277837658030080, 1153277837658030080]", + "[1153277837658554369, 1153277837659078655]", + "[1153277837659078656, 1153277837659078656]", + "[1153277837659078657, 1153277837661175807]", + "[1153277837661175809, 1153277837663272959]", + "[1153277837663272960, 1153277837663272960]", + "[1153277837669564417, 1153277837671661567]", + "[1153277837671661568, 1153277837671661568]", + "[1153277837671661569, 1153277837673758719]", + "[1153277837709410304, 1153277837709410304]", + "[1153277837755547648, 1153277837755547648]", + "[1153277837756596224, 1153277837756596224]", + "[1153277837756858368, 1153277837756858368]", + "[1153277837756858369, 1153277837756989439]", + "[1153277837759741952, 1153277837759741952]", + "[1153277837761839105, 1153277837763936255]", + "[1153277837763936256, 1153277837763936256]", + "[1153277837763936257, 1153277837766033407]", + "[1153277837910736896, 1153277837910736896]", + "[1153277838355333121, 1153277838357430271]", + "[1153277838357430273, 1153277838359527423]", + "[1153277838359527424, 1153277838359527424]", + "[1153277838363721728, 1153277838363721728]", + "[1153277838380498944, 1153277838380498944]", + "[1153277838447607808, 1153277838447607808]", + "[1153278021252153344, 1153278021252153344]", + "[1153278845885874176, 1153278845885874176]", + "[1153290940513779712, 1153290940513779712]", + "[1154047404513689600, 1154047404513689600]", + "[1157425104234217472, 1157425104234217472]", + "[1170935903116328960, 1170935903116328960]", + "[1224979098644774912, 1224979098644774912]" + ] + }, + "keysExamined" : 4, + "seeks" : 5, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 0, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[1153202979583557632, 1153202979583557632]", + "[1153273348327735296, 1153273348327735296]", + "[1153277746374246400, 1153277746374246400]", + "[1153277815093723136, 1153277815093723136]", + "[1153277832273592320, 1153277832273592320]", + "[1153277836568559616, 1153277836568559616]", + "[1153277836836995072, 1153277836836995072]", + "[1153277836904103936, 1153277836904103936]", + "[1153277836904103937, 1153277836912492543]", + "[1153277836912492545, 1153277836920881151]", + "[1153277836920881152, 1153277836920881152]", + "[1153277836920881153, 1153277836922978303]", + "[1153277836922978305, 1153277836925075455]", + "[1153277836925075456, 1153277836925075456]", + "[1153277836929269761, 1153277836937658367]", + "[1153277836937658369, 1153277836946046975]", + "[1153277836946046977, 1153277836946571263]", + "[1153277836947095552, 1153277836947095552]", + "[1153277836950241280, 1153277836950241280]", + "[1153277836954435584, 1153277836954435584]", + "[1153277837373865984, 1153277837373865984]", + "[1153277837440974848, 1153277837440974848]", + "[1153277837491306496, 1153277837491306496]", + "[1153277837500383233, 1153277837500415999]", + "[1153277837500416000, 1153277837500416000]", + "[1153277837500481536, 1153277837500481536]", + "[1153277837500743680, 1153277837500743680]", + "[1153277837503889408, 1153277837503889408]", + "[1153277837505986561, 1153277837508083711]", + "[1153277837508083713, 1153277837516472319]", + "[1153277837516472321, 1153277837518569471]", + "[1153277837520666624, 1153277837520666624]", + "[1153277837522763777, 1153277837524860927]", + "[1153277837524860928, 1153277837524860928]", + "[1153277837524860929, 1153277837533249535]", + "[1153277837533249537, 1153277837541638143]", + "[1153277837543735297, 1153277837545832447]", + "[1153277837545832448, 1153277837545832448]", + "[1153277837558415360, 1153277837558415360]", + "[1153277837566803969, 1153277837575192575]", + "[1153277837575192576, 1153277837575192576]", + "[1153277837575192577, 1153277837583581183]", + "[1153277837591969792, 1153277837591969792]", + "[1153277837600358401, 1153277837608747007]", + "[1153277837608747009, 1153277837610844159]", + "[1153277837612941312, 1153277837612941312]", + "[1153277837615038465, 1153277837617135615]", + "[1153277837625524224, 1153277837625524224]", + "[1153277837642301440, 1153277837642301440]", + "[1153277837659078656, 1153277837659078656]", + "[1153277837663272960, 1153277837663272960]", + "[1153277837663272961, 1153277837665370111]", + "[1153277837665370113, 1153277837667467263]", + "[1153277837667467265, 1153277837669564415]", + "[1153277837671661568, 1153277837671661568]", + "[1153277837673758721, 1153277837675855871]", + "[1153277837675855873, 1153277837709410303]", + "[1153277837709410304, 1153277837709410304]", + "[1153277837709410305, 1153277837717798911]", + "[1153277837726187520, 1153277837726187520]", + "[1153277837738770432, 1153277837738770432]", + "[1153277837738770433, 1153277837740867583]", + "[1153277837742964737, 1153277837751353343]", + "[1153277837751353345, 1153277837753450495]", + "[1153277837753450497, 1153277837755547647]", + "[1153277837755547648, 1153277837755547648]", + "[1153277837755547649, 1153277837756071935]", + "[1153277837756071937, 1153277837756596223]", + "[1153277837756596224, 1153277837756596224]", + "[1153277837756596225, 1153277837756727295]", + "[1153277837756727297, 1153277837756858367]", + "[1153277837756858368, 1153277837756858368]", + "[1153277837756989441, 1153277837757120511]", + "[1153277837757120513, 1153277837757644799]", + "[1153277837757644801, 1153277837759741951]", + "[1153277837759741952, 1153277837759741952]", + "[1153277837759741953, 1153277837761839103]", + "[1153277837763936256, 1153277837763936256]", + "[1153277837766033409, 1153277837768130559]", + "[1153277837768130561, 1153277837776519167]", + "[1153277837776519169, 1153277837784907775]", + "[1153277837793296384, 1153277837793296384]", + "[1153277837843628032, 1153277837843628032]", + "[1153277837910736896, 1153277837910736896]", + "[1153277838330167296, 1153277838330167296]", + "[1153277838334361600, 1153277838334361600]", + "[1153277838337507328, 1153277838337507328]", + "[1153277838338031617, 1153277838338555903]", + "[1153277838338555905, 1153277838346944511]", + "[1153277838346944513, 1153277838355333119]", + "[1153277838359527424, 1153277838359527424]", + "[1153277838359527425, 1153277838361624575]", + "[1153277838361624577, 1153277838363721727]", + "[1153277838363721728, 1153277838363721728]", + "[1153277838363721729, 1153277838372110335]", + "[1153277838372110337, 1153277838380498943]", + "[1153277838380498944, 1153277838380498944]", + "[1153277838447607808, 1153277838447607808]", + "[1153278021252153344, 1153278021252153344]", + "[1153278845885874176, 1153278845885874176]", + "[1153290940513779712, 1153290940513779712]", + "[1154047404513689600, 1154047404513689600]", + "[1157425104234217472, 1157425104234217472]", + "[1170935903116328960, 1170935903116328960]", + "[1224979098644774912, 1224979098644774912]" + ] + }, + "keysExamined" : 4, + "seeks" : 5, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 0, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[1153202979583557632, 1153202979583557632]", + "[1153273348327735296, 1153273348327735296]", + "[1153277746374246400, 1153277746374246400]", + "[1153277815093723136, 1153277815093723136]", + "[1153277832273592320, 1153277832273592320]", + "[1153277836568559616, 1153277836568559616]", + "[1153277836769886208, 1153277836769886208]", + "[1153277836769886209, 1153277836803440639]", + "[1153277836803440641, 1153277836836995071]", + "[1153277836836995072, 1153277836836995072]", + "[1153277836836995073, 1153277836870549503]", + "[1153277836870549505, 1153277836904103935]", + "[1153277836904103936, 1153277836904103936]", + "[1153277836946571265, 1153277836947095551]", + "[1153277836947095552, 1153277836947095552]", + "[1153277836947095553, 1153277836947619839]", + "[1153277836947619841, 1153277836948144127]", + "[1153277836948144129, 1153277836950241279]", + "[1153277836950241280, 1153277836950241280]", + "[1153277836950241281, 1153277836952338431]", + "[1153277836952338433, 1153277836954435583]", + "[1153277836954435584, 1153277836954435584]", + "[1153277836954435585, 1153277836962824191]", + "[1153277836962824193, 1153277836971212799]", + "[1153277836971212801, 1153277837004767231]", + "[1153277837004767233, 1153277837038321663]", + "[1153277837038321664, 1153277837038321664]", + "[1153277837088653312, 1153277837088653312]", + "[1153277837092847616, 1153277837092847616]", + "[1153277837092847617, 1153277837094944767]", + "[1153277837105430529, 1153277837239648255]", + "[1153277837306757120, 1153277837306757120]", + "[1153277837340311553, 1153277837373865983]", + "[1153277837373865984, 1153277837373865984]", + "[1153277837373865985, 1153277837407420415]", + "[1153277837407420417, 1153277837440974847]", + "[1153277837440974848, 1153277837440974848]", + "[1153277837440974849, 1153277837474529279]", + "[1153277837474529281, 1153277837482917887]", + "[1153277837482917889, 1153277837491306495]", + "[1153277837491306496, 1153277837491306496]", + "[1153277837491306497, 1153277837499695103]", + "[1153277837499695105, 1153277837500219391]", + "[1153277837500219393, 1153277837500350463]", + "[1153277837500350465, 1153277837500383231]", + "[1153277837500416000, 1153277837500416000]", + "[1153277837500416001, 1153277837500448767]", + "[1153277837500448769, 1153277837500481535]", + "[1153277837500481536, 1153277837500481536]", + "[1153277837500481537, 1153277837500612607]", + "[1153277837500612609, 1153277837500743679]", + "[1153277837500743680, 1153277837500743680]", + "[1153277837500743681, 1153277837501267967]", + "[1153277837501267969, 1153277837501792255]", + "[1153277837501792257, 1153277837503889407]", + "[1153277837503889408, 1153277837503889408]", + "[1153277837503889409, 1153277837505986559]", + "[1153277837541638145, 1153277837543735295]", + "[1153277837545832448, 1153277837545832448]", + "[1153277837545832449, 1153277837547929599]", + "[1153277837547929601, 1153277837550026751]", + "[1153277837550026753, 1153277837558415359]", + "[1153277837558415360, 1153277837558415360]", + "[1153277837558415361, 1153277837566803967]", + "[1153277837575192576, 1153277837575192576]", + "[1153277837583581185, 1153277837591969791]", + "[1153277837591969792, 1153277837591969792]", + "[1153277837591969793, 1153277837600358399]", + "[1153277837642301440, 1153277837642301440]", + "[1153277837709410304, 1153277837709410304]", + "[1153277837717798913, 1153277837726187519]", + "[1153277837726187520, 1153277837726187520]", + "[1153277837726187521, 1153277837734576127]", + "[1153277837734576129, 1153277837736673279]", + "[1153277837736673281, 1153277837738770431]", + "[1153277837738770432, 1153277837738770432]", + "[1153277837740867585, 1153277837742964735]", + "[1153277837784907777, 1153277837793296383]", + "[1153277837793296384, 1153277837793296384]", + "[1153277837793296385, 1153277837801684991]", + "[1153277837801684993, 1153277837810073599]", + "[1153277837810073601, 1153277837843628031]", + "[1153277837843628032, 1153277837843628032]", + "[1153277837843628033, 1153277837877182463]", + "[1153277837877182465, 1153277837910736895]", + "[1153277837910736896, 1153277837910736896]", + "[1153277837910736897, 1153277837944291327]", + "[1153277837977845760, 1153277837977845760]", + "[1153277838044954625, 1153277838179172351]", + "[1153277838179172353, 1153277838313390079]", + "[1153277838313390081, 1153277838321778687]", + "[1153277838321778689, 1153277838330167295]", + "[1153277838330167296, 1153277838330167296]", + "[1153277838330167297, 1153277838332264447]", + "[1153277838332264449, 1153277838334361599]", + "[1153277838334361600, 1153277838334361600]", + "[1153277838334361601, 1153277838336458751]", + "[1153277838336458753, 1153277838336983039]", + "[1153277838336983041, 1153277838337507327]", + "[1153277838337507328, 1153277838337507328]", + "[1153277838337507329, 1153277838338031615]", + "[1153277838380498944, 1153277838380498944]", + "[1153277838380498945, 1153277838414053375]", + "[1153277838414053377, 1153277838447607807]", + "[1153277838447607808, 1153277838447607808]", + "[1153277838447607809, 1153277838481162239]", + "[1153277838481162241, 1153277838514716671]", + "[1153277838514716672, 1153277838514716672]", + "[1153278021252153344, 1153278021252153344]", + "[1153278845885874176, 1153278845885874176]", + "[1153290940513779712, 1153290940513779712]", + "[1154047404513689600, 1154047404513689600]", + "[1157425104234217472, 1157425104234217472]", + "[1170935903116328960, 1170935903116328960]", + "[1224979098644774912, 1224979098644774912]" + ] + }, + "keysExamined" : 4, + "seeks" : 5, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 0, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[1153202979583557632, 1153202979583557632]", + "[1153273348327735296, 1153273348327735296]", + "[1153277746374246400, 1153277746374246400]", + "[1153277815093723136, 1153277815093723136]", + "[1153277832273592320, 1153277832273592320]", + "[1153277833347334144, 1153277833347334144]", + "[1153277833615769600, 1153277833615769600]", + "[1153277833682878464, 1153277833682878464]", + "[1153277833699655680, 1153277833699655680]", + "[1153277833699655681, 1153277833708044287]", + "[1153277835494817792, 1153277835494817792]", + "[1153277835494817793, 1153277836031688703]", + "[1153277836031688705, 1153277836165906431]", + "[1153277836165906433, 1153277836300124159]", + "[1153277836300124160, 1153277836300124160]", + "[1153277836434341889, 1153277836568559615]", + "[1153277836568559616, 1153277836568559616]", + "[1153277836568559617, 1153277836702777343]", + "[1153277836702777345, 1153277836736331775]", + "[1153277836736331777, 1153277836769886207]", + "[1153277836769886208, 1153277836769886208]", + "[1153277836836995072, 1153277836836995072]", + "[1153277837038321664, 1153277837038321664]", + "[1153277837038321665, 1153277837071876095]", + "[1153277837071876097, 1153277837080264703]", + "[1153277837080264705, 1153277837088653311]", + "[1153277837088653312, 1153277837088653312]", + "[1153277837088653313, 1153277837090750463]", + "[1153277837090750465, 1153277837092847615]", + "[1153277837092847616, 1153277837092847616]", + "[1153277837094944769, 1153277837097041919]", + "[1153277837097041921, 1153277837105430527]", + "[1153277837239648257, 1153277837273202687]", + "[1153277837273202689, 1153277837306757119]", + "[1153277837306757120, 1153277837306757120]", + "[1153277837306757121, 1153277837340311551]", + "[1153277837373865984, 1153277837373865984]", + "[1153277837642301440, 1153277837642301440]", + "[1153277837910736896, 1153277837910736896]", + "[1153277837944291329, 1153277837977845759]", + "[1153277837977845760, 1153277837977845760]", + "[1153277837977845761, 1153277838011400191]", + "[1153277838011400193, 1153277838044954623]", + "[1153277838447607808, 1153277838447607808]", + "[1153277838514716672, 1153277838514716672]", + "[1153277838514716673, 1153277838548271103]", + "[1153277838548271105, 1153277838581825535]", + "[1153277838581825537, 1153277838716043263]", + "[1153277838716043265, 1153277838850260991]", + "[1153277838984478720, 1153277838984478720]", + "[1153277839118696449, 1153277839252914175]", + "[1153277839252914177, 1153277839387131903]", + "[1153277839387131905, 1153277839521349631]", + "[1153277839521349632, 1153277839521349632]", + "[1153277839789785088, 1153277839789785088]", + "[1153277952532676608, 1153277952532676608]", + "[1153278004072284160, 1153278004072284160]", + "[1153278013375250433, 1153278013383639039]", + "[1153278013383639040, 1153278013383639040]", + "[1153278013400416256, 1153278013400416256]", + "[1153278013467525120, 1153278013467525120]", + "[1153278013735960576, 1153278013735960576]", + "[1153278016957186048, 1153278016957186048]", + "[1153278020178411520, 1153278020178411520]", + "[1153278020178411521, 1153278020715282431]", + "[1153278020715282433, 1153278021252153343]", + "[1153278021252153344, 1153278021252153344]", + "[1153278021252153345, 1153278021386371071]", + "[1153278021520588800, 1153278021520588800]", + "[1153278022325895168, 1153278022325895168]", + "[1153278025547120640, 1153278025547120640]", + "[1153278038432022528, 1153278038432022528]", + "[1153278089971630080, 1153278089971630080]", + "[1153278204325134337, 1153278204862005247]", + "[1153278204862005248, 1153278204862005248]", + "[1153278204862005249, 1153278205398876159]", + "[1153278205935747072, 1153278205935747072]", + "[1153278206606835713, 1153278206741053439]", + "[1153278206741053440, 1153278206741053440]", + "[1153278207009488896, 1153278207009488896]", + "[1153278210230714368, 1153278210230714368]", + "[1153278227410583552, 1153278227410583552]", + "[1153278845885874176, 1153278845885874176]", + "[1153290940513779712, 1153290940513779712]", + "[1154047404513689600, 1154047404513689600]", + "[1157425104234217472, 1157425104234217472]", + "[1170935903116328960, 1170935903116328960]", + "[1224979098644774912, 1224979098644774912]" + ] + }, + "keysExamined" : 4, + "seeks" : 5, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 0, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[1153202979583557632, 1153202979583557632]", + "[1153273348327735296, 1153273348327735296]", + "[1153277746374246400, 1153277746374246400]", + "[1153277815093723136, 1153277815093723136]", + "[1153277827978625024, 1153277827978625024]", + "[1153277829052366848, 1153277829052366848]", + "[1153277829052366849, 1153277829589237759]", + "[1153277829589237761, 1153277830126108671]", + "[1153277832273592320, 1153277832273592320]", + "[1153277832273592321, 1153277832810463231]", + "[1153277832810463233, 1153277833347334143]", + "[1153277833347334144, 1153277833347334144]", + "[1153277833347334145, 1153277833481551871]", + "[1153277833481551873, 1153277833615769599]", + "[1153277833615769600, 1153277833615769600]", + "[1153277833615769601, 1153277833649324031]", + "[1153277833649324033, 1153277833682878463]", + "[1153277833682878464, 1153277833682878464]", + "[1153277833682878465, 1153277833691267071]", + "[1153277833691267073, 1153277833699655679]", + "[1153277833699655680, 1153277833699655680]", + "[1153277833708044289, 1153277833716432895]", + "[1153277833716432897, 1153277833749987327]", + "[1153277833749987329, 1153277833884205055]", + "[1153277833884205057, 1153277834421075967]", + "[1153277834421075969, 1153277834957946879]", + "[1153277834957946881, 1153277835494817791]", + "[1153277835494817792, 1153277835494817792]", + "[1153277836300124160, 1153277836300124160]", + "[1153277836300124161, 1153277836434341887]", + "[1153277836568559616, 1153277836568559616]", + "[1153277838850260993, 1153277838984478719]", + "[1153277838984478720, 1153277838984478720]", + "[1153277838984478721, 1153277839118696447]", + "[1153277839521349632, 1153277839521349632]", + "[1153277839521349633, 1153277839655567359]", + "[1153277839655567361, 1153277839789785087]", + "[1153277839789785088, 1153277839789785088]", + "[1153277839789785089, 1153277840326655999]", + "[1153277840326656001, 1153277840863526911]", + "[1153277840863526913, 1153277841400397823]", + "[1153277841937268736, 1153277841937268736]", + "[1153277842474139649, 1153277843011010559]", + "[1153277845158494208, 1153277845158494208]", + "[1153277952532676608, 1153277952532676608]", + "[1153278004072284160, 1153278004072284160]", + "[1153278012662218753, 1153278013199089663]", + "[1153278013199089665, 1153278013333307391]", + "[1153278013333307393, 1153278013366861823]", + "[1153278013366861825, 1153278013375250431]", + "[1153278013383639040, 1153278013383639040]", + "[1153278013383639041, 1153278013392027647]", + "[1153278013392027649, 1153278013400416255]", + "[1153278013400416256, 1153278013400416256]", + "[1153278013400416257, 1153278013433970687]", + "[1153278013433970689, 1153278013467525119]", + "[1153278013467525120, 1153278013467525120]", + "[1153278013467525121, 1153278013601742847]", + "[1153278013601742849, 1153278013735960575]", + "[1153278013735960576, 1153278013735960576]", + "[1153278013735960577, 1153278014272831487]", + "[1153278014272831489, 1153278014809702399]", + "[1153278016957186048, 1153278016957186048]", + "[1153278016957186049, 1153278017494056959]", + "[1153278018030927872, 1153278018030927872]", + "[1153278018567798785, 1153278019104669695]", + "[1153278019104669697, 1153278019641540607]", + "[1153278019641540609, 1153278020178411519]", + "[1153278020178411520, 1153278020178411520]", + "[1153278021252153344, 1153278021252153344]", + "[1153278021386371073, 1153278021520588799]", + "[1153278021520588800, 1153278021520588800]", + "[1153278021520588801, 1153278021654806527]", + "[1153278021654806529, 1153278021789024255]", + "[1153278021789024257, 1153278022325895167]", + "[1153278022325895168, 1153278022325895168]", + "[1153278022325895169, 1153278022862766079]", + "[1153278022862766081, 1153278023399636991]", + "[1153278023399636993, 1153278023433191423]", + "[1153278023466745856, 1153278023466745856]", + "[1153278023668072448, 1153278023668072448]", + "[1153278024473378816, 1153278024473378816]", + "[1153278025547120640, 1153278025547120640]", + "[1153278028768346112, 1153278028768346112]", + "[1153278029036781568, 1153278029036781568]", + "[1153278029036781569, 1153278029170999295]", + "[1153278038432022528, 1153278038432022528]", + "[1153278089971630080, 1153278089971630080]", + "[1153278202714521600, 1153278202714521600]", + "[1153278202714521601, 1153278203251392511]", + "[1153278203251392513, 1153278203788263423]", + "[1153278203788263425, 1153278204325134335]", + "[1153278204862005248, 1153278204862005248]", + "[1153278205398876161, 1153278205935747071]", + "[1153278205935747072, 1153278205935747072]", + "[1153278205935747073, 1153278206472617983]", + "[1153278206472617985, 1153278206606835711]", + "[1153278206741053440, 1153278206741053440]", + "[1153278206741053441, 1153278206875271167]", + "[1153278206875271169, 1153278207009488895]", + "[1153278207009488896, 1153278207009488896]", + "[1153278207009488897, 1153278207546359807]", + "[1153278207546359809, 1153278208083230719]", + "[1153278208754319361, 1153278208888537087]", + "[1153278208888537088, 1153278208888537088]", + "[1153278209156972544, 1153278209156972544]", + "[1153278210230714368, 1153278210230714368]", + "[1153278213082841089, 1153278213116395519]", + "[1153278213116395520, 1153278213116395520]", + "[1153278213183504384, 1153278213183504384]", + "[1153278213451939840, 1153278213451939840]", + "[1153278214525681664, 1153278214525681664]", + "[1153278227410583552, 1153278227410583552]", + "[1153278845885874176, 1153278845885874176]", + "[1153290940513779712, 1153290940513779712]", + "[1154047404513689600, 1154047404513689600]", + "[1157425104234217472, 1157425104234217472]", + "[1170935903116328960, 1170935903116328960]", + "[1224979098644774912, 1224979098644774912]" + ] + }, + "keysExamined" : 4, + "seeks" : 5, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 0, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[1153202979583557632, 1153202979583557632]", + "[1153273348327735296, 1153273348327735296]", + "[1153277746374246400, 1153277746374246400]", + "[1153277815093723136, 1153277815093723136]", + "[1153277815093723137, 1153277823683657727]", + "[1153277823683657729, 1153277825831141375]", + "[1153277825831141377, 1153277827978625023]", + "[1153277827978625024, 1153277827978625024]", + "[1153277827978625025, 1153277828515495935]", + "[1153277828515495937, 1153277829052366847]", + "[1153277829052366848, 1153277829052366848]", + "[1153277830126108673, 1153277832273592319]", + "[1153277832273592320, 1153277832273592320]", + "[1153277841400397825, 1153277841937268735]", + "[1153277841937268736, 1153277841937268736]", + "[1153277841937268737, 1153277842474139647]", + "[1153277843011010561, 1153277845158494207]", + "[1153277845158494208, 1153277845158494208]", + "[1153277845158494209, 1153277847305977855]", + "[1153277847305977857, 1153277849453461503]", + "[1153277952532676608, 1153277952532676608]", + "[1153277989039898625, 1153277991187382271]", + "[1153277991187382272, 1153277991187382272]", + "[1153277991187382273, 1153277993334865919]", + "[1153277999777316864, 1153277999777316864]", + "[1153278002998542336, 1153278002998542336]", + "[1153278003535413249, 1153278004072284159]", + "[1153278004072284160, 1153278004072284160]", + "[1153278004072284161, 1153278012662218751]", + "[1153278014809702401, 1153278016957186047]", + "[1153278016957186048, 1153278016957186048]", + "[1153278017494056961, 1153278018030927871]", + "[1153278018030927872, 1153278018030927872]", + "[1153278018030927873, 1153278018567798783]", + "[1153278021252153344, 1153278021252153344]", + "[1153278023433191425, 1153278023466745855]", + "[1153278023466745856, 1153278023466745856]", + "[1153278023466745857, 1153278023500300287]", + "[1153278023500300289, 1153278023533854719]", + "[1153278023533854721, 1153278023668072447]", + "[1153278023668072448, 1153278023668072448]", + "[1153278023668072449, 1153278023802290175]", + "[1153278023802290177, 1153278023936507903]", + "[1153278023936507905, 1153278024473378815]", + "[1153278024473378816, 1153278024473378816]", + "[1153278024473378817, 1153278025010249727]", + "[1153278025010249729, 1153278025547120639]", + "[1153278025547120640, 1153278025547120640]", + "[1153278025547120641, 1153278027694604287]", + "[1153278027694604289, 1153278028231475199]", + "[1153278028231475201, 1153278028768346111]", + "[1153278028768346112, 1153278028768346112]", + "[1153278028768346113, 1153278028902563839]", + "[1153278028902563841, 1153278029036781567]", + "[1153278029036781568, 1153278029036781568]", + "[1153278029170999297, 1153278029305217023]", + "[1153278029305217025, 1153278029842087935]", + "[1153278029842087937, 1153278031989571583]", + "[1153278034137055232, 1153278034137055232]", + "[1153278036284538881, 1153278038432022527]", + "[1153278038432022528, 1153278038432022528]", + "[1153278049974747136, 1153278049974747136]", + "[1153278050041856000, 1153278050041856000]", + "[1153278050058633216, 1153278050058633216]", + "[1153278050058633217, 1153278050067021823]", + "[1153278050243182592, 1153278050243182592]", + "[1153278050243182593, 1153278050780053503]", + "[1153278051316924416, 1153278051316924416]", + "[1153278051316924417, 1153278053464408063]", + "[1153278089971630080, 1153278089971630080]", + "[1153278197345812480, 1153278197345812480]", + "[1153278197345812481, 1153278199493296127]", + "[1153278199493296129, 1153278201640779775]", + "[1153278201640779777, 1153278202177650687]", + "[1153278202177650689, 1153278202714521599]", + "[1153278202714521600, 1153278202714521600]", + "[1153278205935747072, 1153278205935747072]", + "[1153278208083230721, 1153278208620101631]", + "[1153278208620101633, 1153278208754319359]", + "[1153278208888537088, 1153278208888537088]", + "[1153278208888537089, 1153278209022754815]", + "[1153278209022754817, 1153278209156972543]", + "[1153278209156972544, 1153278209156972544]", + "[1153278209156972545, 1153278209693843455]", + "[1153278209693843457, 1153278210230714367]", + "[1153278210230714368, 1153278210230714368]", + "[1153278210230714369, 1153278212378198015]", + "[1153278212378198017, 1153278212915068927]", + "[1153278212915068929, 1153278213049286655]", + "[1153278213049286657, 1153278213082841087]", + "[1153278213116395520, 1153278213116395520]", + "[1153278213116395521, 1153278213149949951]", + "[1153278213149949953, 1153278213183504383]", + "[1153278213183504384, 1153278213183504384]", + "[1153278213183504385, 1153278213317722111]", + "[1153278213317722113, 1153278213451939839]", + "[1153278213451939840, 1153278213451939840]", + "[1153278213451939841, 1153278213988810751]", + "[1153278213988810753, 1153278214525681663]", + "[1153278214525681664, 1153278214525681664]", + "[1153278214525681665, 1153278216673165311]", + "[1153278216673165313, 1153278218820648959]", + "[1153278220968132609, 1153278223115616255]", + "[1153278223115616256, 1153278223115616256]", + "[1153278227410583552, 1153278227410583552]", + "[1153278845885874176, 1153278845885874176]", + "[1153290940513779712, 1153290940513779712]", + "[1154047404513689600, 1154047404513689600]", + "[1157425104234217472, 1157425104234217472]", + "[1170935903116328960, 1170935903116328960]", + "[1224979098644774912, 1224979098644774912]" + ] + }, + "keysExamined" : 4, + "seeks" : 5, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 0, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[1153202979583557632, 1153202979583557632]", + "[1153273348327735296, 1153273348327735296]", + "[1153277746374246400, 1153277746374246400]", + "[1153277763554115584, 1153277763554115584]", + "[1153277763554115585, 1153277772144050175]", + "[1153277780733984769, 1153277815093723135]", + "[1153277815093723136, 1153277815093723136]", + "[1153277849453461505, 1153277883813199871]", + "[1153277883813199873, 1153277918172938239]", + "[1153277935352807424, 1153277935352807424]", + "[1153277948237709312, 1153277948237709312]", + "[1153277950385192961, 1153277952532676607]", + "[1153277952532676608, 1153277952532676608]", + "[1153277952532676609, 1153277961122611199]", + "[1153277969712545792, 1153277969712545792]", + "[1153277978302480385, 1153277986892414975]", + "[1153277986892414977, 1153277989039898623]", + "[1153277991187382272, 1153277991187382272]", + "[1153277993334865921, 1153277995482349567]", + "[1153277995482349569, 1153277997629833215]", + "[1153277997629833217, 1153277999777316863]", + "[1153277999777316864, 1153277999777316864]", + "[1153277999777316865, 1153278001924800511]", + "[1153278001924800513, 1153278002461671423]", + "[1153278002461671425, 1153278002998542335]", + "[1153278002998542336, 1153278002998542336]", + "[1153278002998542337, 1153278003535413247]", + "[1153278004072284160, 1153278004072284160]", + "[1153278021252153344, 1153278021252153344]", + "[1153278031989571585, 1153278034137055231]", + "[1153278034137055232, 1153278034137055232]", + "[1153278034137055233, 1153278036284538879]", + "[1153278038432022528, 1153278038432022528]", + "[1153278038432022529, 1153278047021957119]", + "[1153278047021957121, 1153278049169440767]", + "[1153278049169440769, 1153278049706311679]", + "[1153278049706311681, 1153278049840529407]", + "[1153278049840529409, 1153278049974747135]", + "[1153278049974747136, 1153278049974747136]", + "[1153278049974747137, 1153278050008301567]", + "[1153278050008301569, 1153278050041855999]", + "[1153278050041856000, 1153278050041856000]", + "[1153278050041856001, 1153278050050244607]", + "[1153278050050244609, 1153278050058633215]", + "[1153278050058633216, 1153278050058633216]", + "[1153278050067021825, 1153278050075410431]", + "[1153278050075410433, 1153278050108964863]", + "[1153278050108964865, 1153278050243182591]", + "[1153278050243182592, 1153278050243182592]", + "[1153278050780053505, 1153278051316924415]", + "[1153278051316924416, 1153278051316924416]", + "[1153278053464408065, 1153278055611891711]", + "[1153278055611891713, 1153278064201826303]", + "[1153278072791760896, 1153278072791760896]", + "[1153278081381695489, 1153278089971630079]", + "[1153278089971630080, 1153278089971630080]", + "[1153278089971630081, 1153278090005184511]", + "[1153278090038738944, 1153278090038738944]", + "[1153278090240065536, 1153278090240065536]", + "[1153278091045371904, 1153278091045371904]", + "[1153278094266597376, 1153278094266597376]", + "[1153278107151499264, 1153278107151499264]", + "[1153278132921303041, 1153278141511237631]", + "[1153278141511237632, 1153278141511237632]", + "[1153278141511237633, 1153278150101172223]", + "[1153278175870976000, 1153278175870976000]", + "[1153278175870976001, 1153278184460910591]", + "[1153278184460910593, 1153278193050845183]", + "[1153278193050845185, 1153278195198328831]", + "[1153278195198328833, 1153278197345812479]", + "[1153278197345812480, 1153278197345812480]", + "[1153278210230714368, 1153278210230714368]", + "[1153278218820648961, 1153278220968132607]", + "[1153278223115616256, 1153278223115616256]", + "[1153278223115616257, 1153278225263099903]", + "[1153278225263099905, 1153278227410583551]", + "[1153278227410583552, 1153278227410583552]", + "[1153278227410583553, 1153278261770321919]", + "[1153278270360256513, 1153278278950191103]", + "[1153278278950191104, 1153278278950191104]", + "[1153278845885874176, 1153278845885874176]", + "[1153290940513779712, 1153290940513779712]", + "[1154047404513689600, 1154047404513689600]", + "[1157425104234217472, 1157425104234217472]", + "[1170935903116328960, 1170935903116328960]", + "[1224979098644774912, 1224979098644774912]" + ] + }, + "keysExamined" : 4, + "seeks" : 5, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 0, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[1153202979583557632, 1153202979583557632]", + "[1153273348327735296, 1153273348327735296]", + "[1153274447839363072, 1153274447839363072]", + "[1153274722717270016, 1153274722717270016]", + "[1153274791436746752, 1153274791436746752]", + "[1153274791436746753, 1153274825796485119]", + "[1153276646862618624, 1153276646862618624]", + "[1153276921740525568, 1153276921740525568]", + "[1153277127898955776, 1153277127898955776]", + "[1153277162258694145, 1153277196618432511]", + "[1153277196618432513, 1153277334057385983]", + "[1153277471496339456, 1153277471496339456]", + "[1153277608935292929, 1153277746374246399]", + "[1153277746374246400, 1153277746374246400]", + "[1153277746374246401, 1153277754964180991]", + "[1153277754964180993, 1153277763554115583]", + "[1153277763554115584, 1153277763554115584]", + "[1153277772144050177, 1153277780733984767]", + "[1153277815093723136, 1153277815093723136]", + "[1153277918172938241, 1153277926762872831]", + "[1153277926762872833, 1153277935352807423]", + "[1153277935352807424, 1153277935352807424]", + "[1153277935352807425, 1153277943942742015]", + "[1153277943942742017, 1153277946090225663]", + "[1153277946090225665, 1153277948237709311]", + "[1153277948237709312, 1153277948237709312]", + "[1153277948237709313, 1153277950385192959]", + "[1153277952532676608, 1153277952532676608]", + "[1153277961122611201, 1153277969712545791]", + "[1153277969712545792, 1153277969712545792]", + "[1153277969712545793, 1153277978302480383]", + "[1153278021252153344, 1153278021252153344]", + "[1153278064201826305, 1153278072791760895]", + "[1153278072791760896, 1153278072791760896]", + "[1153278072791760897, 1153278081381695487]", + "[1153278089971630080, 1153278089971630080]", + "[1153278090005184513, 1153278090038738943]", + "[1153278090038738944, 1153278090038738944]", + "[1153278090038738945, 1153278090072293375]", + "[1153278090072293377, 1153278090105847807]", + "[1153278090105847809, 1153278090240065535]", + "[1153278090240065536, 1153278090240065536]", + "[1153278090240065537, 1153278090374283263]", + "[1153278090374283265, 1153278090508500991]", + "[1153278090508500993, 1153278091045371903]", + "[1153278091045371904, 1153278091045371904]", + "[1153278091045371905, 1153278091582242815]", + "[1153278091582242817, 1153278092119113727]", + "[1153278092119113729, 1153278094266597375]", + "[1153278094266597376, 1153278094266597376]", + "[1153278094266597377, 1153278096414081023]", + "[1153278096414081025, 1153278098561564671]", + "[1153278098561564673, 1153278107151499263]", + "[1153278107151499264, 1153278107151499264]", + "[1153278107151499265, 1153278115741433855]", + "[1153278115741433857, 1153278124331368447]", + "[1153278124331368449, 1153278132921303039]", + "[1153278141511237632, 1153278141511237632]", + "[1153278150101172225, 1153278158691106815]", + "[1153278158691106817, 1153278167281041407]", + "[1153278167281041409, 1153278175870975999]", + "[1153278175870976000, 1153278175870976000]", + "[1153278227410583552, 1153278227410583552]", + "[1153278261770321921, 1153278270360256511]", + "[1153278278950191104, 1153278278950191104]", + "[1153278278950191105, 1153278287540125695]", + "[1153278287540125697, 1153278296130060287]", + "[1153278296130060289, 1153278433569013759]", + "[1153278571007967232, 1153278571007967232]", + "[1153278708446920705, 1153278845885874175]", + "[1153278845885874176, 1153278845885874176]", + "[1153278845885874177, 1153278854475808767]", + "[1153278863065743360, 1153278863065743360]", + "[1153278914605350912, 1153278914605350912]", + "[1153279120763781120, 1153279120763781120]", + "[1153279533080641537, 1153279670519595007]", + "[1153279670519595008, 1153279670519595008]", + "[1153279670519595009, 1153279807958548479]", + "[1153280220275408896, 1153280220275408896]", + "[1153280426433839104, 1153280426433839104]", + "[1153280477973446656, 1153280477973446656]", + "[1153280486563381249, 1153280495153315839]", + "[1153280495153315841, 1153280632592269311]", + "[1153280632592269313, 1153280770031222783]", + "[1153280770031222784, 1153280770031222784]", + "[1153281044909129728, 1153281044909129728]", + "[1153290940513779712, 1153290940513779712]", + "[1154047404513689600, 1154047404513689600]", + "[1157425104234217472, 1157425104234217472]", + "[1170935903116328960, 1170935903116328960]", + "[1224979098644774912, 1224979098644774912]" + ] + }, + "keysExamined" : 4, + "seeks" : 5, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 0, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[1153202979583557632, 1153202979583557632]", + "[1153273348327735296, 1153273348327735296]", + "[1153274172961456128, 1153274172961456128]", + "[1153274241680932864, 1153274241680932864]", + "[1153274241680932865, 1153274276040671231]", + "[1153274447839363072, 1153274447839363072]", + "[1153274447839363073, 1153274585278316543]", + "[1153274585278316545, 1153274722717270015]", + "[1153274722717270016, 1153274722717270016]", + "[1153274722717270017, 1153274757077008383]", + "[1153274757077008385, 1153274791436746751]", + "[1153274791436746752, 1153274791436746752]", + "[1153274825796485121, 1153274860156223487]", + "[1153274860156223489, 1153274997595176959]", + "[1153274997595176961, 1153275031954915327]", + "[1153275066314653696, 1153275066314653696]", + "[1153275272473083904, 1153275272473083904]", + "[1153275684789944321, 1153275822228897791]", + "[1153275822228897792, 1153275822228897792]", + "[1153275822228897793, 1153275959667851263]", + "[1153276371984711680, 1153276371984711680]", + "[1153276578143141888, 1153276578143141888]", + "[1153276629682749440, 1153276629682749440]", + "[1153276638272684033, 1153276646862618623]", + "[1153276646862618624, 1153276646862618624]", + "[1153276646862618625, 1153276784301572095]", + "[1153276784301572097, 1153276921740525567]", + "[1153276921740525568, 1153276921740525568]", + "[1153276921740525569, 1153277059179479039]", + "[1153277059179479041, 1153277093539217407]", + "[1153277093539217409, 1153277127898955775]", + "[1153277127898955776, 1153277127898955776]", + "[1153277127898955777, 1153277162258694143]", + "[1153277334057385985, 1153277471496339455]", + "[1153277471496339456, 1153277471496339456]", + "[1153277471496339457, 1153277608935292927]", + "[1153277746374246400, 1153277746374246400]", + "[1153278433569013761, 1153278571007967231]", + "[1153278571007967232, 1153278571007967232]", + "[1153278571007967233, 1153278708446920703]", + "[1153278845885874176, 1153278845885874176]", + "[1153278854475808769, 1153278863065743359]", + "[1153278863065743360, 1153278863065743360]", + "[1153278863065743361, 1153278871655677951]", + "[1153278871655677953, 1153278880245612543]", + "[1153278880245612545, 1153278914605350911]", + "[1153278914605350912, 1153278914605350912]", + "[1153278914605350913, 1153278948965089279]", + "[1153278948965089281, 1153278983324827647]", + "[1153278983324827649, 1153279120763781119]", + "[1153279120763781120, 1153279120763781120]", + "[1153279120763781121, 1153279258202734591]", + "[1153279258202734593, 1153279395641688063]", + "[1153279395641688065, 1153279533080641535]", + "[1153279670519595008, 1153279670519595008]", + "[1153279807958548481, 1153279945397501951]", + "[1153279945397501953, 1153280082836455423]", + "[1153280082836455425, 1153280220275408895]", + "[1153280220275408896, 1153280220275408896]", + "[1153280220275408897, 1153280357714362367]", + "[1153280357714362369, 1153280392074100735]", + "[1153280392074100737, 1153280426433839103]", + "[1153280426433839104, 1153280426433839104]", + "[1153280426433839105, 1153280460793577471]", + "[1153280460793577473, 1153280469383512063]", + "[1153280469383512065, 1153280477973446655]", + "[1153280477973446656, 1153280477973446656]", + "[1153280477973446657, 1153280486563381247]", + "[1153280770031222784, 1153280770031222784]", + "[1153280770031222785, 1153280907470176255]", + "[1153280907470176257, 1153281044909129727]", + "[1153281044909129728, 1153281044909129728]", + "[1153281044909129729, 1153281182348083199]", + "[1153281182348083201, 1153281319787036671]", + "[1153281319787036672, 1153281319787036672]", + "[1153281775053570049, 1153281783643504639]", + "[1153281783643504640, 1153281783643504640]", + "[1153281800823373824, 1153281800823373824]", + "[1153281869542850560, 1153281869542850560]", + "[1153286542467268608, 1153286542467268608]", + "[1153289841002151936, 1153289841002151936]", + "[1153290115880058880, 1153290115880058880]", + "[1153290115880058881, 1153290253319012351]", + "[1153290253319012353, 1153290390757965823]", + "[1153290940513779712, 1153290940513779712]", + "[1153303035141685248, 1153303035141685248]", + "[1153303035141685249, 1153303584897499135]", + "[1153304134653313024, 1153304134653313024]", + "[1153304867649880065, 1153304867683434495]", + "[1153304867683434496, 1153304867683434496]", + "[1153304867750543360, 1153304867750543360]", + "[1153304868018978816, 1153304868018978816]", + "[1153304869092720640, 1153304869092720640]", + "[1153304873387687936, 1153304873387687936]", + "[1153304890567557120, 1153304890567557120]", + "[1153304959287033856, 1153304959287033856]", + "[1153305234164940800, 1153305234164940800]", + "[1154047404513689600, 1154047404513689600]", + "[1157425104234217472, 1157425104234217472]", + "[1170935903116328960, 1170935903116328960]", + "[1224979098644774912, 1224979098644774912]" + ] + }, + "keysExamined" : 4, + "seeks" : 5, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 0, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[1153202979583557632, 1153202979583557632]", + "[1153255756141690880, 1153255756141690880]", + "[1153260154188201984, 1153260154188201984]", + "[1153263452723085312, 1153263452723085312]", + "[1153264277356806144, 1153264277356806144]", + "[1153264346076282880, 1153264346076282880]", + "[1153264397615890432, 1153264397615890432]", + "[1153264410500792320, 1153264410500792320]", + "[1153264413722017792, 1153264413722017792]", + "[1153264414527324160, 1153264414527324160]", + "[1153264414728650752, 1153264414728650752]", + "[1153264414778982400, 1153264414778982400]", + "[1153264414787371009, 1153264414795759615]", + "[1153264414795759617, 1153264552234713087]", + "[1153264552234713089, 1153265101990526975]", + "[1153265101990526977, 1153265651746340863]", + "[1153265651746340864, 1153265651746340864]", + "[1153268950281224192, 1153268950281224192]", + "[1153272248816107520, 1153272248816107520]", + "[1153272248816107521, 1153272798571921407]", + "[1153272798571921409, 1153273348327735295]", + "[1153273348327735296, 1153273348327735296]", + "[1153273348327735297, 1153273898083549183]", + "[1153273898083549185, 1153274035522502655]", + "[1153274035522502657, 1153274172961456127]", + "[1153274172961456128, 1153274172961456128]", + "[1153274172961456129, 1153274207321194495]", + "[1153274207321194497, 1153274241680932863]", + "[1153274241680932864, 1153274241680932864]", + "[1153274276040671233, 1153274310400409599]", + "[1153274310400409601, 1153274447839363071]", + "[1153274447839363072, 1153274447839363072]", + "[1153275031954915329, 1153275066314653695]", + "[1153275066314653696, 1153275066314653696]", + "[1153275066314653697, 1153275100674392063]", + "[1153275100674392065, 1153275135034130431]", + "[1153275135034130433, 1153275272473083903]", + "[1153275272473083904, 1153275272473083904]", + "[1153275272473083905, 1153275409912037375]", + "[1153275409912037377, 1153275547350990847]", + "[1153275547350990849, 1153275684789944319]", + "[1153275822228897792, 1153275822228897792]", + "[1153275959667851265, 1153276097106804735]", + "[1153276097106804737, 1153276234545758207]", + "[1153276234545758209, 1153276371984711679]", + "[1153276371984711680, 1153276371984711680]", + "[1153276371984711681, 1153276509423665151]", + "[1153276509423665153, 1153276543783403519]", + "[1153276543783403521, 1153276578143141887]", + "[1153276578143141888, 1153276578143141888]", + "[1153276578143141889, 1153276612502880255]", + "[1153276612502880257, 1153276621092814847]", + "[1153276621092814849, 1153276629682749439]", + "[1153276629682749440, 1153276629682749440]", + "[1153276629682749441, 1153276638272684031]", + "[1153276646862618624, 1153276646862618624]", + "[1153277746374246400, 1153277746374246400]", + "[1153281044909129728, 1153281044909129728]", + "[1153281319787036672, 1153281319787036672]", + "[1153281319787036673, 1153281457225990143]", + "[1153281457225990145, 1153281594664943615]", + "[1153281594664943617, 1153281732103897087]", + "[1153281732103897089, 1153281766463635455]", + "[1153281766463635457, 1153281775053570047]", + "[1153281783643504640, 1153281783643504640]", + "[1153281783643504641, 1153281792233439231]", + "[1153281792233439233, 1153281800823373823]", + "[1153281800823373824, 1153281800823373824]", + "[1153281800823373825, 1153281835183112191]", + "[1153281835183112193, 1153281869542850559]", + "[1153281869542850560, 1153281869542850560]", + "[1153281869542850561, 1153282006981804031]", + "[1153282006981804033, 1153282144420757503]", + "[1153282144420757505, 1153284343444013055]", + "[1153286542467268608, 1153286542467268608]", + "[1153288741490524161, 1153289291246338047]", + "[1153289291246338049, 1153289841002151935]", + "[1153289841002151936, 1153289841002151936]", + "[1153289841002151937, 1153289978441105407]", + "[1153289978441105409, 1153290115880058879]", + "[1153290115880058880, 1153290115880058880]", + "[1153290390757965825, 1153290940513779711]", + "[1153290940513779712, 1153290940513779712]", + "[1153290940513779713, 1153293139537035263]", + "[1153295338560290816, 1153295338560290816]", + "[1153301935630057473, 1153302485385871359]", + "[1153302485385871361, 1153303035141685247]", + "[1153303035141685248, 1153303035141685248]", + "[1153303584897499137, 1153304134653313023]", + "[1153304134653313024, 1153304134653313024]", + "[1153304134653313025, 1153304684409126911]", + "[1153304684409126913, 1153304821848080383]", + "[1153304821848080385, 1153304856207818751]", + "[1153304856207818753, 1153304864797753343]", + "[1153304864797753345, 1153304866945236991]", + "[1153304866945236993, 1153304867482107903]", + "[1153304867482107905, 1153304867616325631]", + "[1153304867616325633, 1153304867649880063]", + "[1153304867683434496, 1153304867683434496]", + "[1153304867683434497, 1153304867716988927]", + "[1153304867716988929, 1153304867750543359]", + "[1153304867750543360, 1153304867750543360]", + "[1153304867750543361, 1153304867884761087]", + "[1153304867884761089, 1153304868018978815]", + "[1153304868018978816, 1153304868018978816]", + "[1153304868018978817, 1153304868555849727]", + "[1153304868555849729, 1153304869092720639]", + "[1153304869092720640, 1153304869092720640]", + "[1153304869092720641, 1153304871240204287]", + "[1153304871240204289, 1153304873387687935]", + "[1153304873387687936, 1153304873387687936]", + "[1153304873387687937, 1153304881977622527]", + "[1153304881977622529, 1153304890567557119]", + "[1153304890567557120, 1153304890567557120]", + "[1153304890567557121, 1153304924927295487]", + "[1153304924927295489, 1153304959287033855]", + "[1153304959287033856, 1153304959287033856]", + "[1153304959287033857, 1153305096725987327]", + "[1153305096725987329, 1153305234164940799]", + "[1153305234164940800, 1153305234164940800]", + "[1153305234164940801, 1153305783920754687]", + "[1153305783920754689, 1153306333676568575]", + "[1153312930746335232, 1153312930746335232]", + "[1153316229281218560, 1153316229281218560]", + "[1153316779037032449, 1153317328792846335]", + "[1153317328792846337, 1153317878548660223]", + "[1153318428304474112, 1153318428304474112]", + "[1153318978060288001, 1153319527816101887]", + "[1153319527816101889, 1153320077571915775]", + "[1153320077571915777, 1153320627327729663]", + "[1153320627327729664, 1153320627327729664]", + "[1153321726839357440, 1153321726839357440]", + "[1153326124885868544, 1153326124885868544]", + "[1154047404513689600, 1154047404513689600]", + "[1157425104234217472, 1157425104234217472]", + "[1170935903116328960, 1170935903116328960]", + "[1224979098644774912, 1224979098644774912]" + ] + }, + "keysExamined" : 4, + "seeks" : 5, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 0, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[1153202979583557632, 1153202979583557632]", + "[1153220571769602048, 1153220571769602048]", + "[1153220571769602049, 1153229367862624255]", + "[1153255756141690880, 1153255756141690880]", + "[1153255756141690881, 1153257955164946431]", + "[1153257955164946433, 1153260154188201983]", + "[1153260154188201984, 1153260154188201984]", + "[1153260154188201985, 1153262353211457535]", + "[1153262353211457537, 1153262902967271423]", + "[1153262902967271425, 1153263452723085311]", + "[1153263452723085312, 1153263452723085312]", + "[1153263452723085313, 1153264002478899199]", + "[1153264002478899201, 1153264139917852671]", + "[1153264139917852673, 1153264277356806143]", + "[1153264277356806144, 1153264277356806144]", + "[1153264277356806145, 1153264311716544511]", + "[1153264311716544513, 1153264346076282879]", + "[1153264346076282880, 1153264346076282880]", + "[1153264346076282881, 1153264380436021247]", + "[1153264380436021249, 1153264389025955839]", + "[1153264389025955841, 1153264397615890431]", + "[1153264397615890432, 1153264397615890432]", + "[1153264397615890433, 1153264406205825023]", + "[1153264406205825025, 1153264408353308671]", + "[1153264408353308673, 1153264410500792319]", + "[1153264410500792320, 1153264410500792320]", + "[1153264410500792321, 1153264412648275967]", + "[1153264412648275969, 1153264413185146879]", + "[1153264413185146881, 1153264413722017791]", + "[1153264413722017792, 1153264413722017792]", + "[1153264413722017793, 1153264414258888703]", + "[1153264414258888705, 1153264414393106431]", + "[1153264414393106433, 1153264414527324159]", + "[1153264414527324160, 1153264414527324160]", + "[1153264414527324161, 1153264414661541887]", + "[1153264414661541889, 1153264414695096319]", + "[1153264414695096321, 1153264414728650751]", + "[1153264414728650752, 1153264414728650752]", + "[1153264414728650753, 1153264414762205183]", + "[1153264414762205185, 1153264414770593791]", + "[1153264414770593793, 1153264414778982399]", + "[1153264414778982400, 1153264414778982400]", + "[1153264414778982401, 1153264414787371007]", + "[1153265651746340864, 1153265651746340864]", + "[1153265651746340865, 1153266201502154751]", + "[1153266201502154753, 1153266751257968639]", + "[1153266751257968641, 1153268950281224191]", + "[1153268950281224192, 1153268950281224192]", + "[1153268950281224193, 1153271149304479743]", + "[1153271149304479745, 1153271699060293631]", + "[1153271699060293633, 1153272248816107519]", + "[1153272248816107520, 1153272248816107520]", + "[1153273348327735296, 1153273348327735296]", + "[1153284343444013057, 1153286542467268607]", + "[1153286542467268608, 1153286542467268608]", + "[1153286542467268609, 1153288741490524159]", + "[1153290940513779712, 1153290940513779712]", + "[1153293139537035265, 1153295338560290815]", + "[1153295338560290816, 1153295338560290816]", + "[1153295338560290817, 1153297537583546367]", + "[1153297537583546369, 1153299736606801919]", + "[1153299736606801921, 1153301935630057471]", + "[1153304134653313024, 1153304134653313024]", + "[1153306333676568577, 1153308532699824127]", + "[1153308532699824129, 1153310731723079679]", + "[1153310731723079681, 1153312930746335231]", + "[1153312930746335232, 1153312930746335232]", + "[1153312930746335233, 1153315129769590783]", + "[1153315129769590785, 1153315679525404671]", + "[1153315679525404673, 1153316229281218559]", + "[1153316229281218560, 1153316229281218560]", + "[1153316229281218561, 1153316779037032447]", + "[1153317878548660225, 1153318428304474111]", + "[1153318428304474112, 1153318428304474112]", + "[1153318428304474113, 1153318978060287999]", + "[1153320627327729664, 1153320627327729664]", + "[1153320627327729665, 1153321177083543551]", + "[1153321177083543553, 1153321726839357439]", + "[1153321726839357440, 1153321726839357440]", + "[1153321726839357441, 1153323925862612991]", + "[1153323925862612993, 1153326124885868543]", + "[1153326124885868544, 1153326124885868544]", + "[1153765929536978944, 1153765929536978944]", + "[1153977035769511936, 1153977035769511936]", + "[1153994627955556352, 1153994627955556352]", + "[1154007822095089664, 1154007822095089664]", + "[1154011120629972992, 1154011120629972992]", + "[1154011670385786881, 1154012220141600767]", + "[1154012220141600769, 1154014419164856319]", + "[1154014419164856321, 1154016618188111871]", + "[1154016618188111872, 1154016618188111872]", + "[1154029812327645184, 1154029812327645184]", + "[1154043006467178496, 1154043006467178496]", + "[1154043006467178497, 1154045205490434047]", + "[1154047404513689600, 1154047404513689600]", + "[1154799470467088384, 1154799470467088384]", + "[1154799470467088385, 1154801669490343935]", + "[1154803868513599488, 1154803868513599488]", + "[1154806067536855041, 1154808266560110591]", + "[1154808266560110592, 1154808266560110592]", + "[1154808266560110593, 1154810465583366143]", + "[1154821460699643904, 1154821460699643904]", + "[1154833005571735553, 1154833555327549439]", + "[1154833555327549440, 1154833555327549440]", + "[1154834654839177216, 1154834654839177216]", + "[1154839052885688320, 1154839052885688320]", + "[1154891829443821568, 1154891829443821568]", + "[1157425104234217472, 1157425104234217472]", + "[1170935903116328960, 1170935903116328960]", + "[1224979098644774912, 1224979098644774912]" + ] + }, + "keysExamined" : 4, + "seeks" : 5, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 0, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[1153132610839379968, 1153132610839379968]", + "[1153150203025424384, 1153150203025424384]", + "[1153150203025424385, 1153158999118446591]", + "[1153158999118446593, 1153167795211468799]", + "[1153167795211468801, 1153176591304491007]", + "[1153185387397513216, 1153185387397513216]", + "[1153198581537046528, 1153198581537046528]", + "[1153198581537046529, 1153200780560302079]", + "[1153202979583557632, 1153202979583557632]", + "[1153202979583557633, 1153211775676579839]", + "[1153211775676579841, 1153220571769602047]", + "[1153220571769602048, 1153220571769602048]", + "[1153229367862624257, 1153238163955646463]", + "[1153238163955646465, 1153246960048668671]", + "[1153246960048668673, 1153255756141690879]", + "[1153255756141690880, 1153255756141690880]", + "[1153273348327735296, 1153273348327735296]", + "[1153326124885868544, 1153326124885868544]", + "[1153326124885868545, 1153334920978890751]", + "[1153334920978890753, 1153343717071912959]", + "[1153343717071912961, 1153352513164935167]", + "[1153361309257957376, 1153361309257957376]", + "[1153370105350979585, 1153378901444001791]", + "[1153378901444001793, 1153387697537023999]", + "[1153387697537024001, 1153388247292837887]", + "[1153388797048651776, 1153388797048651776]", + "[1153389621682372608, 1153389621682372608]", + "[1153389690401849344, 1153389690401849344]", + "[1153389707581718528, 1153389707581718528]", + "[1153389711876685824, 1153389711876685824]", + "[1153389712950427648, 1153389712950427648]", + "[1153389713218863104, 1153389713218863104]", + "[1153389713285971968, 1153389713285971968]", + "[1153389713302749184, 1153389713302749184]", + "[1153389713302749185, 1153389713311137791]", + "[1153392095583535104, 1153392095583535104]", + "[1153396493630046208, 1153396493630046208]", + "[1153414085816090624, 1153414085816090624]", + "[1153530634048634881, 1153532833071890431]", + "[1153532833071890432, 1153532833071890432]", + "[1153537231118401536, 1153537231118401536]", + "[1153554823304445952, 1153554823304445952]", + "[1153765929536978944, 1153765929536978944]", + "[1153977035769511936, 1153977035769511936]", + "[1153977035769511937, 1153985831862534143]", + "[1153985831862534145, 1153994627955556351]", + "[1153994627955556352, 1153994627955556352]", + "[1153994627955556353, 1154003424048578559]", + "[1154003424048578561, 1154005623071834111]", + "[1154005623071834113, 1154007822095089663]", + "[1154007822095089664, 1154007822095089664]", + "[1154007822095089665, 1154010021118345215]", + "[1154010021118345217, 1154010570874159103]", + "[1154010570874159105, 1154011120629972991]", + "[1154011120629972992, 1154011120629972992]", + "[1154011120629972993, 1154011670385786879]", + "[1154016618188111872, 1154016618188111872]", + "[1154016618188111873, 1154018817211367423]", + "[1154018817211367425, 1154021016234622975]", + "[1154021016234622977, 1154029812327645183]", + "[1154029812327645184, 1154029812327645184]", + "[1154029812327645185, 1154038608420667391]", + "[1154038608420667393, 1154040807443922943]", + "[1154040807443922945, 1154043006467178495]", + "[1154043006467178496, 1154043006467178496]", + "[1154045205490434049, 1154047404513689599]", + "[1154047404513689600, 1154047404513689600]", + "[1154047404513689601, 1154082588885778431]", + "[1154117773257867264, 1154117773257867264]", + "[1154328879490400256, 1154328879490400256]", + "[1154786276327555073, 1154795072420577279]", + "[1154795072420577281, 1154797271443832831]", + "[1154797271443832833, 1154799470467088383]", + "[1154799470467088384, 1154799470467088384]", + "[1154801669490343937, 1154803868513599487]", + "[1154803868513599488, 1154803868513599488]", + "[1154803868513599489, 1154806067536855039]", + "[1154808266560110592, 1154808266560110592]", + "[1154810465583366145, 1154812664606621695]", + "[1154812664606621697, 1154821460699643903]", + "[1154821460699643904, 1154821460699643904]", + "[1154821460699643905, 1154830256792666111]", + "[1154830256792666113, 1154832455815921663]", + "[1154832455815921665, 1154833005571735551]", + "[1154833555327549440, 1154833555327549440]", + "[1154833555327549441, 1154834105083363327]", + "[1154834105083363329, 1154834654839177215]", + "[1154834654839177216, 1154834654839177216]", + "[1154834654839177217, 1154836853862432767]", + "[1154836853862432769, 1154839052885688319]", + "[1154839052885688320, 1154839052885688320]", + "[1154839052885688321, 1154847848978710527]", + "[1154847848978710529, 1154856645071732735]", + "[1154891829443821568, 1154891829443821568]", + "[1154938008932188161, 1154940207955443711]", + "[1154940207955443712, 1154940207955443712]", + "[1154944606001954816, 1154944606001954816]", + "[1154962198187999232, 1154962198187999232]", + "[1157425104234217472, 1157425104234217472]", + "[1170935903116328960, 1170935903116328960]", + "[1224979098644774912, 1224979098644774912]" + ] + }, + "keysExamined" : 4, + "seeks" : 5, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 0, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[1152956688978935809, 1152991873351024639]", + "[1152991873351024640, 1152991873351024640]", + "[1152991873351024641, 1153027057723113471]", + "[1153027057723113473, 1153062242095202303]", + "[1153062242095202305, 1153097426467291135]", + "[1153097426467291137, 1153132610839379967]", + "[1153132610839379968, 1153132610839379968]", + "[1153132610839379969, 1153141406932402175]", + "[1153141406932402177, 1153150203025424383]", + "[1153150203025424384, 1153150203025424384]", + "[1153176591304491009, 1153185387397513215]", + "[1153185387397513216, 1153185387397513216]", + "[1153185387397513217, 1153194183490535423]", + "[1153194183490535425, 1153196382513790975]", + "[1153196382513790977, 1153198581537046527]", + "[1153198581537046528, 1153198581537046528]", + "[1153200780560302081, 1153202979583557631]", + "[1153202979583557632, 1153202979583557632]", + "[1153352513164935169, 1153361309257957375]", + "[1153361309257957376, 1153361309257957376]", + "[1153361309257957377, 1153370105350979583]", + "[1153388247292837889, 1153388797048651775]", + "[1153388797048651776, 1153388797048651776]", + "[1153388797048651777, 1153389346804465663]", + "[1153389346804465665, 1153389484243419135]", + "[1153389484243419137, 1153389621682372607]", + "[1153389621682372608, 1153389621682372608]", + "[1153389621682372609, 1153389656042110975]", + "[1153389656042110977, 1153389690401849343]", + "[1153389690401849344, 1153389690401849344]", + "[1153389690401849345, 1153389698991783935]", + "[1153389698991783937, 1153389707581718527]", + "[1153389707581718528, 1153389707581718528]", + "[1153389707581718529, 1153389709729202175]", + "[1153389709729202177, 1153389711876685823]", + "[1153389711876685824, 1153389711876685824]", + "[1153389711876685825, 1153389712413556735]", + "[1153389712413556737, 1153389712950427647]", + "[1153389712950427648, 1153389712950427648]", + "[1153389712950427649, 1153389713084645375]", + "[1153389713084645377, 1153389713218863103]", + "[1153389713218863104, 1153389713218863104]", + "[1153389713218863105, 1153389713252417535]", + "[1153389713252417537, 1153389713285971967]", + "[1153389713285971968, 1153389713285971968]", + "[1153389713285971969, 1153389713294360575]", + "[1153389713294360577, 1153389713302749183]", + "[1153389713302749184, 1153389713302749184]", + "[1153389713311137793, 1153389713319526399]", + "[1153389713319526401, 1153389713353080831]", + "[1153389713353080833, 1153389713487298559]", + "[1153389713487298561, 1153389714024169471]", + "[1153389714024169473, 1153389716171653119]", + "[1153389716171653121, 1153389724761587711]", + "[1153389724761587713, 1153389759121326079]", + "[1153389759121326081, 1153389896560279551]", + "[1153389896560279553, 1153392095583535103]", + "[1153392095583535104, 1153392095583535104]", + "[1153392095583535105, 1153394294606790655]", + "[1153394294606790657, 1153396493630046207]", + "[1153396493630046208, 1153396493630046208]", + "[1153396493630046209, 1153405289723068415]", + "[1153405289723068417, 1153414085816090623]", + "[1153414085816090624, 1153414085816090624]", + "[1153414085816090625, 1153449270188179455]", + "[1153449270188179457, 1153484454560268287]", + "[1153484454560268289, 1153519638932357119]", + "[1153519638932357121, 1153528435025379327]", + "[1153528435025379329, 1153530634048634879]", + "[1153532833071890432, 1153532833071890432]", + "[1153532833071890433, 1153535032095145983]", + "[1153535032095145985, 1153537231118401535]", + "[1153537231118401536, 1153537231118401536]", + "[1153537231118401537, 1153546027211423743]", + "[1153546027211423745, 1153554823304445951]", + "[1153554823304445952, 1153554823304445952]", + "[1153554823304445953, 1153590007676534783]", + "[1153590007676534785, 1153625192048623615]", + "[1153695560792801280, 1153695560792801280]", + "[1153748337350934528, 1153748337350934528]", + "[1153757133443956737, 1153765929536978943]", + "[1153765929536978944, 1153765929536978944]", + "[1153765929536978945, 1153774725630001151]", + "[1153774725630001153, 1153783521723023359]", + "[1153783521723023360, 1153783521723023360]", + "[1153836298281156608, 1153836298281156608]", + "[1153871482653245441, 1153906667025334271]", + "[1153906667025334273, 1153941851397423103]", + "[1153941851397423105, 1153977035769511935]", + "[1153977035769511936, 1153977035769511936]", + "[1154047404513689600, 1154047404513689600]", + "[1154082588885778433, 1154117773257867263]", + "[1154117773257867264, 1154117773257867264]", + "[1154117773257867265, 1154152957629956095]", + "[1154152957629956097, 1154188142002044927]", + "[1154188142002044929, 1154223326374133759]", + "[1154258510746222592, 1154258510746222592]", + "[1154328879490400256, 1154328879490400256]", + "[1154539985722933248, 1154539985722933248]", + "[1154539985722933249, 1154575170095022079]", + "[1154680723211288576, 1154680723211288576]", + "[1154680723211288577, 1154715907583377407]", + "[1154715907583377409, 1154751091955466239]", + "[1154751091955466241, 1154786276327555071]", + "[1154821460699643904, 1154821460699643904]", + "[1154856645071732737, 1154891829443821567]", + "[1154891829443821568, 1154891829443821568]", + "[1154891829443821569, 1154927013815910399]", + "[1154927013815910401, 1154935809908932607]", + "[1154935809908932609, 1154938008932188159]", + "[1154940207955443712, 1154940207955443712]", + "[1154940207955443713, 1154942406978699263]", + "[1154942406978699265, 1154944606001954815]", + "[1154944606001954816, 1154944606001954816]", + "[1154944606001954817, 1154953402094977023]", + "[1154953402094977025, 1154962198187999231]", + "[1154962198187999232, 1154962198187999232]", + "[1154962198187999233, 1154997382560088063]", + "[1154997382560088065, 1155032566932176895]", + "[1155076547397287937, 1155085343490310143]", + "[1155085343490310144, 1155085343490310144]", + "[1155102935676354560, 1155102935676354560]", + "[1157425104234217472, 1157425104234217472]", + "[1170935903116328960, 1170935903116328960]", + "[1224979098644774912, 1224979098644774912]" + ] + }, + "keysExamined" : 4, + "seeks" : 5, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 2, + "executionTimeMillisEstimate" : 0, + "works" : 6, + "advanced" : 2, + "needTime" : 3, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 2, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 2, + "executionTimeMillisEstimate" : 0, + "works" : 6, + "advanced" : 2, + "needTime" : 3, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[360287970189639680, 360287970189639680]", + "[378302368699121664, 378302368699121664]", + "[382805968326492160, 382805968326492160]", + "[383931868233334784, 383931868233334784]", + "[383931868233334785, 384494818186756095]", + "[1080863910568919040, 1080863910568919040]", + "[1134907106097364992, 1134907106097364992]", + "[1144653177165971457, 1144688361538060287]", + "[1144688361538060288, 1144688361538060288]", + "[1144700078208843777, 1144700112568582143]", + "[1144700112568582144, 1144700112568582144]", + "[1144700181288058880, 1144700181288058880]", + "[1144700456165965824, 1144700456165965824]", + "[1144701555677593600, 1144701555677593600]", + "[1144705953724104704, 1144705953724104704]", + "[1144758730282237952, 1144758730282237952]", + "[1145040205258948608, 1145040205258948608]", + "[1148417904979476480, 1148417904979476480]", + "[1151795604700004352, 1151795604700004352]", + "[1151795604700004353, 1152358554653425663]", + "[1152358554653425665, 1152921504606846975]", + "[1152921504606846977, 1152956688978935807]", + "[1152991873351024640, 1152991873351024640]", + "[1153202979583557632, 1153202979583557632]", + "[1153625192048623617, 1153660376420712447]", + "[1153660376420712449, 1153695560792801279]", + "[1153695560792801280, 1153695560792801280]", + "[1153695560792801281, 1153730745164890111]", + "[1153730745164890113, 1153739541257912319]", + "[1153739541257912321, 1153748337350934527]", + "[1153748337350934528, 1153748337350934528]", + "[1153748337350934529, 1153757133443956735]", + "[1153765929536978944, 1153765929536978944]", + "[1153783521723023360, 1153783521723023360]", + "[1153783521723023361, 1153792317816045567]", + "[1153792317816045569, 1153801113909067775]", + "[1153801113909067777, 1153836298281156607]", + "[1153836298281156608, 1153836298281156608]", + "[1153836298281156609, 1153871482653245439]", + "[1154047404513689600, 1154047404513689600]", + "[1154223326374133761, 1154258510746222591]", + "[1154258510746222592, 1154258510746222592]", + "[1154258510746222593, 1154293695118311423]", + "[1154293695118311425, 1154328879490400255]", + "[1154328879490400256, 1154328879490400256]", + "[1154328879490400257, 1154469616978755583]", + "[1154469616978755585, 1154504801350844415]", + "[1154504801350844417, 1154539985722933247]", + "[1154539985722933248, 1154539985722933248]", + "[1154575170095022081, 1154610354467110911]", + "[1154610354467110913, 1154645538839199743]", + "[1154645538839199745, 1154680723211288575]", + "[1154680723211288576, 1154680723211288576]", + "[1154891829443821568, 1154891829443821568]", + "[1155032566932176897, 1155067751304265727]", + "[1155067751304265729, 1155076547397287935]", + "[1155085343490310144, 1155085343490310144]", + "[1155085343490310145, 1155094139583332351]", + "[1155094139583332353, 1155102935676354559]", + "[1155102935676354560, 1155102935676354560]", + "[1155102935676354561, 1155138120048443391]", + "[1155138120048443393, 1155173304420532223]", + "[1155173304420532225, 1155314041908887551]", + "[1155314041908887553, 1155454779397242879]", + "[1155454779397242880, 1155454779397242880]", + "[1156299204327374848, 1156299204327374848]", + "[1157143629257506816, 1157143629257506816]", + "[1157143629257506817, 1157284366745862143]", + "[1157284366745862145, 1157425104234217471]", + "[1157425104234217472, 1157425104234217472]", + "[1160380591489679361, 1160521328978034687]", + "[1160521328978034688, 1160521328978034688]", + "[1160521328978034689, 1160662066466390015]", + "[1160802803954745344, 1160802803954745344]", + "[1160943541443100673, 1161084278931455999]", + "[1161084278931456000, 1161084278931456000]", + "[1161084278931456001, 1161225016419811327]", + "[1170935903116328960, 1170935903116328960]", + "[1224979098644774912, 1224979098644774912]", + "[1919659341166673920, 1919659341166673920]", + "[1920503766096805888, 1920503766096805888]", + "[1920644503585161217, 1920785241073516543]", + "[1920785241073516545, 1921348191026937855]", + "[1921348191026937857, 1921911140980359167]", + "[1921911140980359168, 1921911140980359168]", + "[1923037040887201792, 1923037040887201792]", + "[1927540640514572288, 1927540640514572288]", + "[1945555039024054272, 1945555039024054272]" + ] + }, + "keysExamined" : 5, + "seeks" : 4, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 3, + "executionTimeMillisEstimate" : 0, + "works" : 6, + "advanced" : 3, + "needTime" : 2, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 3, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 3, + "executionTimeMillisEstimate" : 0, + "works" : 6, + "advanced" : 3, + "needTime" : 2, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[360287970189639680, 360287970189639680]", + "[378302368699121664, 378302368699121664]", + "[381680068419649536, 381680068419649536]", + "[381680068419649537, 382243018373070847]", + "[382805968326492160, 382805968326492160]", + "[382805968326492161, 383368918279913471]", + "[383368918279913473, 383931868233334783]", + "[383931868233334784, 383931868233334784]", + "[384494818186756097, 385057768140177407]", + "[385057768140177409, 385620718093598719]", + "[386183668047020032, 386183668047020032]", + "[1080863910568919040, 1080863910568919040]", + "[1134907106097364992, 1134907106097364992]", + "[1143914305352105985, 1144477255305527295]", + "[1144477255305527297, 1144617992793882623]", + "[1144617992793882625, 1144653177165971455]", + "[1144688361538060288, 1144688361538060288]", + "[1144688361538060289, 1144697157631082495]", + "[1144697157631082497, 1144699356654338047]", + "[1144699356654338049, 1144699906410151935]", + "[1144699906410151937, 1144700043849105407]", + "[1144700043849105409, 1144700078208843775]", + "[1144700112568582144, 1144700112568582144]", + "[1144700112568582145, 1144700146928320511]", + "[1144700146928320513, 1144700181288058879]", + "[1144700181288058880, 1144700181288058880]", + "[1144700181288058881, 1144700318727012351]", + "[1144700318727012353, 1144700456165965823]", + "[1144700456165965824, 1144700456165965824]", + "[1144700456165965825, 1144701005921779711]", + "[1144701005921779713, 1144701555677593599]", + "[1144701555677593600, 1144701555677593600]", + "[1144701555677593601, 1144703754700849151]", + "[1144703754700849153, 1144705953724104703]", + "[1144705953724104704, 1144705953724104704]", + "[1144705953724104705, 1144714749817126911]", + "[1144714749817126913, 1144723545910149119]", + "[1144723545910149121, 1144758730282237951]", + "[1144758730282237952, 1144758730282237952]", + "[1144758730282237953, 1144899467770593279]", + "[1144899467770593281, 1145040205258948607]", + "[1145040205258948608, 1145040205258948608]", + "[1145040205258948609, 1145603155212369919]", + "[1145603155212369921, 1146166105165791231]", + "[1147292005072633856, 1147292005072633856]", + "[1148136430002765824, 1148136430002765824]", + "[1148277167491121153, 1148417904979476479]", + "[1148417904979476480, 1148417904979476480]", + "[1148417904979476481, 1148980854932897791]", + "[1149543804886319104, 1149543804886319104]", + "[1150106754839740417, 1150669704793161727]", + "[1150669704793161729, 1151232654746583039]", + "[1151232654746583041, 1151795604700004351]", + "[1151795604700004352, 1151795604700004352]", + "[1155454779397242880, 1155454779397242880]", + "[1155454779397242881, 1155595516885598207]", + "[1155595516885598209, 1155736254373953535]", + "[1155736254373953537, 1156299204327374847]", + "[1156299204327374848, 1156299204327374848]", + "[1156299204327374849, 1156862154280796159]", + "[1156862154280796161, 1157002891769151487]", + "[1157002891769151489, 1157143629257506815]", + "[1157143629257506816, 1157143629257506816]", + "[1157425104234217472, 1157425104234217472]", + "[1157425104234217473, 1159676904047902719]", + "[1159676904047902721, 1160239854001324031]", + "[1160239854001324033, 1160380591489679359]", + "[1160521328978034688, 1160521328978034688]", + "[1160662066466390017, 1160802803954745343]", + "[1160802803954745344, 1160802803954745344]", + "[1160802803954745345, 1160943541443100671]", + "[1161084278931456000, 1161084278931456000]", + "[1161225016419811329, 1161365753908166655]", + "[1161365753908166657, 1161928703861587967]", + "[1170935903116328960, 1170935903116328960]", + "[1224979098644774912, 1224979098644774912]", + "[1918533441259831297, 1919096391213252607]", + "[1919096391213252609, 1919659341166673919]", + "[1919659341166673920, 1919659341166673920]", + "[1919659341166673921, 1920222291120095231]", + "[1920222291120095233, 1920363028608450559]", + "[1920363028608450561, 1920503766096805887]", + "[1920503766096805888, 1920503766096805888]", + "[1920503766096805889, 1920644503585161215]", + "[1921911140980359168, 1921911140980359168]", + "[1921911140980359169, 1922474090933780479]", + "[1922474090933780481, 1923037040887201791]", + "[1923037040887201792, 1923037040887201792]", + "[1923037040887201793, 1923599990840623103]", + "[1923599990840623105, 1924162940794044415]", + "[1924162940794044416, 1924162940794044416]", + "[1925992528142663681, 1926133265631019007]", + "[1926133265631019008, 1926133265631019008]", + "[1926414740607729664, 1926414740607729664]", + "[1927540640514572288, 1927540640514572288]", + "[1945555039024054272, 1945555039024054272]" + ] + }, + "keysExamined" : 5, + "seeks" : 3, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 2, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 2, + "needTime" : 2, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 2, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 2, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 2, + "needTime" : 2, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[360287970189639680, 360287970189639680]", + "[373798769071751168, 373798769071751168]", + "[373798769071751169, 376050568885436415]", + "[376050568885436417, 376613518838857727]", + "[377176468792279040, 377176468792279040]", + "[378020893722411008, 378020893722411008]", + "[378091262466588672, 378091262466588672]", + "[378091262466588673, 378126446838677503]", + "[378302368699121664, 378302368699121664]", + "[378302368699121665, 380554168512806911]", + "[380554168512806913, 381117118466228223]", + "[381117118466228225, 381680068419649535]", + "[381680068419649536, 381680068419649536]", + "[382243018373070849, 382805968326492159]", + "[382805968326492160, 382805968326492160]", + "[385620718093598721, 386183668047020031]", + "[386183668047020032, 386183668047020032]", + "[386183668047020033, 386746618000441343]", + "[386746618000441345, 387309567953862655]", + "[387309567953862657, 389561367767547903]", + "[389561367767547905, 391813167581233151]", + "[391813167581233152, 391813167581233152]", + "[1080863910568919040, 1080863910568919040]", + "[1119144507401568257, 1121396307215253503]", + "[1121396307215253504, 1121396307215253504]", + "[1121396307215253505, 1123648107028938751]", + "[1130403506469994496, 1130403506469994496]", + "[1133781206190522368, 1133781206190522368]", + "[1134344156143943681, 1134907106097364991]", + "[1134907106097364992, 1134907106097364992]", + "[1134907106097364993, 1143914305352105983]", + "[1146166105165791233, 1146729055119212543]", + "[1146729055119212545, 1147292005072633855]", + "[1147292005072633856, 1147292005072633856]", + "[1147292005072633857, 1147854955026055167]", + "[1147854955026055169, 1147995692514410495]", + "[1147995692514410497, 1148136430002765823]", + "[1148136430002765824, 1148136430002765824]", + "[1148136430002765825, 1148277167491121151]", + "[1148417904979476480, 1148417904979476480]", + "[1148980854932897793, 1149543804886319103]", + "[1149543804886319104, 1149543804886319104]", + "[1149543804886319105, 1150106754839740415]", + "[1161928703861587969, 1170935903116328959]", + "[1170935903116328960, 1170935903116328960]", + "[1170935903116328961, 1173187702930014207]", + "[1175439502743699456, 1175439502743699456]", + "[1179943102371069953, 1188950301625810943]", + "[1224979098644774912, 1224979098644774912]", + "[1909526242005090305, 1918533441259831295]", + "[1923037040887201792, 1923037040887201792]", + "[1924162940794044416, 1924162940794044416]", + "[1924162940794044417, 1924725890747465727]", + "[1924725890747465729, 1925288840700887039]", + "[1925288840700887041, 1925851790654308351]", + "[1925851790654308353, 1925992528142663679]", + "[1926133265631019008, 1926133265631019008]", + "[1926133265631019009, 1926274003119374335]", + "[1926274003119374337, 1926414740607729663]", + "[1926414740607729664, 1926414740607729664]", + "[1926414740607729665, 1926977690561150975]", + "[1926977690561150977, 1927540640514572287]", + "[1927540640514572288, 1927540640514572288]", + "[1927540640514572289, 1929792440328257535]", + "[1929792440328257537, 1932044240141942783]", + "[1932044240141942784, 1932044240141942784]", + "[1939362589536419841, 1939925539489841151]", + "[1939925539489841152, 1939925539489841152]", + "[1941051439396683776, 1941051439396683776]", + "[1945555039024054272, 1945555039024054272]" + ] + }, + "keysExamined" : 4, + "seeks" : 3, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 2, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 2, + "needTime" : 2, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 2, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 2, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 2, + "needTime" : 2, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[342273571680157696, 342273571680157696]", + "[342273571680157697, 351280770934898687]", + "[351280770934898689, 353532570748583935]", + "[355784370562269184, 355784370562269184]", + "[358036170375954433, 360287970189639679]", + "[360287970189639680, 360287970189639680]", + "[360287970189639681, 369295169444380671]", + "[369295169444380673, 371546969258065919]", + "[371546969258065921, 373798769071751167]", + "[373798769071751168, 373798769071751168]", + "[376613518838857729, 377176468792279039]", + "[377176468792279040, 377176468792279040]", + "[377176468792279041, 377739418745700351]", + "[377739418745700353, 377880156234055679]", + "[377880156234055681, 378020893722411007]", + "[378020893722411008, 378020893722411008]", + "[378020893722411009, 378056078094499839]", + "[378056078094499841, 378091262466588671]", + "[378091262466588672, 378091262466588672]", + "[378126446838677505, 378161631210766335]", + "[378161631210766337, 378302368699121663]", + "[378302368699121664, 378302368699121664]", + "[391813167581233152, 391813167581233152]", + "[391813167581233153, 394064967394918399]", + "[394064967394918401, 396316767208603647]", + "[396316767208603649, 405323966463344639]", + "[405323966463344641, 414331165718085631]", + "[414331165718085632, 414331165718085632]", + "[1008806316530991105, 1044835113549955071]", + "[1062849512059437056, 1062849512059437056]", + "[1076360310941548544, 1076360310941548544]", + "[1079738010662076416, 1079738010662076416]", + "[1080300960615497729, 1080863910568919039]", + "[1080863910568919040, 1080863910568919040]", + "[1080863910568919041, 1089871109823660031]", + "[1098878309078401024, 1098878309078401024]", + "[1107885508333142017, 1116892707587883007]", + "[1116892707587883009, 1119144507401568255]", + "[1121396307215253504, 1121396307215253504]", + "[1123648107028938753, 1125899906842623999]", + "[1125899906842624001, 1128151706656309247]", + "[1128151706656309249, 1130403506469994495]", + "[1130403506469994496, 1130403506469994496]", + "[1130403506469994497, 1132655306283679743]", + "[1132655306283679745, 1133218256237101055]", + "[1133218256237101057, 1133781206190522367]", + "[1133781206190522368, 1133781206190522368]", + "[1133781206190522369, 1134344156143943679]", + "[1134907106097364992, 1134907106097364992]", + "[1170935903116328960, 1170935903116328960]", + "[1173187702930014209, 1175439502743699455]", + "[1175439502743699456, 1175439502743699456]", + "[1175439502743699457, 1177691302557384703]", + "[1177691302557384705, 1179943102371069951]", + "[1188950301625810945, 1224979098644774911]", + "[1224979098644774912, 1224979098644774912]", + "[1224979098644774913, 1233986297899515903]", + "[1242993497154256896, 1242993497154256896]", + "[1261007895663738881, 1297036692682702847]", + "[1873497444986126337, 1909526242005090303]", + "[1927540640514572288, 1927540640514572288]", + "[1932044240141942784, 1932044240141942784]", + "[1932044240141942785, 1934296039955628031]", + "[1934296039955628033, 1936547839769313279]", + "[1936547839769313281, 1938799639582998527]", + "[1938799639582998529, 1939362589536419839]", + "[1939925539489841152, 1939925539489841152]", + "[1939925539489841153, 1940488489443262463]", + "[1940488489443262465, 1941051439396683775]", + "[1941051439396683776, 1941051439396683776]", + "[1941051439396683777, 1943303239210369023]", + "[1943303239210369025, 1945555039024054271]", + "[1945555039024054272, 1945555039024054272]", + "[1945555039024054273, 1954562238278795263]", + "[1954562238278795265, 1963569437533536255]", + "[1963569437533536256, 1963569437533536256]", + "[1993405785064865793, 1993968735018287103]", + "[1993968735018287104, 1993968735018287104]", + "[1995094634925129728, 1995094634925129728]", + "[1999598234552500224, 1999598234552500224]" + ] + }, + "keysExamined" : 4, + "seeks" : 3, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 2, + "advanced" : 0, + "needTime" : 1, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 0, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 2, + "advanced" : 0, + "needTime" : 1, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[144115188075855873, 288230376151711743]", + "[288230376151711745, 324259173170675711]", + "[324259173170675713, 333266372425416703]", + "[333266372425416705, 342273571680157695]", + "[342273571680157696, 342273571680157696]", + "[353532570748583937, 355784370562269183]", + "[355784370562269184, 355784370562269184]", + "[355784370562269185, 358036170375954431]", + "[360287970189639680, 360287970189639680]", + "[414331165718085632, 414331165718085632]", + "[414331165718085633, 423338364972826623]", + "[423338364972826625, 432345564227567615]", + "[432345564227567617, 468374361246531583]", + "[468374361246531585, 504403158265495551]", + "[504403158265495552, 504403158265495552]", + "[612489549322387457, 648518346341351423]", + "[648518346341351424, 648518346341351424]", + "[648518346341351425, 684547143360315391]", + "[792633534417207296, 792633534417207296]", + "[846676729945653248, 846676729945653248]", + "[860187528827764736, 860187528827764736]", + "[863565228548292608, 863565228548292608]", + "[864128178501713921, 864691128455135231]", + "[864691128455135233, 900719925474099199]", + "[936748722493063168, 936748722493063168]", + "[972777519512027137, 1008806316530991103]", + "[1044835113549955073, 1053842312804696063]", + "[1053842312804696065, 1062849512059437055]", + "[1062849512059437056, 1062849512059437056]", + "[1062849512059437057, 1071856711314178047]", + "[1071856711314178049, 1074108511127863295]", + "[1074108511127863297, 1076360310941548543]", + "[1076360310941548544, 1076360310941548544]", + "[1076360310941548545, 1078612110755233791]", + "[1078612110755233793, 1079175060708655103]", + "[1079175060708655105, 1079738010662076415]", + "[1079738010662076416, 1079738010662076416]", + "[1079738010662076417, 1080300960615497727]", + "[1080863910568919040, 1080863910568919040]", + "[1089871109823660033, 1098878309078401023]", + "[1098878309078401024, 1098878309078401024]", + "[1098878309078401025, 1107885508333142015]", + "[1224979098644774912, 1224979098644774912]", + "[1233986297899515905, 1242993497154256895]", + "[1242993497154256896, 1242993497154256896]", + "[1242993497154256897, 1252000696408997887]", + "[1252000696408997889, 1261007895663738879]", + "[1297036692682702849, 1333065489701666815]", + "[1369094286720630784, 1369094286720630784]", + "[1405123083739594753, 1441151880758558719]", + "[1441151880758558721, 1450159080013299711]", + "[1459166279268040704, 1459166279268040704]", + "[1513209474796486656, 1513209474796486656]", + "[1585267068834414593, 1729382256910270463]", + "[1729382256910270465, 1873497444986126335]", + "[1945555039024054272, 1945555039024054272]", + "[1963569437533536256, 1963569437533536256]", + "[1963569437533536257, 1972576636788277247]", + "[1972576636788277249, 1981583836043018239]", + "[1981583836043018241, 1990591035297759231]", + "[1990591035297759233, 1992842835111444479]", + "[1992842835111444481, 1993405785064865791]", + "[1993968735018287104, 1993968735018287104]", + "[1993968735018287105, 1994531684971708415]", + "[1994531684971708417, 1995094634925129727]", + "[1995094634925129728, 1995094634925129728]", + "[1995094634925129729, 1997346434738814975]", + "[1997346434738814977, 1999598234552500223]", + "[1999598234552500224, 1999598234552500224]", + "[1999598234552500225, 2008605433807241215]", + "[2008605433807241217, 2017612633061982207]", + "[2017612633061982209, 2053641430080946175]", + "[2053641430080946177, 2089670227099910143]", + "[2089670227099910144, 2089670227099910144]", + "[2209578567178649601, 2210141517132070911]", + "[2210141517132070912, 2210141517132070912]", + "[2211267417038913536, 2211267417038913536]", + "[2215771016666284032, 2215771016666284032]", + "[2233785415175766016, 2233785415175766016]" + ] + }, + "keysExamined" : 1, + "seeks" : 2, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 2, + "advanced" : 0, + "needTime" : 1, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 0, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 2, + "advanced" : 0, + "needTime" : 1, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[-8502796096475496447, -8358680908399640577]", + "[-8358680908399640575, -8214565720323784705]", + "[-7926335344172072959, -7782220156096217089]", + "[-7782220156096217087, -7638104968020361217]", + "[-5476377146882523135, -5332261958806667265]", + "[-5332261958806667263, -5188146770730811393]", + "[-5188146770730811391, -5044031582654955521]", + "[-4755801206503243775, -4611686018427387905]", + "[1, 144115188075855871]", + "[504403158265495552, 504403158265495552]", + "[504403158265495553, 540431955284459519]", + "[540431955284459521, 576460752303423487]", + "[576460752303423489, 612489549322387455]", + "[648518346341351424, 648518346341351424]", + "[684547143360315393, 720575940379279359]", + "[720575940379279361, 756604737398243327]", + "[756604737398243329, 792633534417207295]", + "[792633534417207296, 792633534417207296]", + "[792633534417207297, 828662331436171263]", + "[828662331436171265, 837669530690912255]", + "[837669530690912257, 846676729945653247]", + "[846676729945653248, 846676729945653248]", + "[846676729945653249, 855683929200394239]", + "[855683929200394241, 857935729014079487]", + "[857935729014079489, 860187528827764735]", + "[860187528827764736, 860187528827764736]", + "[860187528827764737, 862439328641449983]", + "[862439328641449985, 863002278594871295]", + "[863002278594871297, 863565228548292607]", + "[863565228548292608, 863565228548292608]", + "[863565228548292609, 864128178501713919]", + "[900719925474099201, 936748722493063167]", + "[936748722493063168, 936748722493063168]", + "[936748722493063169, 972777519512027135]", + "[1333065489701666817, 1369094286720630783]", + "[1369094286720630784, 1369094286720630784]", + "[1369094286720630785, 1405123083739594751]", + "[1450159080013299713, 1459166279268040703]", + "[1459166279268040704, 1459166279268040704]", + "[1459166279268040705, 1468173478522781695]", + "[1468173478522781697, 1477180677777522687]", + "[1477180677777522689, 1513209474796486655]", + "[1513209474796486656, 1513209474796486656]", + "[1513209474796486657, 1549238271815450623]", + "[1549238271815450625, 1585267068834414591]", + "[2089670227099910144, 2089670227099910144]", + "[2089670227099910145, 2125699024118874111]", + "[2125699024118874113, 2161727821137838079]", + "[2161727821137838081, 2197756618156802047]", + "[2197756618156802049, 2206763817411543039]", + "[2206763817411543041, 2209015617225228287]", + "[2209015617225228289, 2209578567178649599]", + "[2210141517132070912, 2210141517132070912]", + "[2210141517132070913, 2210704467085492223]", + "[2210704467085492225, 2211267417038913535]", + "[2211267417038913536, 2211267417038913536]", + "[2211267417038913537, 2213519216852598783]", + "[2213519216852598785, 2215771016666284031]", + "[2215771016666284032, 2215771016666284032]", + "[2215771016666284033, 2224778215921025023]", + "[2224778215921025025, 2233785415175766015]", + "[2233785415175766016, 2233785415175766016]", + "[2233785415175766017, 2269814212194729983]", + "[2269814212194729985, 2305843009213693951]", + "[2305843009213693953, 2449958197289549823]", + "[2449958197289549825, 2594073385365405695]", + "[4323455642275676161, 4467570830351532031]", + "[4467570830351532033, 4611686018427387903]", + "[4611686018427387905, 4755801206503243775]", + "[5044031582654955521, 5188146770730811391]", + "[5188146770730811393, 5332261958806667263]", + "[5332261958806667265, 5476377146882523135]" + ] + }, + "keysExamined" : 1, + "seeks" : 2, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 2, + "advanced" : 0, + "needTime" : 1, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 0, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 2, + "advanced" : 0, + "needTime" : 1, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[-9223372036854775807, -8646911284551352321]", + "[-8646911284551352319, -8502796096475496449]", + "[-8214565720323784703, -8070450532247928833]", + "[-8070450532247928831, -7926335344172072961]", + "[-7638104968020361215, -7493989779944505345]", + "[-7493989779944505343, -6917529027641081857]", + "[-6917529027641081855, -6341068275337658369]", + "[-6341068275337658367, -5764607523034234881]", + "[-5764607523034234879, -5620492334958379009]", + "[-5620492334958379007, -5476377146882523137]", + "[-5044031582654955519, -4899916394579099649]", + "[-4899916394579099647, -4755801206503243777]", + "[2594073385365405697, 2738188573441261567]", + "[2738188573441261569, 2882303761517117439]", + "[2882303761517117441, 3458764513820540927]", + "[3458764513820540929, 4035225266123964415]", + "[4035225266123964417, 4179340454199820287]", + "[4179340454199820289, 4323455642275676159]", + "[4755801206503243777, 4899916394579099647]", + "[4899916394579099649, 5044031582654955519]", + "[5476377146882523137, 5620492334958379007]", + "[5620492334958379009, 5764607523034234879]", + "[5764607523034234881, 6341068275337658367]", + "[6341068275337658369, 6917529027641081855]", + "[6917529027641081857, 6926536226895822847]", + "[6935543426150563840, 6935543426150563840]", + "[6989586621679009792, 6989586621679009792]", + "[7686096451549528065, 7686237189037883391]", + "[7686237189037883392, 7686237189037883392]", + "[7686518664014594048, 7686518664014594048]", + "[7687644563921436672, 7687644563921436672]", + "[7692148163548807168, 7692148163548807168]", + "[7710162562058289152, 7710162562058289152]", + "[9151314442816847872, 9151314442816847872]", + "[9205357638345293824, 9205357638345293824]", + "[9218868437227405312, 9218868437227405312]", + "[9222246136947933184, 9222246136947933184]", + "[9223090561878065152, 9223090561878065152]", + "[9223231299366420481, 9223372036854775807]" + ] + }, + "keysExamined" : 1, + "seeks" : 2, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 1, + "advanced" : 0, + "needTime" : 0, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 0, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 1, + "advanced" : 0, + "needTime" : 0, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[6926536226895822849, 6935543426150563839]", + "[6935543426150563840, 6935543426150563840]", + "[6935543426150563841, 6944550625405304831]", + "[6944550625405304833, 6953557824660045823]", + "[6953557824660045825, 6989586621679009791]", + "[6989586621679009792, 6989586621679009792]", + "[6989586621679009793, 7025615418697973759]", + "[7025615418697973761, 7061644215716937727]", + "[7061644215716937729, 7205759403792793599]", + "[7205759403792793601, 7349874591868649471]", + "[7349874591868649473, 7493989779944505343]", + "[7493989779944505345, 7638104968020361215]", + "[7638104968020361217, 7674133765039325183]", + "[7674133765039325185, 7683140964294066175]", + "[7683140964294066177, 7685392764107751423]", + "[7685392764107751425, 7685955714061172735]", + "[7685955714061172737, 7686096451549528063]", + "[7686237189037883392, 7686237189037883392]", + "[7686237189037883393, 7686377926526238719]", + "[7686377926526238721, 7686518664014594047]", + "[7686518664014594048, 7686518664014594048]", + "[7686518664014594049, 7687081613968015359]", + "[7687081613968015361, 7687644563921436671]", + "[7687644563921436672, 7687644563921436672]", + "[7687644563921436673, 7689896363735121919]", + "[7689896363735121921, 7692148163548807167]", + "[7692148163548807168, 7692148163548807168]", + "[7692148163548807169, 7701155362803548159]", + "[7701155362803548161, 7710162562058289151]", + "[7710162562058289152, 7710162562058289152]", + "[7710162562058289153, 7746191359077253119]", + "[7746191359077253121, 7782220156096217087]", + "[7782220156096217089, 7926335344172072959]", + "[7926335344172072961, 8070450532247928831]", + "[8070450532247928833, 8646911284551352319]", + "[8646911284551352321, 8791026472627208191]", + "[8791026472627208193, 8935141660703064063]", + "[8935141660703064065, 9079256848778919935]", + "[9079256848778919937, 9115285645797883903]", + "[9115285645797883905, 9151314442816847871]", + "[9151314442816847872, 9151314442816847872]", + "[9151314442816847873, 9187343239835811839]", + "[9187343239835811841, 9196350439090552831]", + "[9196350439090552833, 9205357638345293823]", + "[9205357638345293824, 9205357638345293824]", + "[9205357638345293825, 9214364837600034815]", + "[9214364837600034817, 9216616637413720063]", + "[9216616637413720065, 9218868437227405311]", + "[9218868437227405312, 9218868437227405312]", + "[9218868437227405313, 9221120237041090559]", + "[9221120237041090561, 9221683186994511871]", + "[9221683186994511873, 9222246136947933183]", + "[9222246136947933184, 9222246136947933184]", + "[9222246136947933185, 9222809086901354495]", + "[9222809086901354497, 9222949824389709823]", + "[9222949824389709825, 9223090561878065151]", + "[9223090561878065152, 9223090561878065152]", + "[9223090561878065153, 9223231299366420479]" + ] + }, + "keysExamined" : 0, + "seeks" : 1, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + } + ] + } + } + }, + "ts" : ISODate("2017-08-20T15:39:48.842Z"), + "client" : "127.0.0.1", + "appName" : "MongoDB Shell", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/group_2.6.12 b/src/go/tests/doc/out/group_2.6.12 new file mode 100644 index 00000000..53de6267 --- /dev/null +++ b/src/go/tests/doc/out/group_2.6.12 @@ -0,0 +1,41 @@ +{ + "op" : "command", + "ns" : "test.$cmd", + "command" : { + "group" : { + "key" : { + "a" : 1, + "b" : 1 + }, + "cond" : { + "b" : 3 + }, + "initial" : { + + }, + "ns" : "coll", + "$reduce" : function () {} + } + }, + "keyUpdates" : 0, + "numYield" : 0, + "lockStats" : { + "timeLockedMicros" : { + "r" : NumberLong(77899), + "w" : NumberLong(0) + }, + "timeAcquiringMicros" : { + "r" : NumberLong(3), + "w" : NumberLong(2075) + } + }, + "responseLength" : 135, + "millis" : 77, + "execStats" : { + + }, + "ts" : ISODate("2017-08-20T15:39:16.325Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/group_3.0.15 b/src/go/tests/doc/out/group_3.0.15 new file mode 100644 index 00000000..8daf8b7f --- /dev/null +++ b/src/go/tests/doc/out/group_3.0.15 @@ -0,0 +1,54 @@ +{ + "op" : "command", + "ns" : "test.$cmd", + "command" : { + "group" : { + "key" : { + "a" : 1, + "b" : 1 + }, + "cond" : { + "b" : 3 + }, + "initial" : { + + }, + "ns" : "coll", + "$reduce" : function () {} + } + }, + "keyUpdates" : 0, + "writeConflicts" : 0, + "numYield" : 1, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(6) + } + }, + "MMAPV1Journal" : { + "acquireCount" : { + "r" : NumberLong(2) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(3) + } + }, + "Collection" : { + "acquireCount" : { + "R" : NumberLong(3) + } + } + }, + "responseLength" : 139, + "millis" : 54, + "execStats" : { + + }, + "ts" : ISODate("2017-08-20T15:39:22.271Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/group_3.2.16 b/src/go/tests/doc/out/group_3.2.16 new file mode 100644 index 00000000..44e8ac00 --- /dev/null +++ b/src/go/tests/doc/out/group_3.2.16 @@ -0,0 +1,50 @@ +{ + "op" : "command", + "ns" : "test.coll", + "command" : { + "group" : { + "key" : { + "a" : 1, + "b" : 1 + }, + "cond" : { + "b" : 3 + }, + "initial" : { + + }, + "ns" : "coll", + "$reduce" : function () {} + } + }, + "keyUpdates" : 0, + "writeConflicts" : 0, + "numYield" : 1, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(6) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(3) + } + }, + "Collection" : { + "acquireCount" : { + "r" : NumberLong(3) + } + } + }, + "responseLength" : 142, + "protocol" : "op_command", + "millis" : 74, + "execStats" : { + + }, + "ts" : ISODate("2017-08-20T15:39:32.101Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/group_3.4.7 b/src/go/tests/doc/out/group_3.4.7 new file mode 100644 index 00000000..681a76ac --- /dev/null +++ b/src/go/tests/doc/out/group_3.4.7 @@ -0,0 +1,116 @@ +{ + "op" : "command", + "ns" : "test.coll", + "command" : { + "group" : { + "key" : { + "a" : 1, + "b" : 1 + }, + "cond" : { + "b" : 3 + }, + "initial" : { + + }, + "ns" : "coll", + "$reduce" : { + "code" : "function () {}" + } + } + }, + "keysExamined" : 2, + "docsExamined" : 2, + "numYield" : 1, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(6) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(3) + } + }, + "Collection" : { + "acquireCount" : { + "r" : NumberLong(3) + } + } + }, + "responseLength" : 124, + "protocol" : "op_command", + "millis" : 77, + "planSummary" : "IXSCAN { b: -1 }", + "execStats" : { + "stage" : "GROUP", + "nReturned" : 1, + "executionTimeMillisEstimate" : 75, + "works" : 4, + "advanced" : 1, + "needTime" : 3, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "nGroups" : 2, + "inputStage" : { + "stage" : "FETCH", + "nReturned" : 2, + "executionTimeMillisEstimate" : 0, + "works" : 3, + "advanced" : 2, + "needTime" : 0, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 2, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 2, + "executionTimeMillisEstimate" : 0, + "works" : 3, + "advanced" : 2, + "needTime" : 0, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "b" : -1 + }, + "indexName" : "b_-1", + "isMultiKey" : false, + "multiKeyPaths" : { + "b" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "b" : [ + "[3.0, 3.0]" + ] + }, + "keysExamined" : 2, + "seeks" : 1, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + } + }, + "ts" : ISODate("2017-08-20T15:39:38.886Z"), + "client" : "127.0.0.1", + "appName" : "MongoDB Shell", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/group_3.5.11 b/src/go/tests/doc/out/group_3.5.11 new file mode 100644 index 00000000..4ff8fa94 --- /dev/null +++ b/src/go/tests/doc/out/group_3.5.11 @@ -0,0 +1,117 @@ +{ + "op" : "command", + "ns" : "test.coll", + "command" : { + "group" : { + "key" : { + "a" : 1, + "b" : 1 + }, + "cond" : { + "b" : 3 + }, + "initial" : { + + }, + "ns" : "coll", + "$reduce" : { + "code" : "function () {}" + } + }, + "$db" : "test" + }, + "keysExamined" : 2, + "docsExamined" : 2, + "numYield" : 1, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(6) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(3) + } + }, + "Collection" : { + "acquireCount" : { + "r" : NumberLong(3) + } + } + }, + "responseLength" : 124, + "protocol" : "op_msg", + "millis" : 68, + "planSummary" : "IXSCAN { b: -1 }", + "execStats" : { + "stage" : "GROUP", + "nReturned" : 1, + "executionTimeMillisEstimate" : 64, + "works" : 4, + "advanced" : 1, + "needTime" : 3, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "nGroups" : 2, + "inputStage" : { + "stage" : "FETCH", + "nReturned" : 2, + "executionTimeMillisEstimate" : 0, + "works" : 3, + "advanced" : 2, + "needTime" : 0, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 2, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 2, + "executionTimeMillisEstimate" : 0, + "works" : 3, + "advanced" : 2, + "needTime" : 0, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "b" : -1 + }, + "indexName" : "b_-1", + "isMultiKey" : false, + "multiKeyPaths" : { + "b" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "b" : [ + "[3.0, 3.0]" + ] + }, + "keysExamined" : 2, + "seeks" : 1, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + } + }, + "ts" : ISODate("2017-08-20T15:39:49.276Z"), + "client" : "127.0.0.1", + "appName" : "MongoDB Shell", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/insert_2.6.12 b/src/go/tests/doc/out/insert_2.6.12 new file mode 100644 index 00000000..73bd1260 --- /dev/null +++ b/src/go/tests/doc/out/insert_2.6.12 @@ -0,0 +1,28 @@ +{ + "op" : "insert", + "ns" : "test.coll", + "query" : { + "_id" : 1 + }, + "ninserted" : 1, + "keyUpdates" : 0, + "numYield" : 0, + "lockStats" : { + "timeLockedMicros" : { + "r" : NumberLong(0), + "w" : NumberLong(90) + }, + "timeAcquiringMicros" : { + "r" : NumberLong(0), + "w" : NumberLong(4) + } + }, + "millis" : 0, + "execStats" : { + + }, + "ts" : ISODate("2017-08-20T15:39:16.473Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/insert_3.0.15 b/src/go/tests/doc/out/insert_3.0.15 new file mode 100644 index 00000000..f4e6a153 --- /dev/null +++ b/src/go/tests/doc/out/insert_3.0.15 @@ -0,0 +1,42 @@ +{ + "op" : "insert", + "ns" : "test.coll", + "query" : { + "_id" : 1 + }, + "ninserted" : 1, + "keyUpdates" : 0, + "writeConflicts" : 0, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(1), + "w" : NumberLong(1) + } + }, + "MMAPV1Journal" : { + "acquireCount" : { + "w" : NumberLong(2) + } + }, + "Database" : { + "acquireCount" : { + "w" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "W" : NumberLong(1) + } + } + }, + "millis" : 0, + "execStats" : { + + }, + "ts" : ISODate("2017-08-20T15:39:22.409Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/insert_3.2.16 b/src/go/tests/doc/out/insert_3.2.16 new file mode 100644 index 00000000..5bd08bd1 --- /dev/null +++ b/src/go/tests/doc/out/insert_3.2.16 @@ -0,0 +1,45 @@ +{ + "op" : "insert", + "ns" : "test.coll", + "query" : { + "insert" : "coll", + "documents" : [ + { + "_id" : 1 + } + ], + "ordered" : true + }, + "ninserted" : 1, + "keyUpdates" : 0, + "writeConflicts" : 0, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(1), + "w" : NumberLong(1) + } + }, + "Database" : { + "acquireCount" : { + "w" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "w" : NumberLong(1) + } + } + }, + "responseLength" : 25, + "protocol" : "op_command", + "millis" : 0, + "execStats" : { + + }, + "ts" : ISODate("2017-08-20T15:39:32.303Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/insert_3.4.7 b/src/go/tests/doc/out/insert_3.4.7 new file mode 100644 index 00000000..4e8278af --- /dev/null +++ b/src/go/tests/doc/out/insert_3.4.7 @@ -0,0 +1,42 @@ +{ + "op" : "insert", + "ns" : "test.coll", + "query" : { + "insert" : "coll", + "documents" : [ + { + "_id" : 1 + } + ], + "ordered" : true + }, + "ninserted" : 1, + "keysInserted" : 2, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(1), + "w" : NumberLong(1) + } + }, + "Database" : { + "acquireCount" : { + "w" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "w" : NumberLong(1) + } + } + }, + "responseLength" : 29, + "protocol" : "op_command", + "millis" : 0, + "ts" : ISODate("2017-08-20T15:39:39.023Z"), + "client" : "127.0.0.1", + "appName" : "MongoDB Shell", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/insert_3.5.11 b/src/go/tests/doc/out/insert_3.5.11 new file mode 100644 index 00000000..b560d170 --- /dev/null +++ b/src/go/tests/doc/out/insert_3.5.11 @@ -0,0 +1,38 @@ +{ + "op" : "insert", + "ns" : "test.coll", + "command" : { + "insert" : "coll", + "ordered" : true, + "$db" : "test" + }, + "ninserted" : 1, + "keysInserted" : 2, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(1), + "w" : NumberLong(1) + } + }, + "Database" : { + "acquireCount" : { + "w" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "w" : NumberLong(1) + } + } + }, + "responseLength" : 29, + "protocol" : "op_msg", + "millis" : 0, + "ts" : ISODate("2017-08-20T15:39:49.440Z"), + "client" : "127.0.0.1", + "appName" : "MongoDB Shell", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/mapreduce_2.6.12 b/src/go/tests/doc/out/mapreduce_2.6.12 new file mode 100644 index 00000000..e1978210 --- /dev/null +++ b/src/go/tests/doc/out/mapreduce_2.6.12 @@ -0,0 +1,42 @@ +{ + "op" : "command", + "ns" : "test.$cmd", + "command" : { + "mapreduce" : "coll", + "map" : function () { + emit(this.a, this.b); +}, + "reduce" : function (a, b) { + return Array.sum(b); +}, + "query" : { + "a" : { + "$gte" : 0 + } + }, + "out" : { + "inline" : 1 + } + }, + "keyUpdates" : 0, + "numYield" : 0, + "lockStats" : { + "timeLockedMicros" : { + "r" : NumberLong(226), + "w" : NumberLong(0) + }, + "timeAcquiringMicros" : { + "r" : NumberLong(4), + "w" : NumberLong(13) + } + }, + "responseLength" : 233, + "millis" : 33, + "execStats" : { + + }, + "ts" : ISODate("2017-08-20T15:39:16.701Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/mapreduce_3.0.15 b/src/go/tests/doc/out/mapreduce_3.0.15 new file mode 100644 index 00000000..725e50fc --- /dev/null +++ b/src/go/tests/doc/out/mapreduce_3.0.15 @@ -0,0 +1,60 @@ +{ + "op" : "command", + "ns" : "test.$cmd", + "command" : { + "mapreduce" : "coll", + "map" : function () { + emit(this.a, this.b); +}, + "reduce" : function (a, b) { + return Array.sum(b); +}, + "query" : { + "a" : { + "$gte" : 0 + } + }, + "out" : { + "inline" : 1 + } + }, + "keyUpdates" : 0, + "writeConflicts" : 0, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(9), + "w" : NumberLong(1) + } + }, + "MMAPV1Journal" : { + "acquireCount" : { + "r" : NumberLong(4), + "w" : NumberLong(2) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(2), + "w" : NumberLong(1), + "R" : NumberLong(2) + } + }, + "Collection" : { + "acquireCount" : { + "R" : NumberLong(2), + "W" : NumberLong(1) + } + } + }, + "responseLength" : 233, + "millis" : 26, + "execStats" : { + + }, + "ts" : ISODate("2017-08-20T15:39:22.582Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/mapreduce_3.2.16 b/src/go/tests/doc/out/mapreduce_3.2.16 new file mode 100644 index 00000000..44944aaf --- /dev/null +++ b/src/go/tests/doc/out/mapreduce_3.2.16 @@ -0,0 +1,60 @@ +{ + "op" : "command", + "ns" : "test.coll", + "command" : { + "mapreduce" : "coll", + "map" : function () { + emit(this.a, this.b); +}, + "reduce" : function (a, b) { + return Array.sum(b); +}, + "query" : { + "a" : { + "$gte" : 0 + } + }, + "out" : { + "inline" : 1 + } + }, + "keyUpdates" : 0, + "writeConflicts" : 0, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(9), + "w" : NumberLong(1) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(2), + "w" : NumberLong(1), + "R" : NumberLong(2) + } + }, + "Collection" : { + "acquireCount" : { + "r" : NumberLong(2), + "w" : NumberLong(1) + } + }, + "Metadata" : { + "acquireCount" : { + "W" : NumberLong(1) + } + } + }, + "responseLength" : 218, + "protocol" : "op_command", + "millis" : 31, + "execStats" : { + + }, + "ts" : ISODate("2017-08-20T15:39:32.572Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/mapreduce_3.4.7 b/src/go/tests/doc/out/mapreduce_3.4.7 new file mode 100644 index 00000000..5e3de99f --- /dev/null +++ b/src/go/tests/doc/out/mapreduce_3.4.7 @@ -0,0 +1,110 @@ +{ + "op" : "command", + "ns" : "test.coll", + "command" : { + "mapreduce" : "coll", + "map" : { + "code" : "function () {\n emit(this.a, this.b);\n}" + }, + "reduce" : { + "code" : "function (a, b) {\n return Array.sum(b);\n}" + }, + "query" : { + "a" : { + "$gte" : 0 + } + }, + "out" : { + "inline" : 1 + } + }, + "keysExamined" : 3, + "docsExamined" : 3, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(11), + "w" : NumberLong(1) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(3), + "w" : NumberLong(1), + "R" : NumberLong(2) + } + }, + "Collection" : { + "acquireCount" : { + "r" : NumberLong(3), + "w" : NumberLong(1) + } + }, + "Metadata" : { + "acquireCount" : { + "W" : NumberLong(1) + } + } + }, + "responseLength" : 218, + "protocol" : "op_command", + "millis" : 43, + "planSummary" : "IXSCAN { a: 1 }", + "execStats" : { + "stage" : "FETCH", + "nReturned" : 3, + "executionTimeMillisEstimate" : 0, + "works" : 4, + "advanced" : 3, + "needTime" : 0, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 3, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 3, + "executionTimeMillisEstimate" : 0, + "works" : 4, + "advanced" : 3, + "needTime" : 0, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "a" : 1 + }, + "indexName" : "a_1", + "isMultiKey" : false, + "multiKeyPaths" : { + "a" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "a" : [ + "[0.0, inf.0]" + ] + }, + "keysExamined" : 3, + "seeks" : 1, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + "ts" : ISODate("2017-08-20T15:39:39.249Z"), + "client" : "127.0.0.1", + "appName" : "MongoDB Shell", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/mapreduce_3.5.11 b/src/go/tests/doc/out/mapreduce_3.5.11 new file mode 100644 index 00000000..3b9c8f7e --- /dev/null +++ b/src/go/tests/doc/out/mapreduce_3.5.11 @@ -0,0 +1,111 @@ +{ + "op" : "command", + "ns" : "test.coll", + "command" : { + "mapreduce" : "coll", + "map" : { + "code" : "function () {\n emit(this.a, this.b);\n}" + }, + "reduce" : { + "code" : "function (a, b) {\n return Array.sum(b);\n}" + }, + "query" : { + "a" : { + "$gte" : 0 + } + }, + "out" : { + "inline" : 1 + }, + "$db" : "test" + }, + "keysExamined" : 3, + "docsExamined" : 3, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(9), + "w" : NumberLong(1) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(2), + "w" : NumberLong(1), + "R" : NumberLong(2) + } + }, + "Collection" : { + "acquireCount" : { + "r" : NumberLong(2), + "w" : NumberLong(1) + } + }, + "Metadata" : { + "acquireCount" : { + "W" : NumberLong(1) + } + } + }, + "responseLength" : 218, + "protocol" : "op_msg", + "millis" : 35, + "planSummary" : "IXSCAN { a: 1 }", + "execStats" : { + "stage" : "FETCH", + "nReturned" : 3, + "executionTimeMillisEstimate" : 0, + "works" : 4, + "advanced" : 3, + "needTime" : 0, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 3, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 3, + "executionTimeMillisEstimate" : 0, + "works" : 4, + "advanced" : 3, + "needTime" : 0, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "a" : 1 + }, + "indexName" : "a_1", + "isMultiKey" : false, + "multiKeyPaths" : { + "a" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "a" : [ + "[0.0, inf.0]" + ] + }, + "keysExamined" : 3, + "seeks" : 1, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + "ts" : ISODate("2017-08-20T15:39:49.680Z"), + "client" : "127.0.0.1", + "appName" : "MongoDB Shell", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/update_2.6.12 b/src/go/tests/doc/out/update_2.6.12 new file mode 100644 index 00000000..f33f95b6 --- /dev/null +++ b/src/go/tests/doc/out/update_2.6.12 @@ -0,0 +1,43 @@ +{ + "op" : "update", + "ns" : "test.coll", + "query" : { + "a" : { + "$gte" : 2 + } + }, + "updateobj" : { + "$set" : { + "c" : 1 + }, + "$inc" : { + "a" : -10 + } + }, + "nscanned" : 1, + "nscannedObjects" : 1, + "moved" : true, + "nmoved" : 1, + "nMatched" : 1, + "nModified" : 1, + "keyUpdates" : 0, + "numYield" : 0, + "lockStats" : { + "timeLockedMicros" : { + "r" : NumberLong(0), + "w" : NumberLong(285) + }, + "timeAcquiringMicros" : { + "r" : NumberLong(0), + "w" : NumberLong(4) + } + }, + "millis" : 0, + "execStats" : { + + }, + "ts" : ISODate("2017-08-20T15:39:16.921Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/update_3.0.15 b/src/go/tests/doc/out/update_3.0.15 new file mode 100644 index 00000000..d1e4f3c7 --- /dev/null +++ b/src/go/tests/doc/out/update_3.0.15 @@ -0,0 +1,57 @@ +{ + "op" : "update", + "ns" : "test.coll", + "query" : { + "a" : { + "$gte" : 2 + } + }, + "updateobj" : { + "$set" : { + "c" : 1 + }, + "$inc" : { + "a" : -10 + } + }, + "nscanned" : 1, + "nscannedObjects" : 1, + "moved" : true, + "nmoved" : 1, + "nMatched" : 1, + "nModified" : 1, + "keyUpdates" : 0, + "writeConflicts" : 0, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(1), + "w" : NumberLong(1) + } + }, + "MMAPV1Journal" : { + "acquireCount" : { + "w" : NumberLong(2) + } + }, + "Database" : { + "acquireCount" : { + "w" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "W" : NumberLong(1) + } + } + }, + "millis" : 0, + "execStats" : { + + }, + "ts" : ISODate("2017-08-20T15:39:22.788Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/update_3.2.16 b/src/go/tests/doc/out/update_3.2.16 new file mode 100644 index 00000000..b049846b --- /dev/null +++ b/src/go/tests/doc/out/update_3.2.16 @@ -0,0 +1,50 @@ +{ + "op" : "update", + "ns" : "test.coll", + "query" : { + "a" : { + "$gte" : 2 + } + }, + "updateobj" : { + "$set" : { + "c" : 1 + }, + "$inc" : { + "a" : -10 + } + }, + "keysExamined" : 1, + "docsExamined" : 1, + "nMatched" : 1, + "nModified" : 1, + "keyUpdates" : 1, + "writeConflicts" : 0, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(1), + "w" : NumberLong(1) + } + }, + "Database" : { + "acquireCount" : { + "w" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "w" : NumberLong(1) + } + } + }, + "millis" : 0, + "execStats" : { + + }, + "ts" : ISODate("2017-08-20T15:39:32.737Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/update_3.4.7 b/src/go/tests/doc/out/update_3.4.7 new file mode 100644 index 00000000..c5fe1c47 --- /dev/null +++ b/src/go/tests/doc/out/update_3.4.7 @@ -0,0 +1,118 @@ +{ + "op" : "update", + "ns" : "test.coll", + "query" : { + "a" : { + "$gte" : 2 + } + }, + "updateobj" : { + "$set" : { + "c" : 1 + }, + "$inc" : { + "a" : -10 + } + }, + "keysExamined" : 1, + "docsExamined" : 1, + "nMatched" : 1, + "nModified" : 1, + "keysInserted" : 1, + "keysDeleted" : 1, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(1), + "w" : NumberLong(1) + } + }, + "Database" : { + "acquireCount" : { + "w" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "w" : NumberLong(1) + } + } + }, + "millis" : 0, + "planSummary" : "IXSCAN { a: 1 }", + "execStats" : { + "stage" : "UPDATE", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 2, + "advanced" : 0, + "needTime" : 1, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "nMatched" : 1, + "nWouldModify" : 1, + "nInvalidateSkips" : 0, + "wouldInsert" : false, + "fastmodinsert" : false, + "inputStage" : { + "stage" : "FETCH", + "nReturned" : 1, + "executionTimeMillisEstimate" : 0, + "works" : 1, + "advanced" : 1, + "needTime" : 0, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 0, + "invalidates" : 0, + "docsExamined" : 1, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 1, + "executionTimeMillisEstimate" : 0, + "works" : 1, + "advanced" : 1, + "needTime" : 0, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 0, + "invalidates" : 0, + "keyPattern" : { + "a" : 1 + }, + "indexName" : "a_1", + "isMultiKey" : false, + "multiKeyPaths" : { + "a" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "a" : [ + "[2.0, inf.0]" + ] + }, + "keysExamined" : 1, + "seeks" : 1, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + } + }, + "ts" : ISODate("2017-08-20T15:39:39.434Z"), + "client" : "127.0.0.1", + "appName" : "MongoDB Shell", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/update_3.5.11 b/src/go/tests/doc/out/update_3.5.11 new file mode 100644 index 00000000..2b66b250 --- /dev/null +++ b/src/go/tests/doc/out/update_3.5.11 @@ -0,0 +1,122 @@ +{ + "op" : "update", + "ns" : "test.coll", + "command" : { + "q" : { + "a" : { + "$gte" : 2 + } + }, + "u" : { + "$set" : { + "c" : 1 + }, + "$inc" : { + "a" : -10 + } + }, + "multi" : false, + "upsert" : false + }, + "keysExamined" : 1, + "docsExamined" : 1, + "nMatched" : 1, + "nModified" : 1, + "keysInserted" : 1, + "keysDeleted" : 1, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(1), + "w" : NumberLong(1) + } + }, + "Database" : { + "acquireCount" : { + "w" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "w" : NumberLong(1) + } + } + }, + "millis" : 0, + "planSummary" : "IXSCAN { a: 1 }", + "execStats" : { + "stage" : "UPDATE", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 2, + "advanced" : 0, + "needTime" : 1, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "nMatched" : 1, + "nWouldModify" : 1, + "nInvalidateSkips" : 0, + "wouldInsert" : false, + "fastmodinsert" : false, + "inputStage" : { + "stage" : "FETCH", + "nReturned" : 1, + "executionTimeMillisEstimate" : 0, + "works" : 1, + "advanced" : 1, + "needTime" : 0, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 0, + "invalidates" : 0, + "docsExamined" : 1, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 1, + "executionTimeMillisEstimate" : 0, + "works" : 1, + "advanced" : 1, + "needTime" : 0, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 0, + "invalidates" : 0, + "keyPattern" : { + "a" : 1 + }, + "indexName" : "a_1", + "isMultiKey" : false, + "multiKeyPaths" : { + "a" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "a" : [ + "[2.0, inf.0]" + ] + }, + "keysExamined" : 1, + "seeks" : 1, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + } + }, + "ts" : ISODate("2017-08-20T15:39:49.855Z"), + "client" : "127.0.0.1", + "appName" : "MongoDB Shell", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/run.sh b/src/go/tests/doc/run.sh new file mode 100755 index 00000000..cfa56dcb --- /dev/null +++ b/src/go/tests/doc/run.sh @@ -0,0 +1,24 @@ +#!/bin/sh + +set -e +set -x + +## declare an array of images +declare -a images=( + "mongo:2.6" + "mongo:3.0" + "mongo:3.2" + "mongo:3.4" + "mongo:3.5" +) + +## now loop through the above array of images +for image in "${images[@]}" +do + export MONGO_IMAGE=$image + # clean up old instance if it got left running e.g. after ctrl+c + docker-compose down -v + docker-compose up -d + docker-compose exec mongo sh /script/main.sh + docker-compose down -v +done diff --git a/src/go/tests/doc/script/func/db_version.func b/src/go/tests/doc/script/func/db_version.func new file mode 100644 index 00000000..b79cadd5 --- /dev/null +++ b/src/go/tests/doc/script/func/db_version.func @@ -0,0 +1,5 @@ +#!/bin/sh + +db_version() { + mongo --quiet --eval 'db.version()' +} diff --git a/src/go/tests/doc/script/func/get_single_profile.func b/src/go/tests/doc/script/func/get_single_profile.func new file mode 100644 index 00000000..bb5c8b21 --- /dev/null +++ b/src/go/tests/doc/script/func/get_single_profile.func @@ -0,0 +1,7 @@ +#!/bin/sh + +get_single_profile() { + mongo --quiet <<'EOF' + db.system.profile.find().limit(1).sort( { ts : -1 } ).pretty() +EOF +} diff --git a/src/go/tests/doc/script/func/set_profiling_level.func b/src/go/tests/doc/script/func/set_profiling_level.func new file mode 100644 index 00000000..abf1fe96 --- /dev/null +++ b/src/go/tests/doc/script/func/set_profiling_level.func @@ -0,0 +1,6 @@ +#!/bin/sh + +set_profiling_level() { + mongo --quiet --eval 'db.setProfilingLevel(2)' +} + diff --git a/src/go/tests/doc/script/main.sh b/src/go/tests/doc/script/main.sh new file mode 100755 index 00000000..c33613a7 --- /dev/null +++ b/src/go/tests/doc/script/main.sh @@ -0,0 +1,34 @@ +#!/bin/sh + +set -e +set -x + +DIR=$(dirname "$0") + +# import funcs +for f in $(ls $DIR/func) +do +. "${DIR}/func/${f}" +done + +# wait until mongo is available +until mongo --eval 'db.serverStatus()' > /dev/null +do + sleep 1 +done + +# declare list of profile funcs to run +profiles=$(ls $DIR/profile) + +MONGO_VERSION=$(db_version) +RESULT_DIR=${RESULT_DIR:-/out} + +# turn on profiling +set_profiling_level + +for p in $profiles +do + f="${p%.*}" + cat "${DIR}/profile/${p}" | mongo + get_single_profile > "${RESULT_DIR}/${f}_${MONGO_VERSION}" +done diff --git a/src/go/tests/doc/script/profile/aggregate.js b/src/go/tests/doc/script/profile/aggregate.js new file mode 100644 index 00000000..aa1570be --- /dev/null +++ b/src/go/tests/doc/script/profile/aggregate.js @@ -0,0 +1,9 @@ +var coll = db.coll + +var i; +for (i = 0; i < 10; ++i) { + coll.insert({a: i}); +} +coll.createIndex({a: 1}); + +coll.aggregate([{$match: {a: {$gte: 2}}}]); diff --git a/src/go/tests/doc/script/profile/count.js b/src/go/tests/doc/script/profile/count.js new file mode 100644 index 00000000..2fbf6789 --- /dev/null +++ b/src/go/tests/doc/script/profile/count.js @@ -0,0 +1,7 @@ +var coll = db.coll + +for (i = 0; i < 10; ++i) { + coll.insert({a: i}); +} + +coll.count({}); diff --git a/src/go/tests/doc/script/profile/count_with_query.js b/src/go/tests/doc/script/profile/count_with_query.js new file mode 100644 index 00000000..8d0ecb65 --- /dev/null +++ b/src/go/tests/doc/script/profile/count_with_query.js @@ -0,0 +1,7 @@ +var coll = db.coll + +for (i = 0; i < 10; ++i) { + coll.insert({a: i}); +} + +coll.count({a: {$gt: 5}}); diff --git a/src/go/tests/doc/script/profile/delete.js b/src/go/tests/doc/script/profile/delete.js new file mode 100644 index 00000000..5ab8155f --- /dev/null +++ b/src/go/tests/doc/script/profile/delete.js @@ -0,0 +1,9 @@ +var coll = db.coll + +for (i = 0; i < 10; ++i) { + coll.insert({a: i, b: i}); +} + +coll.createIndex({a: 1}); + +coll.remove({a: {$gte: 2}, b: {$gte: 2}}, {justOne: true}) diff --git a/src/go/tests/doc/script/profile/distinct.js b/src/go/tests/doc/script/profile/distinct.js new file mode 100644 index 00000000..14ab2299 --- /dev/null +++ b/src/go/tests/doc/script/profile/distinct.js @@ -0,0 +1,9 @@ +var coll = db.coll + +var i; +for (i = 0; i < 10; ++i) { + coll.insert({a: i % 5, b: i}); +} +coll.createIndex({b: 1}); + +coll.distinct("a", {b: {$gte: 5}}); diff --git a/src/go/tests/doc/script/profile/find.js b/src/go/tests/doc/script/profile/find.js new file mode 100644 index 00000000..36f05836 --- /dev/null +++ b/src/go/tests/doc/script/profile/find.js @@ -0,0 +1,4 @@ +var coll = db.coll + +coll.createIndex({a: 1}) +coll.find({a: 1}) diff --git a/src/go/tests/doc/script/profile/find_andrii.js b/src/go/tests/doc/script/profile/find_andrii.js new file mode 100644 index 00000000..f97f1ad0 --- /dev/null +++ b/src/go/tests/doc/script/profile/find_andrii.js @@ -0,0 +1,20 @@ +db.coll.find({ + $and: [ + { + k: { $gt: 1 } + }, + { + k: { $lt: 2 } + }, + { + $or: [ + { + c: { $in: [/^0/, /^2/, /^4/, /^6/] } + }, + { + pad: { $in: [/9$/, /7$/, /5$/, /3$/] } + }, + ] + } + ] +}).sort({ k: -1 }).limit(100); diff --git a/src/go/tests/doc/script/profile/find_empty.js b/src/go/tests/doc/script/profile/find_empty.js new file mode 100644 index 00000000..049122cc --- /dev/null +++ b/src/go/tests/doc/script/profile/find_empty.js @@ -0,0 +1,3 @@ +var coll = db.coll + +coll.find() diff --git a/src/go/tests/doc/script/profile/findandmodify.js b/src/go/tests/doc/script/profile/findandmodify.js new file mode 100644 index 00000000..7b8f8086 --- /dev/null +++ b/src/go/tests/doc/script/profile/findandmodify.js @@ -0,0 +1,12 @@ +var coll = db.coll +coll.drop(); + +for (var i = 0; i < 3; i++) { + coll.insert({_id: i, a: i, b: i}); +} +coll.createIndex({b: 1}); + +coll.findAndModify({ + query: {a: 2}, + update: {$inc: {"b": 1}} +}); diff --git a/src/go/tests/doc/script/profile/geonear.js b/src/go/tests/doc/script/profile/geonear.js new file mode 100644 index 00000000..714a2438 --- /dev/null +++ b/src/go/tests/doc/script/profile/geonear.js @@ -0,0 +1,15 @@ +var coll = db.coll +coll.drop(); + +var i; +for (i = 0; i < 10; ++i) { + coll.insert({a: i, loc: {type: "Point", coordinates: [i, i]}}); +} +coll.createIndex({loc: "2dsphere"}); + +db.runCommand({ + geoNear: "coll", + near: {type: "Point", coordinates: [1, 1]}, + spherical: true +}); + diff --git a/src/go/tests/doc/script/profile/group.js b/src/go/tests/doc/script/profile/group.js new file mode 100644 index 00000000..a15d8426 --- /dev/null +++ b/src/go/tests/doc/script/profile/group.js @@ -0,0 +1,15 @@ +var coll = db.coll +coll.drop(); + +var i; +for (i = 0; i < 10; ++i) { + coll.insert({a: i, b: i % 5}); +} +coll.createIndex({b: -1}); + +coll.group({ + key: {a: 1, b: 1}, + cond: {b: 3}, + reduce: function() {}, + initial: {} +}); diff --git a/src/go/tests/doc/script/profile/insert.js b/src/go/tests/doc/script/profile/insert.js new file mode 100644 index 00000000..5293c99f --- /dev/null +++ b/src/go/tests/doc/script/profile/insert.js @@ -0,0 +1,4 @@ +var coll = db.coll + +var doc = {_id: 1}; +var result = coll.insert(doc); diff --git a/src/go/tests/doc/script/profile/mapreduce.js b/src/go/tests/doc/script/profile/mapreduce.js new file mode 100644 index 00000000..80ebd00a --- /dev/null +++ b/src/go/tests/doc/script/profile/mapreduce.js @@ -0,0 +1,20 @@ +var coll = db.coll +coll.drop(); + +var mapFunction = function() { + emit(this.a, this.b); +}; + +var reduceFunction = function(a, b) { + return Array.sum(b); +}; + +coll.drop(); +for (var i = 0; i < 3; i++) { + coll.insert({a: i, b: i}); +} +coll.createIndex({a: 1}); + +coll.mapReduce(mapFunction, + reduceFunction, + {query: {a: {$gte: 0}}, out: {inline: 1}}); diff --git a/src/go/tests/doc/script/profile/update.js b/src/go/tests/doc/script/profile/update.js new file mode 100644 index 00000000..13e04a53 --- /dev/null +++ b/src/go/tests/doc/script/profile/update.js @@ -0,0 +1,9 @@ +var coll = db.coll + +var i; +for (i = 0; i < 10; ++i) { + coll.insert({a: i}); +} +coll.createIndex({a: 1}); + +coll.update({a: {$gte: 2}}, {$set: {c: 1}, $inc: {a: -10}}); diff --git a/src/go/tests/fingerprinter_doc.json b/src/go/tests/fingerprinter_doc.json new file mode 100644 index 00000000..139c6ed7 --- /dev/null +++ b/src/go/tests/fingerprinter_doc.json @@ -0,0 +1,172 @@ +{ + "op": "query", + "ns": "sbtest.sbtest3", + "query": { + "find": "sbtest3", + "filter": { + "$and": [ + { + "k": { + "$gt": -433.7692307692308 + } + }, + { + "k": { + "$lt": 174159.27130926086 + } + }, + { + "$or": [ + { + "c": { + "$in": [ + 0, + 2, + 4, + 6 + ] + } + }, + { + "pad": { + "$in": [ + 9, + 7, + 5, + 3 + ] + } + } + ] + } + ] + }, + "limit": 100, + "singleBatch": false, + "sort": { + "k": -1 + } + }, + "keysExamined": 0, + "docsExamined": 9919, + "hasSortStage": true, + "cursorExhausted": true, + "keyUpdates": 0, + "writeConflicts": 0, + "numYield": 78, + "locks": { + "Global": { + "acquireCount": { + "r": NumberLong(158) + } + }, + "Database": { + "acquireCount": { + "r": NumberLong(79) + } + }, + "Collection": { + "acquireCount": { + "r": NumberLong(79) + } + } + }, + "nreturned": 100, + "responseLength": 22195, + "protocol": "op_command", + "millis": 26, + "execStats": { + "stage": "SORT", + "nReturned": 100, + "executionTimeMillisEstimate": 30, + "works": 10023, + "advanced": 100, + "needTime": 9922, + "needYield": 0, + "saveState": 78, + "restoreState": 78, + "isEOF": 1, + "invalidates": 0, + "sortPattern": { + "k": -1 + }, + "memUsage": 22500, + "memLimit": 33554432, + "limitAmount": 100, + "inputStage": { + "stage": "SORT_KEY_GENERATOR", + "nReturned": 0, + "executionTimeMillisEstimate": 30, + "works": 9922, + "advanced": 0, + "needTime": 9789, + "needYield": 0, + "saveState": 78, + "restoreState": 78, + "isEOF": 1, + "invalidates": 0, + "inputStage": { + "stage": "COLLSCAN", + "filter": { + "$and": [ + { + "$or": [ + { + "c": { + "$in": [ + 0, + 2, + 4, + 6 + ] + } + }, + { + "pad": { + "$in": [ + 9, + 7, + 5, + 3 + ] + } + } + ] + }, + { + "k": { + "$lt": 174159.27130926086 + } + }, + { + "k": { + "$gt": -433.7692307692308 + } + } + ] + }, + "nReturned": 132, + "executionTimeMillisEstimate": 30, + "works": 9921, + "advanced": 132, + "needTime": 9788, + "needYield": 0, + "saveState": 78, + "restoreState": 78, + "isEOF": 1, + "invalidates": 0, + "direction": "forward", + "docsExamined": 9919 + } + } + }, + "ts": ISODate("2017-04-27T16:40:01.029Z"), + "client": "127.0.0.1", + "allUsers": [ + { + "user": "admin", + "db": "admin" + } + ], + "user": "admin@admin" +} \ No newline at end of file diff --git a/src/go/tests/profiler_docs_stats.json b/src/go/tests/profiler_docs_stats.json index 9abff90c..62335a9f 100644 --- a/src/go/tests/profiler_docs_stats.json +++ b/src/go/tests/profiler_docs_stats.json @@ -150,13 +150,13 @@ "Op": "query", "Protocol": "op_command", "Query": { + "find": "col1", "filter": { "s2": { "$gte": "41991", "$lt": "33754" } }, - "find": "col1", "shardVersion": [ 0, "000000000000000000000000" @@ -237,13 +237,13 @@ "Op": "query", "Protocol": "op_command", "Query": { + "find": "col1", "filter": { "user_id": { "$gte": 3384024924, "$lt": 195092007 } }, - "find": "col1", "projection": { "$sortKey": { "$meta": "sortKey" diff --git a/src/go/tests/profiler_docs_stats.want.json b/src/go/tests/profiler_docs_stats.want.json index fc203be0..1aea268b 100644 --- a/src/go/tests/profiler_docs_stats.want.json +++ b/src/go/tests/profiler_docs_stats.want.json @@ -1,10 +1,10 @@ [ { - "ID": "c6466139b21c392acd0699e863b50d81", + "ID": "16196765fb4c14edb91efdbe4f5c5973", "Namespace": "samples.col1", "Operation": "query", - "Query": "{\"find\":\"col1\",\"shardVersion\":[0,\"000000000000000000000000\"]}", - "Fingerprint": "find", + "Query": "\"\"", + "Fingerprint": "FIND col1 find", "FirstSeen": "2017-04-10T13:16:23.29-03:00", "LastSeen": "2017-04-10T13:16:23.29-03:00", "Count": 1, @@ -53,11 +53,11 @@ } }, { - "ID": "84e09ef6a3dc35f472df05fa98eee7d3", + "ID": "4e4774ad26f934a193757002a991ebb8", "Namespace": "samples.col1", "Operation": "query", - "Query": "{\"s2\":{\"$gte\":\"41991\",\"$lt\":\"33754\"}}", - "Fingerprint": "s2", + "Query": "\"\"", + "Fingerprint": "FIND col1 s2", "FirstSeen": "2017-04-10T13:15:53.532-03:00", "LastSeen": "2017-04-10T13:15:53.532-03:00", "Count": 1, @@ -106,11 +106,11 @@ } }, { - "ID": "69e3b2f5f0aefcec868c0fa5ec8cebe5", + "ID": "8cb8666ace7e54767b4d3c4f61860cf9", "Namespace": "samples.col1", "Operation": "query", - "Query": "{\"user_id\":{\"$gte\":3384024924,\"$lt\":195092007}}", - "Fingerprint": "user_id", + "Query": "\"\"", + "Fingerprint": "FIND col1 user_id", "FirstSeen": "2017-04-10T13:15:53.524-03:00", "LastSeen": "2017-04-10T13:15:53.524-03:00", "Count": 1, diff --git a/src/go/tests/profiler_docs_total_stats.want.json b/src/go/tests/profiler_docs_total_stats.want.json index 39bc4c5c..6ca1a6ae 100755 --- a/src/go/tests/profiler_docs_total_stats.want.json +++ b/src/go/tests/profiler_docs_total_stats.want.json @@ -2,7 +2,7 @@ "ID": "", "Namespace": "", "Operation": "", - "Query": "null", + "Query": "\"\"", "Fingerprint": "", "FirstSeen": "0001-01-01T00:00:00Z", "LastSeen": "0001-01-01T00:00:00Z", From 6a65d5b7a0e80b38cace8242a3f856e1775a8441 Mon Sep 17 00:00:00 2001 From: Kamil Dziedzic Date: Mon, 21 Aug 2017 18:08:52 +0200 Subject: [PATCH 024/104] timeout tests after 1m --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index be5d3945..57ea40d1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,7 +19,7 @@ before_script: - git diff --exit-code script: - - go test $(glide nv) + - go test -timeout 1m $(glide nv) notifications: slack: From c503ffa871555b5cf37abdf00723cb7e35209fdf Mon Sep 17 00:00:00 2001 From: Kamil Dziedzic Date: Mon, 21 Aug 2017 18:21:50 +0200 Subject: [PATCH 025/104] sanity check --- src/go/mongolib/fingerprinter/fingerprinter.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/go/mongolib/fingerprinter/fingerprinter.go b/src/go/mongolib/fingerprinter/fingerprinter.go index e434d4f0..47314f48 100644 --- a/src/go/mongolib/fingerprinter/fingerprinter.go +++ b/src/go/mongolib/fingerprinter/fingerprinter.go @@ -98,6 +98,9 @@ func (f *Fingerprint) Fingerprint(doc proto.SystemProfile) (string, error) { collection = ns[1] } default: + if query.Len() == 0 { + break + } // first key is operation type op = query.D[0].Name collection, _ = query.D[0].Value.(string) From 0ea1cda59c281ecb600bb0416fa4ff425c0833ae Mon Sep 17 00:00:00 2001 From: Kamil Dziedzic Date: Mon, 21 Aug 2017 18:48:30 +0200 Subject: [PATCH 026/104] drop trash --- .../fingerprinter/fingerprinter_test.go | 75 ------------------- 1 file changed, 75 deletions(-) diff --git a/src/go/mongolib/fingerprinter/fingerprinter_test.go b/src/go/mongolib/fingerprinter/fingerprinter_test.go index 172bd7dd..f5fd499b 100644 --- a/src/go/mongolib/fingerprinter/fingerprinter_test.go +++ b/src/go/mongolib/fingerprinter/fingerprinter_test.go @@ -10,8 +10,6 @@ import ( "github.com/percona/percona-toolkit/src/go/lib/tutil" "github.com/percona/percona-toolkit/src/go/mongolib/proto" - "github.com/percona/pmgo" - "gopkg.in/mgo.v2" "gopkg.in/mgo.v2/bson" ) @@ -75,82 +73,9 @@ func TestFingerprint(t *testing.T) { } } -//func TestFingerprints(t *testing.T) { -// //t.Parallel() -// -// dialer := pmgo.NewDialer() -// dialInfo, _ := pmgo.ParseURL("127.0.0.1:27017") -// -// session, err := dialer.DialWithInfo(dialInfo) -// if err != nil { -// t.Fatalf("cannot dial: %s", err) -// } -// defer session.Close() -// session.SetMode(mgo.Eventual, true) -// -// dir := vars.RootPath+samples+"/profile/" -// files, err := ioutil.ReadDir(dir) -// if err != nil { -// t.Fatalf("cannot load samples: %s", err) -// } -// -// for _, file := range files { -// f, err := os.Open(dir+file.Name()) -// if err != nil { -// t.Fatalf("cannot open file: %s", err) -// } -// -// buf, err := ioutil.ReadAll(f) -// if err != nil { -// t.Fatalf("cannot read file: %s", err) -// } -// -// t.Run(file.Name(), func(t *testing.T) { -// var err error -// result := bson.Raw{} -// err = session.DB("").Run(bson.M{"eval": string(buf)}, &result) -// if err != nil { -// t.Fatalf("cannot execute query: %s", err) -// } -// doc := proto.SystemProfile{} -// query := bson.M{"op": bson.M{"$nin": []string{"getmore"}}, "ns": bson.M{"$nin": []string{"test.system.profile"}}} -// err = session.DB("").C("system.profile").Find(query).Sort("-ts").Limit(1).One(&doc) -// if err != nil { -// t.Fatalf("cannot get system.profile query: %s", err) -// } -// fmt.Println(doc) -// -// //err = tutil.LoadBson(dir+file.Name(), &doc) -// //if err != nil { -// // t.Fatalf("cannot load sample: %s", err) -// //} -// fp := NewFingerprinter(DEFAULT_KEY_FILTERS) -// got, err := fp.Fingerprint(doc) -// if err != nil { -// panic(err) -// } -// if !reflect.DeepEqual(got, "") { -// t.Errorf("fp.Fingerprint(doc) = %s, want %s", got, "") -// } -// }) -// } -// -// -//} - func TestFingerprints(t *testing.T) { t.Parallel() - dialer := pmgo.NewDialer() - dialInfo, _ := pmgo.ParseURL("") - - session, err := dialer.DialWithInfo(dialInfo) - if err != nil { - t.Fatalf("cannot dial: %s", err) - } - defer session.Close() - session.SetMode(mgo.Eventual, true) - dir := vars.RootPath + samples + "/doc/out/" files, err := ioutil.ReadDir(dir) if err != nil { From 6d571cd708d09591f17428d0c137357a647a717f Mon Sep 17 00:00:00 2001 From: Kamil Dziedzic Date: Mon, 21 Aug 2017 18:55:05 +0200 Subject: [PATCH 027/104] fix queries --- src/go/mongolib/profiler/profiler_test.go | 8 ++++---- src/go/mongolib/stats/stats.go | 4 +--- src/go/mongolib/stats/stats_test.go | 2 +- src/go/tests/profiler_docs_stats.want.json | 6 +++--- src/go/tests/profiler_docs_total_stats.want.json | 2 +- 5 files changed, 10 insertions(+), 12 deletions(-) diff --git a/src/go/mongolib/profiler/profiler_test.go b/src/go/mongolib/profiler/profiler_test.go index fd42ba7c..4dc37c75 100644 --- a/src/go/mongolib/profiler/profiler_test.go +++ b/src/go/mongolib/profiler/profiler_test.go @@ -73,7 +73,7 @@ func TestRegularIterator(t *testing.T) { ID: "16196765fb4c14edb91efdbe4f5c5973", Namespace: "samples.col1", Operation: "query", - Query: "", + Query: "{\"find\":\"col1\",\"shardVersion\":[0,\"000000000000000000000000\"]}\n", Fingerprint: "FIND col1 find", FirstSeen: firstSeen, LastSeen: lastSeen, @@ -130,7 +130,7 @@ func TestIteratorTimeout(t *testing.T) { ID: "16196765fb4c14edb91efdbe4f5c5973", Namespace: "samples.col1", Operation: "query", - Query: "", + Query: "{\"find\":\"col1\",\"shardVersion\":[0,\"000000000000000000000000\"]}\n", Fingerprint: "FIND col1 find", FirstSeen: firstSeen, LastSeen: lastSeen, @@ -211,7 +211,7 @@ func TestTailIterator(t *testing.T) { ID: "16196765fb4c14edb91efdbe4f5c5973", Namespace: "samples.col1", Operation: "query", - Query: "", + Query: "{\"find\":\"col1\",\"shardVersion\":[0,\"000000000000000000000000\"]}\n", Fingerprint: "FIND col1 find", FirstSeen: parseDate("2017-04-01T23:01:20.214+00:00"), LastSeen: parseDate("2017-04-01T23:01:20.214+00:00"), @@ -226,7 +226,7 @@ func TestTailIterator(t *testing.T) { ID: "16196765fb4c14edb91efdbe4f5c5973", Namespace: "samples.col1", Operation: "query", - Query: "", + Query: "{\"find\":\"col1\",\"shardVersion\":[0,\"000000000000000000000000\"]}\n", Fingerprint: "FIND col1 find", FirstSeen: parseDate("2017-04-01T23:01:19.914+00:00"), LastSeen: parseDate("2017-04-01T23:01:19.914+00:00"), diff --git a/src/go/mongolib/stats/stats.go b/src/go/mongolib/stats/stats.go index 1752140a..31af1e99 100644 --- a/src/go/mongolib/stats/stats.go +++ b/src/go/mongolib/stats/stats.go @@ -2,7 +2,6 @@ package stats import ( "crypto/md5" - "encoding/json" "fmt" "sort" "sync" @@ -252,12 +251,11 @@ type Statistics struct { } func countersToStats(query QueryInfoAndCounters, uptime int64, tc totalCounters) QueryStats { - buf, _ := json.Marshal(query.Query) queryStats := QueryStats{ Count: query.Count, ID: query.ID, Operation: query.Operation, - Query: string(buf), + Query: query.Query, Fingerprint: query.Fingerprint, Scanned: calcStats(query.NScanned), Returned: calcStats(query.NReturned), diff --git a/src/go/mongolib/stats/stats_test.go b/src/go/mongolib/stats/stats_test.go index 56c492f3..df3fb5eb 100644 --- a/src/go/mongolib/stats/stats_test.go +++ b/src/go/mongolib/stats/stats_test.go @@ -142,7 +142,7 @@ func TestStats(t *testing.T) { ID: "4e4774ad26f934a193757002a991ebb8", Namespace: "samples.col1", Operation: "query", - Query: "", + Query: "{\"find\":\"col1\",\"filter\":{\"s2\":{\"$gte\":\"41991\",\"$lt\":\"33754\"}},\"shardVersion\":[0,\"000000000000000000000000\"]}\n", Fingerprint: "FIND col1 s2", FirstSeen: parseDate("2017-04-10T13:15:53.532-03:00"), LastSeen: parseDate("2017-04-10T13:15:53.532-03:00"), diff --git a/src/go/tests/profiler_docs_stats.want.json b/src/go/tests/profiler_docs_stats.want.json index 1aea268b..f7f4849c 100644 --- a/src/go/tests/profiler_docs_stats.want.json +++ b/src/go/tests/profiler_docs_stats.want.json @@ -3,7 +3,7 @@ "ID": "16196765fb4c14edb91efdbe4f5c5973", "Namespace": "samples.col1", "Operation": "query", - "Query": "\"\"", + "Query": "{\"find\":\"col1\",\"shardVersion\":[0,\"000000000000000000000000\"]}\n", "Fingerprint": "FIND col1 find", "FirstSeen": "2017-04-10T13:16:23.29-03:00", "LastSeen": "2017-04-10T13:16:23.29-03:00", @@ -56,7 +56,7 @@ "ID": "4e4774ad26f934a193757002a991ebb8", "Namespace": "samples.col1", "Operation": "query", - "Query": "\"\"", + "Query": "{\"find\":\"col1\",\"filter\":{\"s2\":{\"$gte\":\"41991\",\"$lt\":\"33754\"}},\"shardVersion\":[0,\"000000000000000000000000\"]}\n", "Fingerprint": "FIND col1 s2", "FirstSeen": "2017-04-10T13:15:53.532-03:00", "LastSeen": "2017-04-10T13:15:53.532-03:00", @@ -109,7 +109,7 @@ "ID": "8cb8666ace7e54767b4d3c4f61860cf9", "Namespace": "samples.col1", "Operation": "query", - "Query": "\"\"", + "Query": "{\"find\":\"col1\",\"filter\":{\"user_id\":{\"$gte\":3384024924,\"$lt\":195092007}},\"projection\":{\"$sortKey\":{\"$meta\":\"sortKey\"}},\"shardVersion\":[0,\"000000000000000000000000\"],\"sort\":{\"user_id\":1}}\n", "Fingerprint": "FIND col1 user_id", "FirstSeen": "2017-04-10T13:15:53.524-03:00", "LastSeen": "2017-04-10T13:15:53.524-03:00", diff --git a/src/go/tests/profiler_docs_total_stats.want.json b/src/go/tests/profiler_docs_total_stats.want.json index 6ca1a6ae..954845b7 100755 --- a/src/go/tests/profiler_docs_total_stats.want.json +++ b/src/go/tests/profiler_docs_total_stats.want.json @@ -2,7 +2,7 @@ "ID": "", "Namespace": "", "Operation": "", - "Query": "\"\"", + "Query": "", "Fingerprint": "", "FirstSeen": "0001-01-01T00:00:00Z", "LastSeen": "0001-01-01T00:00:00Z", From 96691df8dd71497c00bc1b81136fff57c1b4373c Mon Sep 17 00:00:00 2001 From: Kamil Dziedzic Date: Mon, 21 Aug 2017 19:10:59 +0200 Subject: [PATCH 028/104] fix marshaling json --- src/go/mongolib/proto/bson.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/go/mongolib/proto/bson.go b/src/go/mongolib/proto/bson.go index f4f890e7..9b2acdca 100644 --- a/src/go/mongolib/proto/bson.go +++ b/src/go/mongolib/proto/bson.go @@ -76,10 +76,6 @@ func (d *BsonD) UnmarshalJSON(data []byte) error { func (d *BsonD) MarshalJSON() ([]byte, error) { var b bytes.Buffer - if d.D == nil { - b.WriteString("null") - return nil, nil - } b.WriteByte('{') From de1f123b2c87ae9a202c2cf4cb674a762cf81674 Mon Sep 17 00:00:00 2001 From: Kamil Dziedzic Date: Mon, 21 Aug 2017 19:18:49 +0200 Subject: [PATCH 029/104] disable mail notifications --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index 57ea40d1..4457b547 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,6 +22,9 @@ script: - go test -timeout 1m $(glide nv) notifications: + email: + on_success: never + on_failure: never slack: on_success: change on_failure: change From 3f06ea8fdfec4e64b80101b50600330a75ebd722 Mon Sep 17 00:00:00 2001 From: Kamil Dziedzic Date: Mon, 21 Aug 2017 20:10:45 +0200 Subject: [PATCH 030/104] Compare times in the same timezone --- src/go/mongolib/profiler/profiler_test.go | 4 ++++ src/go/mongolib/stats/stats.go | 5 ++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/go/mongolib/profiler/profiler_test.go b/src/go/mongolib/profiler/profiler_test.go index 4dc37c75..21e4ebba 100644 --- a/src/go/mongolib/profiler/profiler_test.go +++ b/src/go/mongolib/profiler/profiler_test.go @@ -317,6 +317,8 @@ func TestCalcTotalStats(t *testing.T) { if err != nil && !tutil.ShouldUpdateSamples() { t.Fatalf("cannot load expected results: %s", err.Error()) } + want.FirstSeen = want.FirstSeen.UTC() + want.LastSeen = want.LastSeen.UTC() iter := pmgomock.NewMockIterManager(ctrl) gomock.InOrder( @@ -347,6 +349,8 @@ func TestCalcTotalStats(t *testing.T) { fmt.Printf("cannot update samples: %s", err.Error()) } } + s.FirstSeen = s.FirstSeen.UTC() + s.LastSeen = s.LastSeen.UTC() if !reflect.DeepEqual(s, want) { t.Errorf("Invalid stats.\nGot:%#v\nWant: %#v\n", s, want) } diff --git a/src/go/mongolib/stats/stats.go b/src/go/mongolib/stats/stats.go index 31af1e99..75e4bb36 100644 --- a/src/go/mongolib/stats/stats.go +++ b/src/go/mongolib/stats/stats.go @@ -101,11 +101,10 @@ func (s *Stats) Add(doc proto.SystemProfile) error { qiac.NReturned = append(qiac.NReturned, float64(doc.Nreturned)) qiac.QueryTime = append(qiac.QueryTime, float64(doc.Millis)) qiac.ResponseLength = append(qiac.ResponseLength, float64(doc.ResponseLength)) - var zeroTime time.Time - if qiac.FirstSeen == zeroTime || qiac.FirstSeen.After(doc.Ts) { + if qiac.FirstSeen.IsZero() || qiac.FirstSeen.After(doc.Ts) { qiac.FirstSeen = doc.Ts } - if qiac.LastSeen == zeroTime || qiac.LastSeen.Before(doc.Ts) { + if qiac.LastSeen.IsZero() || qiac.LastSeen.Before(doc.Ts) { qiac.LastSeen = doc.Ts } From 45f5629260a7f2b5125e3979ea3dcbe3fe166e94 Mon Sep 17 00:00:00 2001 From: Kamil Dziedzic Date: Mon, 21 Aug 2017 20:23:37 +0200 Subject: [PATCH 031/104] Compare times in the same timezone --- src/go/mongolib/profiler/profiler_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/go/mongolib/profiler/profiler_test.go b/src/go/mongolib/profiler/profiler_test.go index 21e4ebba..b3dc383e 100644 --- a/src/go/mongolib/profiler/profiler_test.go +++ b/src/go/mongolib/profiler/profiler_test.go @@ -268,6 +268,8 @@ func TestCalcStats(t *testing.T) { if err != nil { t.Fatalf("cannot load expected results: %s", err.Error()) } + want.FirstSeen = want.FirstSeen.UTC() + want.LastSeen = want.LastSeen.UTC() iter := pmgomock.NewMockIterManager(ctrl) gomock.InOrder( @@ -294,6 +296,8 @@ func TestCalcStats(t *testing.T) { if os.Getenv("UPDATE_SAMPLES") != "" { tutil.WriteJson(vars.RootPath+samples+"profiler_docs_stats.want.json", s) } + s.FirstSeen = s.FirstSeen.UTC() + s.LastSeen = s.LastSeen.UTC() if !reflect.DeepEqual(s, want) { t.Errorf("Invalid stats.\nGot:%#v\nWant: %#v\n", s, want) } From a25d6218f417ca81a5c8c9d8f077574d307d73c7 Mon Sep 17 00:00:00 2001 From: Kamil Dziedzic Date: Mon, 21 Aug 2017 20:26:50 +0200 Subject: [PATCH 032/104] just drop old go version --- .travis.yml | 1 - src/go/mongolib/profiler/profiler_test.go | 8 -------- 2 files changed, 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4457b547..237c62d2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,6 @@ sudo: required language: go go: - - 1.7.x - 1.8.x - tip diff --git a/src/go/mongolib/profiler/profiler_test.go b/src/go/mongolib/profiler/profiler_test.go index b3dc383e..4dc37c75 100644 --- a/src/go/mongolib/profiler/profiler_test.go +++ b/src/go/mongolib/profiler/profiler_test.go @@ -268,8 +268,6 @@ func TestCalcStats(t *testing.T) { if err != nil { t.Fatalf("cannot load expected results: %s", err.Error()) } - want.FirstSeen = want.FirstSeen.UTC() - want.LastSeen = want.LastSeen.UTC() iter := pmgomock.NewMockIterManager(ctrl) gomock.InOrder( @@ -296,8 +294,6 @@ func TestCalcStats(t *testing.T) { if os.Getenv("UPDATE_SAMPLES") != "" { tutil.WriteJson(vars.RootPath+samples+"profiler_docs_stats.want.json", s) } - s.FirstSeen = s.FirstSeen.UTC() - s.LastSeen = s.LastSeen.UTC() if !reflect.DeepEqual(s, want) { t.Errorf("Invalid stats.\nGot:%#v\nWant: %#v\n", s, want) } @@ -321,8 +317,6 @@ func TestCalcTotalStats(t *testing.T) { if err != nil && !tutil.ShouldUpdateSamples() { t.Fatalf("cannot load expected results: %s", err.Error()) } - want.FirstSeen = want.FirstSeen.UTC() - want.LastSeen = want.LastSeen.UTC() iter := pmgomock.NewMockIterManager(ctrl) gomock.InOrder( @@ -353,8 +347,6 @@ func TestCalcTotalStats(t *testing.T) { fmt.Printf("cannot update samples: %s", err.Error()) } } - s.FirstSeen = s.FirstSeen.UTC() - s.LastSeen = s.LastSeen.UTC() if !reflect.DeepEqual(s, want) { t.Errorf("Invalid stats.\nGot:%#v\nWant: %#v\n", s, want) } From 92ce29acfa7549a8d6f22bd866134065d387ff34 Mon Sep 17 00:00:00 2001 From: Kamil Dziedzic Date: Mon, 21 Aug 2017 20:51:01 +0200 Subject: [PATCH 033/104] proper secret --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 237c62d2..68c7d62f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -28,4 +28,4 @@ notifications: on_success: change on_failure: change rooms: - secure: A/jke9SzibxoGc0H86z5fnGKoLr6xTPBNUcjLMVJ2xzqp8HX90gOdWKenooCu6tyJ0gXX8nUgIOQWsupICy2P2HPGXXKonY4Lq1qRPbxXnlqweaoTf2IZ8SmQeyP6TvNZF9978YRLqRBmJXzq7dcZCF2Gr/1XLPDCNIVJcKgG+heVUubt6q8EnIzB4OYKwUJwZ2ORzleLwqzs8ViB5ffmOXmAVd80rUTcCOailKE4+ML+CQO1MLbGxbdVjacivjM0cvXoibRZF5bhUsg7qoszaWJidJjX9UtW9rRKyPuh1vh1HFgayxmWNeiqe7yyIwGZU37Gnten+4XsVpKYxSOfRWz8TNu01jdDs7e8RgJ29OCwVG88y/yxrBtDlhjsKvy7owV1eAH63YVUJzgoVQZKUt04LAKTMxjEZKBb7o7+GdmSHQWPj8NNmcPEWBwSg99yU3xTQXefgLjqiCQTTNaiNEa1JgPNroKXzAcjJ12qpY5F5MWPFZ2ndTOL2kVEn4iqV7t6bresISXAZKJn+IrjUdZ+ZBr48zcnO7rgWGvszScDWt3oqjRlCbwxXWTL8VoDouylGVAJTUHxo07Bs307cwYiLsUp/2hPvcY2ELXrQXTqk3ZHJkMHa4U+nNvXY9RYNNqFmvAnUCHG6JfBda4b0SCjbCINjQVMCsF5DSXua8= + secure: E5ZRDFtbVmQCo2SLCdvecpaRIZPC35+0srkyA9jVq0BJpvVY6pm4OQceAugy/g5cd6c2reTN9oNSjNF62BKpoJxPuIuu8/JdlvUMMxgxnGkCC1R6hAddbapvIe4EXlybLPGy8kAG7OkYVpGHtWwN3U5MfF7/tGeqL2y8C3fCDZA= From 04f95917ae2c727dbda27e35f915815ce92e82ee Mon Sep 17 00:00:00 2001 From: Kamil Dziedzic Date: Thu, 24 Aug 2017 10:29:54 +0200 Subject: [PATCH 034/104] PMM-1057: let's try to bypass limitations of go/bson --- .../mongolib/fingerprinter/fingerprinter.go | 41 ++++++----- .../fingerprinter/fingerprinter_test.go | 6 +- src/go/mongolib/profiler/profiler_test.go | 16 ++--- src/go/mongolib/proto/bson.go | 70 +++++++++++++++---- src/go/mongolib/stats/stats.go | 4 +- src/go/mongolib/stats/stats_test.go | 2 +- src/go/mongolib/util/util.go | 8 +-- src/go/tests/doc/script/profile/find.js | 8 ++- src/go/tests/profiler_docs_stats.want.json | 6 +- 9 files changed, 104 insertions(+), 57 deletions(-) diff --git a/src/go/mongolib/fingerprinter/fingerprinter.go b/src/go/mongolib/fingerprinter/fingerprinter.go index 47314f48..621a091b 100644 --- a/src/go/mongolib/fingerprinter/fingerprinter.go +++ b/src/go/mongolib/fingerprinter/fingerprinter.go @@ -9,6 +9,7 @@ import ( "github.com/percona/percona-toolkit/src/go/mongolib/proto" "github.com/percona/percona-toolkit/src/go/mongolib/util" + "gopkg.in/mgo.v2/bson" ) var ( @@ -68,7 +69,7 @@ func (f *Fingerprint) Fingerprint(doc proto.SystemProfile) (string, error) { // if there is a sort clause in the query, we have to add all fields in the sort // fields list that are not in the query keys list (retKeys) if sortKeys, ok := query.Map()["sort"]; ok { - if sortKeysMap, ok := sortKeys.(map[string]interface{}); ok { + if sortKeysMap, ok := sortKeys.(bson.M); ok { sortKeys := keys(sortKeysMap, f.keyFilters) retKeys = append(retKeys, sortKeys...) } @@ -102,20 +103,20 @@ func (f *Fingerprint) Fingerprint(doc proto.SystemProfile) (string, error) { break } // first key is operation type - op = query.D[0].Name - collection, _ = query.D[0].Value.(string) + op = query[0].Name + collection, _ = query[0].Value.(string) switch op { case "group": retKeys = []string{} if g, ok := query.Map()["group"]; ok { - if m, ok := g.(map[string]interface{}); ok { + if m, ok := g.(bson.M); ok { if f, ok := m["key"]; ok { - if keysMap, ok := f.(map[string]interface{}); ok { + if keysMap, ok := f.(bson.M); ok { retKeys = append(retKeys, keys(keysMap, []string{})...) } } if f, ok := m["cond"]; ok { - if keysMap, ok := f.(map[string]interface{}); ok { + if keysMap, ok := f.(bson.M); ok { retKeys = append(retKeys, keys(keysMap, []string{})...) } } @@ -167,29 +168,27 @@ func keys(query interface{}, keyFilters []string) []string { func getKeys(query interface{}, keyFilters []string, level int) []string { ks := []string{} - var q []interface{} + var q []bson.M switch v := query.(type) { - case map[string]interface{}: + case bson.M: q = append(q, v) - case []interface{}: + case []bson.M: q = v + default: + return ks } if level <= MAX_DEPTH_LEVEL { for i := range q { - if query, ok := q[i].(map[string]interface{}); ok { - for key, value := range query { - if shouldSkipKey(key, keyFilters) { - continue - } - if matched, _ := regexp.MatchString("^\\$", key); !matched { - ks = append(ks, key) - } - - ks = append(ks, getKeys(value, keyFilters, level)...) + for key, value := range q[i] { + if shouldSkipKey(key, keyFilters) { + continue } - } else { - ks = append(ks, getKeys(q[i], keyFilters, level)...) + if matched, _ := regexp.MatchString("^\\$", key); !matched { + ks = append(ks, key) + } + + ks = append(ks, getKeys(value, keyFilters, level)...) } } } diff --git a/src/go/mongolib/fingerprinter/fingerprinter_test.go b/src/go/mongolib/fingerprinter/fingerprinter_test.go index f5fd499b..836fc171 100644 --- a/src/go/mongolib/fingerprinter/fingerprinter_test.go +++ b/src/go/mongolib/fingerprinter/fingerprinter_test.go @@ -50,15 +50,15 @@ func ExampleFingerprint() { func TestFingerprint(t *testing.T) { doc := proto.SystemProfile{} - doc.Query = proto.BsonD{bson.D{ + doc.Query = proto.BsonD{ {"find", "feedback"}, - {"filter", map[string]interface{}{ + {"filter", bson.M{ "tool": "Atlas", "potId": "2c9180865ae33e85015af1cc29243dc5", }}, {"limit", 1}, {"singleBatch", true}, - }} + } want := "FIND feedback potId,tool" fp := NewFingerprinter(nil) diff --git a/src/go/mongolib/profiler/profiler_test.go b/src/go/mongolib/profiler/profiler_test.go index 4dc37c75..037f3ec5 100644 --- a/src/go/mongolib/profiler/profiler_test.go +++ b/src/go/mongolib/profiler/profiler_test.go @@ -73,7 +73,7 @@ func TestRegularIterator(t *testing.T) { ID: "16196765fb4c14edb91efdbe4f5c5973", Namespace: "samples.col1", Operation: "query", - Query: "{\"find\":\"col1\",\"shardVersion\":[0,\"000000000000000000000000\"]}\n", + Query: "{\n \"find\": \"col1\",\n \"shardVersion\": [\n 0,\n \"000000000000000000000000\"\n ]\n}", Fingerprint: "FIND col1 find", FirstSeen: firstSeen, LastSeen: lastSeen, @@ -130,7 +130,7 @@ func TestIteratorTimeout(t *testing.T) { ID: "16196765fb4c14edb91efdbe4f5c5973", Namespace: "samples.col1", Operation: "query", - Query: "{\"find\":\"col1\",\"shardVersion\":[0,\"000000000000000000000000\"]}\n", + Query: "{\n \"find\": \"col1\",\n \"shardVersion\": [\n 0,\n \"000000000000000000000000\"\n ]\n}", Fingerprint: "FIND col1 find", FirstSeen: firstSeen, LastSeen: lastSeen, @@ -211,7 +211,7 @@ func TestTailIterator(t *testing.T) { ID: "16196765fb4c14edb91efdbe4f5c5973", Namespace: "samples.col1", Operation: "query", - Query: "{\"find\":\"col1\",\"shardVersion\":[0,\"000000000000000000000000\"]}\n", + Query: "{\n \"find\": \"col1\",\n \"shardVersion\": [\n 0,\n \"000000000000000000000000\"\n ]\n}", Fingerprint: "FIND col1 find", FirstSeen: parseDate("2017-04-01T23:01:20.214+00:00"), LastSeen: parseDate("2017-04-01T23:01:20.214+00:00"), @@ -226,7 +226,7 @@ func TestTailIterator(t *testing.T) { ID: "16196765fb4c14edb91efdbe4f5c5973", Namespace: "samples.col1", Operation: "query", - Query: "{\"find\":\"col1\",\"shardVersion\":[0,\"000000000000000000000000\"]}\n", + Query: "{\n \"find\": \"col1\",\n \"shardVersion\": [\n 0,\n \"000000000000000000000000\"\n ]\n}", Fingerprint: "FIND col1 find", FirstSeen: parseDate("2017-04-01T23:01:19.914+00:00"), LastSeen: parseDate("2017-04-01T23:01:19.914+00:00"), @@ -258,13 +258,13 @@ func TestCalcStats(t *testing.T) { defer ctrl.Finish() docs := []proto.SystemProfile{} - err := tutil.LoadJson(vars.RootPath+samples+"profiler_docs_stats.json", &docs) + err := tutil.LoadBson(vars.RootPath+samples+"profiler_docs_stats.json", &docs) if err != nil { t.Fatalf("cannot load samples: %s", err.Error()) } want := []stats.QueryStats{} - err = tutil.LoadJson(vars.RootPath+samples+"profiler_docs_stats.want.json", &want) + err = tutil.LoadBson(vars.RootPath+samples+"profiler_docs_stats.want.json", &want) if err != nil { t.Fatalf("cannot load expected results: %s", err.Error()) } @@ -307,13 +307,13 @@ func TestCalcTotalStats(t *testing.T) { defer ctrl.Finish() docs := []proto.SystemProfile{} - err := tutil.LoadJson(vars.RootPath+samples+"profiler_docs_stats.json", &docs) + err := tutil.LoadBson(vars.RootPath+samples+"profiler_docs_stats.json", &docs) if err != nil { t.Fatalf("cannot load samples: %s", err.Error()) } want := stats.QueryStats{} - err = tutil.LoadJson(vars.RootPath+samples+"profiler_docs_total_stats.want.json", &want) + err = tutil.LoadBson(vars.RootPath+samples+"profiler_docs_total_stats.want.json", &want) if err != nil && !tutil.ShouldUpdateSamples() { t.Fatalf("cannot load expected results: %s", err.Error()) } diff --git a/src/go/mongolib/proto/bson.go b/src/go/mongolib/proto/bson.go index 9b2acdca..d6a01bbf 100644 --- a/src/go/mongolib/proto/bson.go +++ b/src/go/mongolib/proto/bson.go @@ -8,9 +8,7 @@ import ( "gopkg.in/mgo.v2/bson" ) -type BsonD struct { - bson.D -} +type BsonD bson.D func (d *BsonD) UnmarshalJSON(data []byte) error { dec := json.NewDecoder(bytes.NewReader(data)) @@ -45,19 +43,33 @@ func (d *BsonD) UnmarshalJSON(data []byte) error { return fmt.Errorf("missing value for key %s", key) } - v := BsonD{} - r := dec.Buffered() - ndec := json.NewDecoder(r) - err = ndec.Decode(&v) + var raw json.RawMessage + err = dec.Decode(&raw) if err != nil { - var v interface{} - dec.Decode(&v) - de.Value = v + return err + } + + var v BsonD + err = bson.UnmarshalJSON(raw, &v) + if err != nil { + var v []BsonD + err = bson.UnmarshalJSON(raw, &v) + if err != nil { + var v interface{} + err = bson.UnmarshalJSON(raw, &v) + if err != nil { + return err + } else { + de.Value = v + } + } else { + de.Value = v + } } else { de.Value = v } - d.D = append(d.D, de) + *d = append(*d, de) if !dec.More() { break } @@ -74,12 +86,12 @@ func (d *BsonD) UnmarshalJSON(data []byte) error { return nil } -func (d *BsonD) MarshalJSON() ([]byte, error) { +func (d BsonD) MarshalJSON() ([]byte, error) { var b bytes.Buffer b.WriteByte('{') - for i, v := range d.D { + for i, v := range d { if i > 0 { b.WriteByte(',') } @@ -106,5 +118,35 @@ func (d *BsonD) MarshalJSON() ([]byte, error) { } func (d BsonD) Len() int { - return len(d.D) + return len(d) +} + +// Map returns a map out of the ordered element name/value pairs in d. +func (d BsonD) Map() (m bson.M) { + m = make(bson.M, len(d)) + for _, item := range d { + switch v := item.Value.(type) { + case BsonD: + m[item.Name] = v.Map() + case []BsonD: + el := []bson.M{} + for i := range v { + el = append(el, v[i].Map()) + } + m[item.Name] = el + case []interface{}: + // mgo/bson doesn't expose UnmarshalBSON interface + // so we can't create custom bson.Unmarshal() + el := []bson.M{} + for i := range v { + if b, ok := v[i].(BsonD); ok { + el = append(el, b.Map()) + } + } + m[item.Name] = el + default: + m[item.Name] = item.Value + } + } + return m } diff --git a/src/go/mongolib/stats/stats.go b/src/go/mongolib/stats/stats.go index 75e4bb36..e8caaca9 100644 --- a/src/go/mongolib/stats/stats.go +++ b/src/go/mongolib/stats/stats.go @@ -6,11 +6,11 @@ import ( "sort" "sync" "time" + "encoding/json" "github.com/montanaflynn/stats" "github.com/percona/percona-toolkit/src/go/mongolib/fingerprinter" "github.com/percona/percona-toolkit/src/go/mongolib/proto" - "gopkg.in/mgo.v2/bson" ) type StatsError struct { @@ -82,7 +82,7 @@ func (s *Stats) Add(doc proto.SystemProfile) error { if err != nil { return &StatsGetQueryFieldError{err} } - queryBson, err := bson.MarshalJSON(&query) + queryBson, err := json.MarshalIndent(query, "", " ") if err != nil { return err } diff --git a/src/go/mongolib/stats/stats_test.go b/src/go/mongolib/stats/stats_test.go index df3fb5eb..47a9b3a9 100644 --- a/src/go/mongolib/stats/stats_test.go +++ b/src/go/mongolib/stats/stats_test.go @@ -142,7 +142,7 @@ func TestStats(t *testing.T) { ID: "4e4774ad26f934a193757002a991ebb8", Namespace: "samples.col1", Operation: "query", - Query: "{\"find\":\"col1\",\"filter\":{\"s2\":{\"$gte\":\"41991\",\"$lt\":\"33754\"}},\"shardVersion\":[0,\"000000000000000000000000\"]}\n", + Query: "{\n \"find\": \"col1\",\n \"filter\": {\n \"s2\": {\n \"$gte\": \"41991\",\n \"$lt\": \"33754\"\n }\n },\n \"shardVersion\": [\n 0,\n \"000000000000000000000000\"\n ]\n}", Fingerprint: "FIND col1 s2", FirstSeen: parseDate("2017-04-10T13:15:53.532-03:00"), LastSeen: parseDate("2017-04-10T13:15:53.532-03:00"), diff --git a/src/go/mongolib/util/util.go b/src/go/mongolib/util/util.go index 0a592c65..313ca47b 100644 --- a/src/go/mongolib/util/util.go +++ b/src/go/mongolib/util/util.go @@ -237,7 +237,7 @@ func GetServerStatus(dialer pmgo.Dialer, di *pmgo.DialInfo, hostname string) (pr return ss, nil } -func GetQueryField(doc proto.SystemProfile) (map[string]interface{}, error) { +func GetQueryField(doc proto.SystemProfile) (bson.M, error) { // Proper way to detect if protocol used is "op_msg" or "op_command" // would be to look at "doc.Protocol" field, // however MongoDB 3.0 doesn't have that field @@ -248,7 +248,7 @@ func GetQueryField(doc proto.SystemProfile) (map[string]interface{}, error) { if doc.Op == "update" || doc.Op == "remove" { if squery, ok := query.Map()["q"]; ok { // just an extra check to ensure this type assertion won't fail - if ssquery, ok := squery.(map[string]interface{}); ok { + if ssquery, ok := squery.(bson.M); ok { return ssquery, nil } return nil, CANNOT_GET_QUERY_ERROR @@ -318,7 +318,7 @@ func GetQueryField(doc proto.SystemProfile) (map[string]interface{}, error) { // if squery, ok := query.Map()["query"]; ok { // just an extra check to ensure this type assertion won't fail - if ssquery, ok := squery.(map[string]interface{}); ok { + if ssquery, ok := squery.(bson.M); ok { return ssquery, nil } return nil, CANNOT_GET_QUERY_ERROR @@ -326,7 +326,7 @@ func GetQueryField(doc proto.SystemProfile) (map[string]interface{}, error) { // "query" in MongoDB 3.2+ is better structured and always has a "filter" subkey: if squery, ok := query.Map()["filter"]; ok { - if ssquery, ok := squery.(map[string]interface{}); ok { + if ssquery, ok := squery.(bson.M); ok { return ssquery, nil } return nil, CANNOT_GET_QUERY_ERROR diff --git a/src/go/tests/doc/script/profile/find.js b/src/go/tests/doc/script/profile/find.js index 36f05836..e13d79f1 100644 --- a/src/go/tests/doc/script/profile/find.js +++ b/src/go/tests/doc/script/profile/find.js @@ -1,4 +1,10 @@ var coll = db.coll coll.createIndex({a: 1}) -coll.find({a: 1}) + +var i; +for (i = 0; i < 10; ++i) { + coll.insert({a: i % 5}); +} + +coll.find({a: 1}).pretty() diff --git a/src/go/tests/profiler_docs_stats.want.json b/src/go/tests/profiler_docs_stats.want.json index f7f4849c..34f8276d 100644 --- a/src/go/tests/profiler_docs_stats.want.json +++ b/src/go/tests/profiler_docs_stats.want.json @@ -3,7 +3,7 @@ "ID": "16196765fb4c14edb91efdbe4f5c5973", "Namespace": "samples.col1", "Operation": "query", - "Query": "{\"find\":\"col1\",\"shardVersion\":[0,\"000000000000000000000000\"]}\n", + "Query": "{\n \"find\": \"col1\",\n \"shardVersion\": [\n 0,\n \"000000000000000000000000\"\n ]\n}", "Fingerprint": "FIND col1 find", "FirstSeen": "2017-04-10T13:16:23.29-03:00", "LastSeen": "2017-04-10T13:16:23.29-03:00", @@ -56,7 +56,7 @@ "ID": "4e4774ad26f934a193757002a991ebb8", "Namespace": "samples.col1", "Operation": "query", - "Query": "{\"find\":\"col1\",\"filter\":{\"s2\":{\"$gte\":\"41991\",\"$lt\":\"33754\"}},\"shardVersion\":[0,\"000000000000000000000000\"]}\n", + "Query": "{\n \"find\": \"col1\",\n \"filter\": {\n \"s2\": {\n \"$gte\": \"41991\",\n \"$lt\": \"33754\"\n }\n },\n \"shardVersion\": [\n 0,\n \"000000000000000000000000\"\n ]\n}", "Fingerprint": "FIND col1 s2", "FirstSeen": "2017-04-10T13:15:53.532-03:00", "LastSeen": "2017-04-10T13:15:53.532-03:00", @@ -109,7 +109,7 @@ "ID": "8cb8666ace7e54767b4d3c4f61860cf9", "Namespace": "samples.col1", "Operation": "query", - "Query": "{\"find\":\"col1\",\"filter\":{\"user_id\":{\"$gte\":3384024924,\"$lt\":195092007}},\"projection\":{\"$sortKey\":{\"$meta\":\"sortKey\"}},\"shardVersion\":[0,\"000000000000000000000000\"],\"sort\":{\"user_id\":1}}\n", + "Query": "{\n \"find\": \"col1\",\n \"filter\": {\n \"user_id\": {\n \"$gte\": 3384024924,\n \"$lt\": 195092007\n }\n },\n \"projection\": {\n \"$sortKey\": {\n \"$meta\": \"sortKey\"\n }\n },\n \"shardVersion\": [\n 0,\n \"000000000000000000000000\"\n ],\n \"sort\": {\n \"user_id\": 1\n }\n}", "Fingerprint": "FIND col1 user_id", "FirstSeen": "2017-04-10T13:15:53.524-03:00", "LastSeen": "2017-04-10T13:15:53.524-03:00", From 511c80389f42804f611c7903a221e1ed14bd5b14 Mon Sep 17 00:00:00 2001 From: Carlos Salguero Date: Tue, 29 Aug 2017 15:45:13 -0300 Subject: [PATCH 035/104] PT-152 Added SHOW SLAVE HOST to pt-mysql-summary --- bin/pt-mysql-summary | 20 ++++++++++++++++++++ lib/bash/collect_mysql_info.sh | 5 +++++ 2 files changed, 25 insertions(+) diff --git a/bin/pt-mysql-summary b/bin/pt-mysql-summary index 10f0ea56..df52ea59 100755 --- a/bin/pt-mysql-summary +++ b/bin/pt-mysql-summary @@ -929,6 +929,10 @@ collect_mysql_users () { $CMD_MYSQL $EXT_ARGV -ss -e 'SELECT COUNT(*), SUM(user=""), SUM(password=""), SUM(password NOT LIKE "*%") FROM mysql.user' 2>/dev/null } +collect_mysql_show_slave_hosts () { + $CMD_MYSQL $EXT_ARGV -ssE -e 'SHOW SLAVE HOSTS' 2>/dev/null +} + collect_master_logs_status () { local master_logs_file="$1" local master_status_file="$2" @@ -1027,6 +1031,7 @@ collect_mysql_info () { collect_mysqld_instances "$dir/mysql-variables" > "$dir/mysqld-instances" collect_mysqld_executables "$dir/mysqld-instances" > "$dir/mysqld-executables" + collect_mysql_show_slave_hosts "$dir/mysql-slave-hosts" > "$dir/mysql-slave-hosts" local binlog="$(get_var log_bin "$dir/mysql-variables")" if [ "${binlog}" ]; then @@ -2092,6 +2097,19 @@ section_mysqld () { done < "$executables_file" } +section_slave_hosts () { + local slave_hosts_file="$1" + + [ -e "$slave_hosts_file" ] || return + + section "Slave Hosts" + if [ -s "$slave_hosts_file" ]; then + cat "$slave_hosts_file" + else + echo "No slaves found" + fi +} + section_mysql_files () { local variables_file="$1" @@ -2192,6 +2210,8 @@ report_mysql_summary () { section_mysqld "$dir/mysqld-executables" "$dir/mysql-variables" + section_slave_hosts "$dir/mysql-slave-hosts" + local user="$(get_var "pt-summary-internal-user" "$dir/mysql-variables")" local port="$(get_var port "$dir/mysql-variables")" local now="$(get_var "pt-summary-internal-now" "$dir/mysql-variables")" diff --git a/lib/bash/collect_mysql_info.sh b/lib/bash/collect_mysql_info.sh index dd131633..92558be7 100644 --- a/lib/bash/collect_mysql_info.sh +++ b/lib/bash/collect_mysql_info.sh @@ -116,6 +116,10 @@ collect_mysql_users () { $CMD_MYSQL $EXT_ARGV -ss -e 'SELECT COUNT(*), SUM(user=""), SUM(password=""), SUM(password NOT LIKE "*%") FROM mysql.user' 2>/dev/null } +collect_mysql_show_slave_hosts () { + $CMD_MYSQL $EXT_ARGV -ssE -e 'SHOW SLAVE HOSTS' 2>/dev/null +} + collect_master_logs_status () { local master_logs_file="$1" local master_status_file="$2" @@ -224,6 +228,7 @@ collect_mysql_info () { collect_mysqld_instances "$dir/mysql-variables" > "$dir/mysqld-instances" collect_mysqld_executables "$dir/mysqld-instances" > "$dir/mysqld-executables" + collect_mysql_show_slave_hosts "$dir/mysql-slave-hosts" > "$dir/mysql-slave-hosts" local binlog="$(get_var log_bin "$dir/mysql-variables")" if [ "${binlog}" ]; then From 7e59feb8dd65ba44869ac5630989221102b2c25c Mon Sep 17 00:00:00 2001 From: Carlos Salguero Date: Wed, 30 Aug 2017 14:54:47 -0300 Subject: [PATCH 036/104] PT-196 pt-onine-schema-change is pausing because {some_status_variable}=0 Description here --- bin/pt-online-schema-change | 2 +- bin/pt-table-checksum | 2 +- lib/MySQLStatusWaiter.pm | 2 +- t/pt-online-schema-change/pt-196.t | 67 +++++++++++++++++++ t/pt-online-schema-change/samples/pt-196.sql | 10 +++ .../samples/default-results-5.7.txt | 4 +- .../samples/static-chunk-size-results-5.7.txt | 4 +- 7 files changed, 86 insertions(+), 5 deletions(-) create mode 100644 t/pt-online-schema-change/pt-196.t create mode 100644 t/pt-online-schema-change/samples/pt-196.sql diff --git a/bin/pt-online-schema-change b/bin/pt-online-schema-change index 95cfbef9..47436bc8 100755 --- a/bin/pt-online-schema-change +++ b/bin/pt-online-schema-change @@ -5238,7 +5238,7 @@ sub wait { die "$var=$val exceeds its critical threshold " . "$self->{critical_val_for}->{$var}\n"; } - if ( !$val || $val >= $self->{max_val_for}->{$var} ) { + if ( $val >= $self->{max_val_for}->{$var} ) { $vals_too_high{$var} = $val; } else { diff --git a/bin/pt-table-checksum b/bin/pt-table-checksum index 558fe6e3..c9dfbb08 100755 --- a/bin/pt-table-checksum +++ b/bin/pt-table-checksum @@ -8683,7 +8683,7 @@ sub wait { die "$var=$val exceeds its critical threshold " . "$self->{critical_val_for}->{$var}\n"; } - if ( !$val || $val >= $self->{max_val_for}->{$var} ) { + if ( $val >= $self->{max_val_for}->{$var} ) { $vals_too_high{$var} = $val; } else { diff --git a/lib/MySQLStatusWaiter.pm b/lib/MySQLStatusWaiter.pm index 99177be6..f06e4f02 100644 --- a/lib/MySQLStatusWaiter.pm +++ b/lib/MySQLStatusWaiter.pm @@ -175,7 +175,7 @@ sub wait { die "$var=$val exceeds its critical threshold " . "$self->{critical_val_for}->{$var}\n"; } - if ( !$val || $val >= $self->{max_val_for}->{$var} ) { + if ( $val >= $self->{max_val_for}->{$var} ) { $vals_too_high{$var} = $val; } else { diff --git a/t/pt-online-schema-change/pt-196.t b/t/pt-online-schema-change/pt-196.t new file mode 100644 index 00000000..973f5b2e --- /dev/null +++ b/t/pt-online-schema-change/pt-196.t @@ -0,0 +1,67 @@ +#!/usr/bin/env perl + +BEGIN { + die "The PERCONA_TOOLKIT_BRANCH environment variable is not set.\n" + unless $ENV{PERCONA_TOOLKIT_BRANCH} && -d $ENV{PERCONA_TOOLKIT_BRANCH}; + unshift @INC, "$ENV{PERCONA_TOOLKIT_BRANCH}/lib"; +}; + +use strict; +use warnings FATAL => 'all'; +use threads; + +use English qw(-no_match_vars); +use Test::More; + +use Data::Dumper; +use PerconaTest; +use Sandbox; +use SqlModes; +use File::Temp qw/ tempdir /; + +plan tests => 2; + +require "$trunk/bin/pt-online-schema-change"; + +my $dp = new DSNParser(opts=>$dsn_opts); +my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp); +my $master_dbh = $sb->get_dbh_for('master'); +my $master_dsn = 'h=127.1,P=12345,u=msandbox,p=msandbox'; + +if ( !$master_dbh ) { + plan skip_all => 'Cannot connect to sandbox master'; +} + +# The sandbox servers run with lock_wait_timeout=3 and it's not dynamic +# so we need to specify --set-vars innodb_lock_wait_timeout=3 else the +# tool will die. +my @args = (qw(--set-vars innodb_lock_wait_timeout=3)); +my $output; +my $exit_status; +my $sample = "t/pt-online-schema-change/samples/"; + +$sb->load_file('master', "$sample/pt-196.sql"); + + +($output, $exit_status) = full_output( + sub { pt_online_schema_change::main(@args, "$master_dsn,D=test,t=test", + '--execute', '--alter', 'DROP COLUMN test', '--max-load', + 'THREADPOOL_IDLE_THREADS=1' + ), + }, +); + +is( + $exit_status, + 0, + "--alter rename columns with uppercase names -> exit status 0", +); + +$master_dbh->do("DROP DATABASE IF EXISTS test"); + +# ############################################################################# +# Done. +# ############################################################################# +$sb->wipe_clean($master_dbh); +ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox"); +done_testing; diff --git a/t/pt-online-schema-change/samples/pt-196.sql b/t/pt-online-schema-change/samples/pt-196.sql new file mode 100644 index 00000000..bf3dbefd --- /dev/null +++ b/t/pt-online-schema-change/samples/pt-196.sql @@ -0,0 +1,10 @@ +DROP SCHEMA IF EXISTS test; +CREATE SCHEMA test; +USE test; + +CREATE TABLE test( + id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, + test INT +); + +INSERT INTO test (test) VALUES(1),(2),(3); diff --git a/t/pt-table-checksum/samples/default-results-5.7.txt b/t/pt-table-checksum/samples/default-results-5.7.txt index 7e8648f4..244bd08a 100644 --- a/t/pt-table-checksum/samples/default-results-5.7.txt +++ b/t/pt-table-checksum/samples/default-results-5.7.txt @@ -4,12 +4,13 @@ ERRORS DIFFS ROWS SKIPPED TABLE 0 0 2 0 mysql.engine_cost 0 0 0 0 mysql.event 0 0 0 0 mysql.func -0 0 0 0 mysql.gtid_executed 0 0 40 0 mysql.help_category 0 0 682 0 mysql.help_keyword 0 0 1340 0 mysql.help_relation 0 0 637 0 mysql.help_topic 0 0 0 0 mysql.ndb_binlog_index +0 0 0 0 mysql.plugin +0 0 0 0 mysql.proc 0 0 0 0 mysql.procs_priv 0 0 0 0 mysql.proxies_priv 0 0 6 0 mysql.server_cost @@ -40,3 +41,4 @@ ERRORS DIFFS ROWS SKIPPED TABLE 0 0 16044 0 sakila.rental 0 0 2 0 sakila.staff 0 0 2 0 sakila.store +0 0 6 0 sys.sys_config diff --git a/t/pt-table-checksum/samples/static-chunk-size-results-5.7.txt b/t/pt-table-checksum/samples/static-chunk-size-results-5.7.txt index f6755a93..3932c431 100644 --- a/t/pt-table-checksum/samples/static-chunk-size-results-5.7.txt +++ b/t/pt-table-checksum/samples/static-chunk-size-results-5.7.txt @@ -4,12 +4,13 @@ ERRORS DIFFS ROWS CHUNKS SKIPPED TABLE 0 0 2 1 0 mysql.engine_cost 0 0 0 1 0 mysql.event 0 0 0 1 0 mysql.func -0 0 0 1 0 mysql.gtid_executed 0 0 40 1 0 mysql.help_category 0 0 682 1 0 mysql.help_keyword 0 0 1340 1 0 mysql.help_relation 0 0 637 1 0 mysql.help_topic 0 0 0 1 0 mysql.ndb_binlog_index +0 0 0 1 0 mysql.plugin +0 0 0 1 0 mysql.proc 0 0 0 1 0 mysql.procs_priv 0 0 0 1 0 mysql.proxies_priv 0 0 6 1 0 mysql.server_cost @@ -40,3 +41,4 @@ ERRORS DIFFS ROWS CHUNKS SKIPPED TABLE 0 0 16044 19 0 sakila.rental 0 0 2 1 0 sakila.staff 0 0 2 1 0 sakila.store +0 0 6 1 0 sys.sys_config From 5393a2b00127f64b421ddb1c3db3141435475170 Mon Sep 17 00:00:00 2001 From: Kamil Dziedzic Date: Thu, 31 Aug 2017 13:52:37 +0200 Subject: [PATCH 037/104] PMM-685: explain --- .travis.yml | 22 ++- src/go/lib/tutil/util.go | 3 +- src/go/mongolib/explain/explain.go | 32 ++++ src/go/mongolib/explain/explain_test.go | 159 ++++++++++++++++++ .../fingerprinter/fingerprinter_test.go | 5 + src/go/mongolib/profiler/profiler_test.go | 8 +- src/go/mongolib/proto/bson.go | 25 ++- src/go/mongolib/proto/system.profile.go | 142 ++++++++++++++++ src/go/mongolib/stats/stats.go | 13 +- src/go/mongolib/stats/stats_test.go | 2 +- src/go/tests/doc/out/delete_all_2.6.12 | 33 ++++ src/go/tests/doc/out/delete_all_3.0.15 | 47 ++++++ src/go/tests/doc/out/delete_all_3.2.16 | 42 +++++ src/go/tests/doc/out/delete_all_3.4.7 | 113 +++++++++++++ src/go/tests/doc/out/delete_all_3.5.11 | 116 +++++++++++++ src/go/tests/doc/script/profile/delete_all.js | 9 + src/go/tests/profiler_docs_stats.want.json | 6 +- 17 files changed, 751 insertions(+), 26 deletions(-) create mode 100644 src/go/mongolib/explain/explain.go create mode 100644 src/go/mongolib/explain/explain_test.go create mode 100644 src/go/tests/doc/out/delete_all_2.6.12 create mode 100644 src/go/tests/doc/out/delete_all_3.0.15 create mode 100644 src/go/tests/doc/out/delete_all_3.2.16 create mode 100644 src/go/tests/doc/out/delete_all_3.4.7 create mode 100644 src/go/tests/doc/out/delete_all_3.5.11 create mode 100644 src/go/tests/doc/script/profile/delete_all.js diff --git a/.travis.yml b/.travis.yml index 68c7d62f..6e16fcf2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,21 @@ language: go go: - 1.8.x - - tip + +services: + - docker + +env: + matrix: + - MONGODB_IMAGE=mongo:3.2 + - MONGODB_IMAGE=mongo:3.4 + - MONGODB_IMAGE=percona/percona-server-mongodb:3.2 + - MONGODB_IMAGE=percona/percona-server-mongodb:3.4 + +matrix: + include: + - go: tip + env: install: - go get -u github.com/Masterminds/glide @@ -16,6 +30,12 @@ install: before_script: # check if vendor dir is correct - git diff --exit-code + # run docker containers + - docker-compose up -d + # log versions + - docker --version + - docker-compose --version + - docker-compose exec mongo mongo --version script: - go test -timeout 1m $(glide nv) diff --git a/src/go/lib/tutil/util.go b/src/go/lib/tutil/util.go index 9bd2477f..5cbf9cad 100644 --- a/src/go/lib/tutil/util.go +++ b/src/go/lib/tutil/util.go @@ -5,9 +5,8 @@ import ( "io/ioutil" "os" "os/exec" - "strings" - "regexp" + "strings" "gopkg.in/mgo.v2/bson" ) diff --git a/src/go/mongolib/explain/explain.go b/src/go/mongolib/explain/explain.go new file mode 100644 index 00000000..8e58d0e1 --- /dev/null +++ b/src/go/mongolib/explain/explain.go @@ -0,0 +1,32 @@ +package explain + +import ( + "github.com/percona/percona-toolkit/src/go/mongolib/proto" + "github.com/percona/pmgo" + "gopkg.in/mgo.v2/bson" +) + +type explain struct { + session pmgo.SessionManager +} + +func New(session pmgo.SessionManager) *explain { + return &explain{ + session: session, + } +} + +func (e *explain) Explain(eq proto.ExampleQuery) ([]byte, error) { + var result proto.BsonD + err := e.session.DB(eq.Db()).Run(eq.ExplainCmd(), &result) + if err != nil { + return nil, err + } + + resultJson, err := bson.MarshalJSON(result) + if err != nil { + return nil, err + } + + return resultJson, nil +} diff --git a/src/go/mongolib/explain/explain_test.go b/src/go/mongolib/explain/explain_test.go new file mode 100644 index 00000000..ee0b8ad0 --- /dev/null +++ b/src/go/mongolib/explain/explain_test.go @@ -0,0 +1,159 @@ +package explain + +import ( + "io/ioutil" + "log" + "os" + "testing" + + "fmt" + + "github.com/percona/percona-toolkit/src/go/lib/tutil" + "github.com/percona/percona-toolkit/src/go/mongolib/proto" + "github.com/percona/pmgo" + "github.com/stretchr/testify/require" + "gopkg.in/mgo.v2/bson" +) + +const ( + samples = "/src/go/tests/" +) + +type testVars struct { + RootPath string +} + +var vars testVars + +func TestMain(m *testing.M) { + var err error + if vars.RootPath, err = tutil.RootPath(); err != nil { + log.Printf("cannot get root path: %s", err.Error()) + os.Exit(1) + } + os.Exit(m.Run()) +} + +func TestExplain(t *testing.T) { + t.Parallel() + + dir := vars.RootPath + samples + "/doc/out/" + files, err := ioutil.ReadDir(dir) + if err != nil { + t.Fatalf("cannot list samples: %s", err) + } + + expectError := map[string]string{ + "aggregate_2.6.12": "Cannot explain cmd: aggregate", + "aggregate_3.0.15": "Cannot explain cmd: aggregate", + "aggregate_3.2.16": "Cannot explain cmd: aggregate", + "aggregate_3.4.7": "Cannot explain cmd: aggregate", + "aggregate_3.5.11": "Cannot explain cmd: aggregate", + "count_2.6.12": "", + "count_3.0.15": "", + "count_3.2.16": "", + "count_3.4.7": "", + "count_3.5.11": "", + "count_with_query_2.6.12": "", + "count_with_query_3.0.15": "", + "count_with_query_3.2.16": "", + "count_with_query_3.4.7": "", + "count_with_query_3.5.11": "", + "delete_2.6.12": "", + "delete_3.0.15": "", + "delete_3.2.16": "", + "delete_3.4.7": "", + "delete_3.5.11": "", + "delete_all_2.6.12": "", + "delete_all_3.0.15": "", + "delete_all_3.2.16": "", + "delete_all_3.4.7": "", + "delete_all_3.5.11": "", + "distinct_2.6.12": "", + "distinct_3.0.15": "", + "distinct_3.2.16": "", + "distinct_3.4.7": "", + "distinct_3.5.11": "", + "find_empty_2.6.12": "", + "find_empty_3.0.15": "", + "find_empty_3.2.16": "", + "find_empty_3.4.7": "", + "find_empty_3.5.11": "", + "find_2.6.12": "", + "find_3.0.15": "", + "find_3.2.16": "", + "find_3.4.7": "", + "find_3.5.11": "", + "find_andrii_2.6.12": "", + "find_andrii_3.0.15": "", + "find_andrii_3.2.16": "", + "find_andrii_3.4.7": "", + "find_andrii_3.5.11": "", + "findandmodify_2.6.12": "", + "findandmodify_3.0.15": "", + "findandmodify_3.2.16": "", + "findandmodify_3.4.7": "", + "findandmodify_3.5.11": "", + "geonear_2.6.12": "Cannot explain cmd: geoNear", + "geonear_3.0.15": "Cannot explain cmd: geoNear", + "geonear_3.2.16": "Cannot explain cmd: geoNear", + "geonear_3.4.7": "Cannot explain cmd: geoNear", + "geonear_3.5.11": "Cannot explain cmd: geoNear", + "group_2.6.12": "", + "group_3.0.15": "", + "group_3.2.16": "", + "group_3.4.7": "", + "group_3.5.11": "", + "insert_2.6.12": "Cannot explain cmd: insert", + "insert_3.0.15": "Cannot explain cmd: insert", + "insert_3.2.16": "Cannot explain cmd: insert", + "insert_3.4.7": "Cannot explain cmd: insert", + "insert_3.5.11": "Cannot explain cmd: insert", + "mapreduce_2.6.12": "Cannot explain cmd: mapReduce", + "mapreduce_3.0.15": "Cannot explain cmd: mapReduce", + "mapreduce_3.2.16": "Cannot explain cmd: mapReduce", + "mapreduce_3.4.7": "Cannot explain cmd: mapReduce", + "mapreduce_3.5.11": "Cannot explain cmd: mapReduce", + "update_2.6.12": "", + "update_3.0.15": "", + "update_3.2.16": "", + "update_3.4.7": "", + "update_3.5.11": "", + } + + dialer := pmgo.NewDialer() + dialInfo, err := pmgo.ParseURL("127.0.0.1:27017") + require.NoError(t, err) + + session, err := dialer.DialWithInfo(dialInfo) + require.NoError(t, err) + defer session.Close() + + ex := New(session) + + for _, file := range files { + t.Run(file.Name(), func(t *testing.T) { + eq := proto.ExampleQuery{} + err := tutil.LoadBson(dir+file.Name(), &eq) + if err != nil { + t.Fatalf("cannot load sample %s: %s", dir+file.Name(), err) + } + got, err := ex.Explain(eq) + expectErrMsg := expectError[file.Name()] + gotErrMsg := fmt.Sprintf("%v", err) + if gotErrMsg != expectErrMsg { + t.Fatalf("explain error should be '%s' but was '%s'", expectErrMsg, gotErrMsg) + } + + if err != nil { + return + } + + result := proto.BsonD{} + err = bson.UnmarshalJSON(got, &result) + if err != nil { + t.Fatalf("cannot unmarshal json explain result: %s", err) + } + }) + } +} diff --git a/src/go/mongolib/fingerprinter/fingerprinter_test.go b/src/go/mongolib/fingerprinter/fingerprinter_test.go index 836fc171..cbdb1d96 100644 --- a/src/go/mongolib/fingerprinter/fingerprinter_test.go +++ b/src/go/mongolib/fingerprinter/fingerprinter_test.go @@ -103,6 +103,11 @@ func TestFingerprints(t *testing.T) { "delete_3.2.16": "REMOVE coll a,b", "delete_3.4.7": "REMOVE coll a,b", "delete_3.5.11": "REMOVE coll a,b", + "delete_all_2.6.12": "REMOVE coll a,b", + "delete_all_3.0.15": "REMOVE coll a,b", + "delete_all_3.2.16": "REMOVE coll a,b", + "delete_all_3.4.7": "REMOVE coll a,b", + "delete_all_3.5.11": "REMOVE coll a,b", "distinct_2.6.12": "DISTINCT coll a,b", "distinct_3.0.15": "DISTINCT coll a,b", "distinct_3.2.16": "DISTINCT coll a,b", diff --git a/src/go/mongolib/profiler/profiler_test.go b/src/go/mongolib/profiler/profiler_test.go index 037f3ec5..ee8e564b 100644 --- a/src/go/mongolib/profiler/profiler_test.go +++ b/src/go/mongolib/profiler/profiler_test.go @@ -73,7 +73,7 @@ func TestRegularIterator(t *testing.T) { ID: "16196765fb4c14edb91efdbe4f5c5973", Namespace: "samples.col1", Operation: "query", - Query: "{\n \"find\": \"col1\",\n \"shardVersion\": [\n 0,\n \"000000000000000000000000\"\n ]\n}", + Query: "{\"ns\":\"samples.col1\",\"op\":\"query\",\"query\":{\"find\":\"col1\",\"shardVersion\":[0,\"000000000000000000000000\"]}}\n", Fingerprint: "FIND col1 find", FirstSeen: firstSeen, LastSeen: lastSeen, @@ -130,7 +130,7 @@ func TestIteratorTimeout(t *testing.T) { ID: "16196765fb4c14edb91efdbe4f5c5973", Namespace: "samples.col1", Operation: "query", - Query: "{\n \"find\": \"col1\",\n \"shardVersion\": [\n 0,\n \"000000000000000000000000\"\n ]\n}", + Query: "{\"ns\":\"samples.col1\",\"op\":\"query\",\"query\":{\"find\":\"col1\",\"shardVersion\":[0,\"000000000000000000000000\"]}}\n", Fingerprint: "FIND col1 find", FirstSeen: firstSeen, LastSeen: lastSeen, @@ -211,7 +211,7 @@ func TestTailIterator(t *testing.T) { ID: "16196765fb4c14edb91efdbe4f5c5973", Namespace: "samples.col1", Operation: "query", - Query: "{\n \"find\": \"col1\",\n \"shardVersion\": [\n 0,\n \"000000000000000000000000\"\n ]\n}", + Query: "{\"ns\":\"samples.col1\",\"op\":\"query\",\"query\":{\"find\":\"col1\",\"shardVersion\":[0,\"000000000000000000000000\"]}}\n", Fingerprint: "FIND col1 find", FirstSeen: parseDate("2017-04-01T23:01:20.214+00:00"), LastSeen: parseDate("2017-04-01T23:01:20.214+00:00"), @@ -226,7 +226,7 @@ func TestTailIterator(t *testing.T) { ID: "16196765fb4c14edb91efdbe4f5c5973", Namespace: "samples.col1", Operation: "query", - Query: "{\n \"find\": \"col1\",\n \"shardVersion\": [\n 0,\n \"000000000000000000000000\"\n ]\n}", + Query: "{\"ns\":\"samples.col1\",\"op\":\"query\",\"query\":{\"find\":\"col1\",\"shardVersion\":[0,\"000000000000000000000000\"]}}\n", Fingerprint: "FIND col1 find", FirstSeen: parseDate("2017-04-01T23:01:19.914+00:00"), LastSeen: parseDate("2017-04-01T23:01:19.914+00:00"), diff --git a/src/go/mongolib/proto/bson.go b/src/go/mongolib/proto/bson.go index d6a01bbf..b8664a72 100644 --- a/src/go/mongolib/proto/bson.go +++ b/src/go/mongolib/proto/bson.go @@ -4,6 +4,7 @@ import ( "bytes" "encoding/json" "fmt" + "math" "gopkg.in/mgo.v2/bson" ) @@ -97,17 +98,31 @@ func (d BsonD) MarshalJSON() ([]byte, error) { } // marshal key - key, err := json.Marshal(v.Name) + key, err := bson.MarshalJSON(v.Name) if err != nil { return nil, err } b.Write(key) b.WriteByte(':') - // marshal value - val, err := json.Marshal(v.Value) - if err != nil { - return nil, err + var val []byte + if value, ok := v.Value.(float64); ok && math.IsInf(value, 0) { + if math.IsInf(value, 1) { + val = []byte("Infinity") + } else { + val = []byte("-Infinity") + } + + // below is wrong, but I'm later unable to Unmarshal Infinity, + // so we turn it into string for now + val = append([]byte(`"`), val...) + val = append(val, '"') + } else { + // marshal value + val, err = bson.MarshalJSON(v.Value) + if err != nil { + return nil, err + } } b.Write(val) } diff --git a/src/go/mongolib/proto/system.profile.go b/src/go/mongolib/proto/system.profile.go index bb444e9b..df4013d5 100644 --- a/src/go/mongolib/proto/system.profile.go +++ b/src/go/mongolib/proto/system.profile.go @@ -1,7 +1,10 @@ package proto import ( + "strings" "time" + + "gopkg.in/mgo.v2/bson" ) type SystemProfile struct { @@ -74,9 +77,148 @@ type SystemProfile struct { Op string `bson:"op"` Protocol string `bson:"protocol"` Query BsonD `bson:"query"` + UpdateObj BsonD `bson:"updateobj"` Command BsonD `bson:"command"` ResponseLength int `bson:"responseLength"` Ts time.Time `bson:"ts"` User string `bson:"user"` WriteConflicts int `bson:"writeConflicts"` } + +func NewExampleQuery(doc SystemProfile) ExampleQuery { + return ExampleQuery{ + Ns: doc.Ns, + Op: doc.Op, + Query: doc.Query, + Command: doc.Command, + UpdateObj: doc.UpdateObj, + } +} + +// ExampleQuery is a subset of SystemProfile +type ExampleQuery struct { + Ns string `bson:"ns" json:"ns"` + Op string `bson:"op" json:"op"` + Query BsonD `bson:"query,omitempty" json:"query,omitempty"` + Command BsonD `bson:"command,omitempty" json:"command,omitempty"` + UpdateObj BsonD `bson:"updateobj,omitempty" json:"updateobj,omitempty"` +} + +func (self ExampleQuery) Db() string { + ns := strings.SplitN(self.Ns, ".", 2) + if len(ns) > 0 { + return ns[0] + } + return "" +} + +func (self ExampleQuery) ExplainCmd() bson.D { + cmd := self.Command + + switch self.Op { + case "query": + if cmd.Len() == 0 { + cmd = self.Query + } + if cmd.Len() == 0 || cmd[0].Name != "find" { + var filter interface{} + if cmd.Len() > 0 && cmd[0].Name == "query" { + filter = cmd[0].Value + } else { + filter = cmd + } + + coll := "" + s := strings.SplitN(self.Ns, ".", 2) + if len(s) == 2 { + coll = s[1] + } + + cmd = BsonD{ + {"find", coll}, + {"filter", filter}, + } + } + case "update": + s := strings.SplitN(self.Ns, ".", 2) + coll := "" + if len(s) == 2 { + coll = s[1] + } + if cmd.Len() == 0 { + cmd = BsonD{ + {Name: "q", Value: self.Query}, + {Name: "u", Value: self.UpdateObj}, + } + } + cmd = BsonD{ + {Name: "update", Value: coll}, + {Name: "updates", Value: []interface{}{cmd}}, + } + case "remove": + s := strings.SplitN(self.Ns, ".", 2) + coll := "" + if len(s) == 2 { + coll = s[1] + } + if cmd.Len() == 0 { + cmd = BsonD{ + {Name: "q", Value: self.Query}, + // we can't determine if limit was 1 or 0 so we assume 0 + {Name: "limit", Value: 0}, + } + } + cmd = BsonD{ + {Name: "delete", Value: coll}, + {Name: "deletes", Value: []interface{}{cmd}}, + } + case "insert": + if cmd.Len() == 0 { + cmd = self.Query + } + if cmd.Len() == 0 || cmd[0].Name != "insert" { + coll := "" + s := strings.SplitN(self.Ns, ".", 2) + if len(s) == 2 { + coll = s[1] + } + + cmd = BsonD{ + {"insert", coll}, + } + } + case "command": + if cmd.Len() == 0 || cmd[0].Name != "group" { + break + } + + if v, ok := cmd[0].Value.(BsonD); ok { + for i := range v { + // for MongoDB <= 3.2 + // "$reduce" : function () {} + // It is then Unmarshaled as empty value, so in essence not working + // + // for MongoDB >= 3.4 + // "$reduce" : { + // "code" : "function () {}" + // } + // It is then properly Unmarshaled but then explain fails with "not code" + // + // The $reduce function shouldn't affect explain execution plan (e.g. what indexes are picked) + // so we ignore it for now until we find better way to handle this issue + if v[i].Name == "$reduce" { + v[i].Value = "" + cmd[0].Value = v + break + } + } + } + } + + return bson.D{ + { + Name: "explain", + Value: cmd, + }, + } +} diff --git a/src/go/mongolib/stats/stats.go b/src/go/mongolib/stats/stats.go index e8caaca9..5bb7098b 100644 --- a/src/go/mongolib/stats/stats.go +++ b/src/go/mongolib/stats/stats.go @@ -6,11 +6,11 @@ import ( "sort" "sync" "time" - "encoding/json" "github.com/montanaflynn/stats" "github.com/percona/percona-toolkit/src/go/mongolib/fingerprinter" "github.com/percona/percona-toolkit/src/go/mongolib/proto" + "gopkg.in/mgo.v2/bson" ) type StatsError struct { @@ -30,7 +30,6 @@ func (e *StatsError) Parent() error { } type StatsFingerprintError StatsError -type StatsGetQueryFieldError StatsError // New creates new instance of stats with given fingerprinter func New(fingerprinter fingerprinter.Fingerprinter) *Stats { @@ -75,14 +74,8 @@ func (s *Stats) Add(doc proto.SystemProfile) error { Namespace: doc.Ns, } if qiac, ok = s.getQueryInfoAndCounters(key); !ok { - query := doc.Query - if doc.Command.Len() > 0 { - query = doc.Command - } - if err != nil { - return &StatsGetQueryFieldError{err} - } - queryBson, err := json.MarshalIndent(query, "", " ") + query := proto.NewExampleQuery(doc) + queryBson, err := bson.MarshalJSON(query) if err != nil { return err } diff --git a/src/go/mongolib/stats/stats_test.go b/src/go/mongolib/stats/stats_test.go index 47a9b3a9..88f9eefc 100644 --- a/src/go/mongolib/stats/stats_test.go +++ b/src/go/mongolib/stats/stats_test.go @@ -142,7 +142,7 @@ func TestStats(t *testing.T) { ID: "4e4774ad26f934a193757002a991ebb8", Namespace: "samples.col1", Operation: "query", - Query: "{\n \"find\": \"col1\",\n \"filter\": {\n \"s2\": {\n \"$gte\": \"41991\",\n \"$lt\": \"33754\"\n }\n },\n \"shardVersion\": [\n 0,\n \"000000000000000000000000\"\n ]\n}", + Query: "{\"ns\":\"samples.col1\",\"op\":\"query\",\"query\":{\"find\":\"col1\",\"filter\":{\"s2\":{\"$gte\":\"41991\",\"$lt\":\"33754\"}},\"shardVersion\":[0,\"000000000000000000000000\"]}}\n", Fingerprint: "FIND col1 s2", FirstSeen: parseDate("2017-04-10T13:15:53.532-03:00"), LastSeen: parseDate("2017-04-10T13:15:53.532-03:00"), diff --git a/src/go/tests/doc/out/delete_all_2.6.12 b/src/go/tests/doc/out/delete_all_2.6.12 new file mode 100644 index 00000000..66995bb7 --- /dev/null +++ b/src/go/tests/doc/out/delete_all_2.6.12 @@ -0,0 +1,33 @@ +{ + "op" : "remove", + "ns" : "test.coll", + "query" : { + "a" : { + "$gte" : 2 + }, + "b" : { + "$gte" : 2 + } + }, + "ndeleted" : 15, + "keyUpdates" : 0, + "numYield" : 0, + "lockStats" : { + "timeLockedMicros" : { + "r" : NumberLong(0), + "w" : NumberLong(238) + }, + "timeAcquiringMicros" : { + "r" : NumberLong(0), + "w" : NumberLong(4) + } + }, + "millis" : 0, + "execStats" : { + + }, + "ts" : ISODate("2017-08-30T10:54:45.348Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/delete_all_3.0.15 b/src/go/tests/doc/out/delete_all_3.0.15 new file mode 100644 index 00000000..78f5d10b --- /dev/null +++ b/src/go/tests/doc/out/delete_all_3.0.15 @@ -0,0 +1,47 @@ +{ + "op" : "remove", + "ns" : "test.coll", + "query" : { + "a" : { + "$gte" : 2 + }, + "b" : { + "$gte" : 2 + } + }, + "ndeleted" : 15, + "keyUpdates" : 0, + "writeConflicts" : 0, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(1), + "w" : NumberLong(1) + } + }, + "MMAPV1Journal" : { + "acquireCount" : { + "w" : NumberLong(16) + } + }, + "Database" : { + "acquireCount" : { + "w" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "W" : NumberLong(1) + } + } + }, + "millis" : 1, + "execStats" : { + + }, + "ts" : ISODate("2017-08-30T10:54:52.821Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/delete_all_3.2.16 b/src/go/tests/doc/out/delete_all_3.2.16 new file mode 100644 index 00000000..338c92c9 --- /dev/null +++ b/src/go/tests/doc/out/delete_all_3.2.16 @@ -0,0 +1,42 @@ +{ + "op" : "remove", + "ns" : "test.coll", + "query" : { + "a" : { + "$gte" : 2 + }, + "b" : { + "$gte" : 2 + } + }, + "ndeleted" : 15, + "keyUpdates" : 0, + "writeConflicts" : 0, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(1), + "w" : NumberLong(1) + } + }, + "Database" : { + "acquireCount" : { + "w" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "w" : NumberLong(1) + } + } + }, + "millis" : 0, + "execStats" : { + + }, + "ts" : ISODate("2017-08-30T10:55:02.238Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/delete_all_3.4.7 b/src/go/tests/doc/out/delete_all_3.4.7 new file mode 100644 index 00000000..741b0c30 --- /dev/null +++ b/src/go/tests/doc/out/delete_all_3.4.7 @@ -0,0 +1,113 @@ +{ + "op" : "remove", + "ns" : "test.coll", + "query" : { + "a" : { + "$gte" : 2 + }, + "b" : { + "$gte" : 2 + } + }, + "keysExamined" : 39, + "docsExamined" : 39, + "ndeleted" : 15, + "keysDeleted" : 30, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(1), + "w" : NumberLong(1) + } + }, + "Database" : { + "acquireCount" : { + "w" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "w" : NumberLong(1) + } + } + }, + "millis" : 0, + "planSummary" : "IXSCAN { a: 1 }", + "execStats" : { + "stage" : "DELETE", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 40, + "advanced" : 0, + "needTime" : 39, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "nWouldDelete" : 15, + "nInvalidateSkips" : 0, + "inputStage" : { + "stage" : "FETCH", + "filter" : { + "b" : { + "$gte" : 2 + } + }, + "nReturned" : 15, + "executionTimeMillisEstimate" : 0, + "works" : 40, + "advanced" : 15, + "needTime" : 24, + "needYield" : 0, + "saveState" : 15, + "restoreState" : 15, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 39, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 39, + "executionTimeMillisEstimate" : 0, + "works" : 40, + "advanced" : 39, + "needTime" : 0, + "needYield" : 0, + "saveState" : 15, + "restoreState" : 15, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "a" : 1 + }, + "indexName" : "a_1", + "isMultiKey" : false, + "multiKeyPaths" : { + "a" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "a" : [ + "[2.0, inf.0]" + ] + }, + "keysExamined" : 39, + "seeks" : 1, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + } + }, + "ts" : ISODate("2017-08-30T10:55:09.833Z"), + "client" : "127.0.0.1", + "appName" : "MongoDB Shell", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/delete_all_3.5.11 b/src/go/tests/doc/out/delete_all_3.5.11 new file mode 100644 index 00000000..2435a88a --- /dev/null +++ b/src/go/tests/doc/out/delete_all_3.5.11 @@ -0,0 +1,116 @@ +{ + "op" : "remove", + "ns" : "test.coll", + "command" : { + "q" : { + "a" : { + "$gte" : 2 + }, + "b" : { + "$gte" : 2 + } + }, + "limit" : 0 + }, + "keysExamined" : 39, + "docsExamined" : 39, + "ndeleted" : 15, + "keysDeleted" : 30, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(1), + "w" : NumberLong(1) + } + }, + "Database" : { + "acquireCount" : { + "w" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "w" : NumberLong(1) + } + } + }, + "millis" : 0, + "planSummary" : "IXSCAN { a: 1 }", + "execStats" : { + "stage" : "DELETE", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 40, + "advanced" : 0, + "needTime" : 39, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "nWouldDelete" : 15, + "nInvalidateSkips" : 0, + "inputStage" : { + "stage" : "FETCH", + "filter" : { + "b" : { + "$gte" : 2 + } + }, + "nReturned" : 15, + "executionTimeMillisEstimate" : 0, + "works" : 40, + "advanced" : 15, + "needTime" : 24, + "needYield" : 0, + "saveState" : 15, + "restoreState" : 15, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 39, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 39, + "executionTimeMillisEstimate" : 0, + "works" : 40, + "advanced" : 39, + "needTime" : 0, + "needYield" : 0, + "saveState" : 15, + "restoreState" : 15, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "a" : 1 + }, + "indexName" : "a_1", + "isMultiKey" : false, + "multiKeyPaths" : { + "a" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "a" : [ + "[2.0, inf.0]" + ] + }, + "keysExamined" : 39, + "seeks" : 1, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + } + }, + "ts" : ISODate("2017-08-30T10:55:19.142Z"), + "client" : "127.0.0.1", + "appName" : "MongoDB Shell", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/script/profile/delete_all.js b/src/go/tests/doc/script/profile/delete_all.js new file mode 100644 index 00000000..d612bde4 --- /dev/null +++ b/src/go/tests/doc/script/profile/delete_all.js @@ -0,0 +1,9 @@ +var coll = db.coll + +for (i = 0; i < 10; ++i) { + coll.insert({a: i, b: i}); +} + +coll.createIndex({a: 1}); + +coll.remove({a: {$gte: 2}, b: {$gte: 2}}) diff --git a/src/go/tests/profiler_docs_stats.want.json b/src/go/tests/profiler_docs_stats.want.json index 34f8276d..c6bb1f85 100644 --- a/src/go/tests/profiler_docs_stats.want.json +++ b/src/go/tests/profiler_docs_stats.want.json @@ -3,7 +3,7 @@ "ID": "16196765fb4c14edb91efdbe4f5c5973", "Namespace": "samples.col1", "Operation": "query", - "Query": "{\n \"find\": \"col1\",\n \"shardVersion\": [\n 0,\n \"000000000000000000000000\"\n ]\n}", + "Query": "{\"ns\":\"samples.col1\",\"op\":\"query\",\"query\":{\"find\":\"col1\",\"shardVersion\":[0,\"000000000000000000000000\"]}}\n", "Fingerprint": "FIND col1 find", "FirstSeen": "2017-04-10T13:16:23.29-03:00", "LastSeen": "2017-04-10T13:16:23.29-03:00", @@ -56,7 +56,7 @@ "ID": "4e4774ad26f934a193757002a991ebb8", "Namespace": "samples.col1", "Operation": "query", - "Query": "{\n \"find\": \"col1\",\n \"filter\": {\n \"s2\": {\n \"$gte\": \"41991\",\n \"$lt\": \"33754\"\n }\n },\n \"shardVersion\": [\n 0,\n \"000000000000000000000000\"\n ]\n}", + "Query": "{\"ns\":\"samples.col1\",\"op\":\"query\",\"query\":{\"find\":\"col1\",\"filter\":{\"s2\":{\"$gte\":\"41991\",\"$lt\":\"33754\"}},\"shardVersion\":[0,\"000000000000000000000000\"]}}\n", "Fingerprint": "FIND col1 s2", "FirstSeen": "2017-04-10T13:15:53.532-03:00", "LastSeen": "2017-04-10T13:15:53.532-03:00", @@ -109,7 +109,7 @@ "ID": "8cb8666ace7e54767b4d3c4f61860cf9", "Namespace": "samples.col1", "Operation": "query", - "Query": "{\n \"find\": \"col1\",\n \"filter\": {\n \"user_id\": {\n \"$gte\": 3384024924,\n \"$lt\": 195092007\n }\n },\n \"projection\": {\n \"$sortKey\": {\n \"$meta\": \"sortKey\"\n }\n },\n \"shardVersion\": [\n 0,\n \"000000000000000000000000\"\n ],\n \"sort\": {\n \"user_id\": 1\n }\n}", + "Query": "{\"ns\":\"samples.col1\",\"op\":\"query\",\"query\":{\"find\":\"col1\",\"filter\":{\"user_id\":{\"$gte\":3.384024924e+09,\"$lt\":1.95092007e+08}},\"projection\":{\"$sortKey\":{\"$meta\":\"sortKey\"}},\"shardVersion\":[0,\"000000000000000000000000\"],\"sort\":{\"user_id\":1}}}\n", "Fingerprint": "FIND col1 user_id", "FirstSeen": "2017-04-10T13:15:53.524-03:00", "LastSeen": "2017-04-10T13:15:53.524-03:00", From 05558d84067d584a2d8f99e395f5b68f9d8ea697 Mon Sep 17 00:00:00 2001 From: Kamil Dziedzic Date: Thu, 31 Aug 2017 17:14:21 +0200 Subject: [PATCH 038/104] PMM-685: let explain operate on []byte --- src/go/mongolib/explain/explain.go | 16 ++++++++++++++-- src/go/mongolib/explain/explain_test.go | 20 +++++++++++--------- 2 files changed, 25 insertions(+), 11 deletions(-) diff --git a/src/go/mongolib/explain/explain.go b/src/go/mongolib/explain/explain.go index 8e58d0e1..f38a3172 100644 --- a/src/go/mongolib/explain/explain.go +++ b/src/go/mongolib/explain/explain.go @@ -16,9 +16,21 @@ func New(session pmgo.SessionManager) *explain { } } -func (e *explain) Explain(eq proto.ExampleQuery) ([]byte, error) { +func (e *explain) Explain(db string, query []byte) ([]byte, error) { + var err error + var eq proto.ExampleQuery + + err = bson.UnmarshalJSON(query, &eq) + if err != nil { + return nil, err + } + + if db == "" { + db = eq.Db() + } + var result proto.BsonD - err := e.session.DB(eq.Db()).Run(eq.ExplainCmd(), &result) + err = e.session.DB(db).Run(eq.ExplainCmd(), &result) if err != nil { return nil, err } diff --git a/src/go/mongolib/explain/explain_test.go b/src/go/mongolib/explain/explain_test.go index ee0b8ad0..0d8e7cf7 100644 --- a/src/go/mongolib/explain/explain_test.go +++ b/src/go/mongolib/explain/explain_test.go @@ -138,21 +138,23 @@ func TestExplain(t *testing.T) { if err != nil { t.Fatalf("cannot load sample %s: %s", dir+file.Name(), err) } - got, err := ex.Explain(eq) + query, err := bson.MarshalJSON(eq) + if err != nil { + t.Fatalf("cannot marshal json %s: %s", dir+file.Name(), err) + } + got, err := ex.Explain("", query) expectErrMsg := expectError[file.Name()] gotErrMsg := fmt.Sprintf("%v", err) if gotErrMsg != expectErrMsg { t.Fatalf("explain error should be '%s' but was '%s'", expectErrMsg, gotErrMsg) } - if err != nil { - return - } - - result := proto.BsonD{} - err = bson.UnmarshalJSON(got, &result) - if err != nil { - t.Fatalf("cannot unmarshal json explain result: %s", err) + if err == nil { + result := proto.BsonD{} + err = bson.UnmarshalJSON(got, &result) + if err != nil { + t.Fatalf("cannot unmarshal json explain result: %s", err) + } } }) } From c8a5bfe5f37529e2735ccd53cc872525efd82483 Mon Sep 17 00:00:00 2001 From: Kamil Dziedzic Date: Thu, 31 Aug 2017 17:56:08 +0200 Subject: [PATCH 039/104] be more verbose with errors --- src/go/mongolib/explain/explain.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/go/mongolib/explain/explain.go b/src/go/mongolib/explain/explain.go index f38a3172..2aeba176 100644 --- a/src/go/mongolib/explain/explain.go +++ b/src/go/mongolib/explain/explain.go @@ -1,6 +1,8 @@ package explain import ( + "fmt" + "github.com/percona/percona-toolkit/src/go/mongolib/proto" "github.com/percona/pmgo" "gopkg.in/mgo.v2/bson" @@ -22,7 +24,7 @@ func (e *explain) Explain(db string, query []byte) ([]byte, error) { err = bson.UnmarshalJSON(query, &eq) if err != nil { - return nil, err + return nil, fmt.Errorf("explain: unable to decode query %v: %s", query, err) } if db == "" { @@ -37,7 +39,7 @@ func (e *explain) Explain(db string, query []byte) ([]byte, error) { resultJson, err := bson.MarshalJSON(result) if err != nil { - return nil, err + return nil, fmt.Errorf("explain: unable to encode explain result of %v: %s", query, err) } return resultJson, nil From 6f57f094002dbf5d2360392f4e3b2b158592fb7a Mon Sep 17 00:00:00 2001 From: Kamil Dziedzic Date: Thu, 31 Aug 2017 18:04:05 +0200 Subject: [PATCH 040/104] properly convert query for error msg to string --- src/go/mongolib/explain/explain.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/go/mongolib/explain/explain.go b/src/go/mongolib/explain/explain.go index 2aeba176..abc576b9 100644 --- a/src/go/mongolib/explain/explain.go +++ b/src/go/mongolib/explain/explain.go @@ -24,7 +24,7 @@ func (e *explain) Explain(db string, query []byte) ([]byte, error) { err = bson.UnmarshalJSON(query, &eq) if err != nil { - return nil, fmt.Errorf("explain: unable to decode query %v: %s", query, err) + return nil, fmt.Errorf("explain: unable to decode query %s: %s", string(query), err) } if db == "" { @@ -39,7 +39,7 @@ func (e *explain) Explain(db string, query []byte) ([]byte, error) { resultJson, err := bson.MarshalJSON(result) if err != nil { - return nil, fmt.Errorf("explain: unable to encode explain result of %v: %s", query, err) + return nil, fmt.Errorf("explain: unable to encode explain result of %s: %s", string(query), err) } return resultJson, nil From 14f27e010eee227a15d75d9e09d4631d5f98ff4f Mon Sep 17 00:00:00 2001 From: Kamil Dziedzic Date: Thu, 31 Aug 2017 18:41:59 +0200 Subject: [PATCH 041/104] just to trigger build --- .travis.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6e16fcf2..4976eaf4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -41,9 +41,7 @@ script: - go test -timeout 1m $(glide nv) notifications: - email: - on_success: never - on_failure: never + email: false slack: on_success: change on_failure: change From 0d7ee3c86a3e4540b6a64f1e0ed2cd25c8bdf146 Mon Sep 17 00:00:00 2001 From: Kamil Dziedzic Date: Thu, 31 Aug 2017 18:50:01 +0200 Subject: [PATCH 042/104] trigger build --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4976eaf4..35206e01 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,10 +26,10 @@ install: # remove vendor dir and re-fetch it to check later if it's correct with `git diff --exit-code` - rm -rf vendor/ - glide install - -before_script: # check if vendor dir is correct - git diff --exit-code + +before_script: # run docker containers - docker-compose up -d # log versions From f3f66f928f746f99911995935e9b6644a6af3c7b Mon Sep 17 00:00:00 2001 From: Kamil Dziedzic Date: Thu, 31 Aug 2017 19:01:45 +0200 Subject: [PATCH 043/104] restore docker-compose.yml --- docker-compose.yml | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 docker-compose.yml diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..43d0673e --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,7 @@ +version: '3' +services: + mongo: + image: ${MONGODB_IMAGE:-percona/percona-server-mongodb:3.4} + ports: + - 127.0.0.1:27017:27017 + From 2b9c55744556279c6151383abab028e4ba6b6471 Mon Sep 17 00:00:00 2001 From: Kamil Dziedzic Date: Thu, 31 Aug 2017 19:09:36 +0200 Subject: [PATCH 044/104] drop testify --- src/go/mongolib/explain/explain_test.go | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/go/mongolib/explain/explain_test.go b/src/go/mongolib/explain/explain_test.go index 0d8e7cf7..7d9df704 100644 --- a/src/go/mongolib/explain/explain_test.go +++ b/src/go/mongolib/explain/explain_test.go @@ -1,17 +1,15 @@ package explain import ( + "fmt" "io/ioutil" "log" "os" "testing" - "fmt" - "github.com/percona/percona-toolkit/src/go/lib/tutil" "github.com/percona/percona-toolkit/src/go/mongolib/proto" "github.com/percona/pmgo" - "github.com/stretchr/testify/require" "gopkg.in/mgo.v2/bson" ) @@ -122,15 +120,18 @@ func TestExplain(t *testing.T) { } dialer := pmgo.NewDialer() - dialInfo, err := pmgo.ParseURL("127.0.0.1:27017") - require.NoError(t, err) + dialInfo, err := pmgo.ParseURL("") + if err != nil { + t.Fatalf("cannot parse URL: %s", err) + } session, err := dialer.DialWithInfo(dialInfo) - require.NoError(t, err) + if err != nil { + t.Fatalf("cannot dial to MongoDB: %s", err) + } defer session.Close() ex := New(session) - for _, file := range files { t.Run(file.Name(), func(t *testing.T) { eq := proto.ExampleQuery{} From 803ad9860c580250728c11d2b4667509f2044d6e Mon Sep 17 00:00:00 2001 From: Kamil Dziedzic Date: Thu, 31 Aug 2017 19:55:41 +0200 Subject: [PATCH 045/104] we need at least one document in test db --- .travis.yml | 2 ++ docker-compose.yml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 35206e01..07066a51 100644 --- a/.travis.yml +++ b/.travis.yml @@ -36,6 +36,8 @@ before_script: - docker --version - docker-compose --version - docker-compose exec mongo mongo --version + # we need at least one document in test db + - mongo --eval 'db.init.insert({})' script: - go test -timeout 1m $(glide nv) diff --git a/docker-compose.yml b/docker-compose.yml index 43d0673e..1877e2c9 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,5 +3,5 @@ services: mongo: image: ${MONGODB_IMAGE:-percona/percona-server-mongodb:3.4} ports: - - 127.0.0.1:27017:27017 + - 27017 From 54bc4aa67c4c663a71323061edf4a49d14944229 Mon Sep 17 00:00:00 2001 From: Kamil Dziedzic Date: Thu, 31 Aug 2017 20:00:49 +0200 Subject: [PATCH 046/104] Properly bind port. --- docker-compose.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 1877e2c9..1f1901da 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,5 +3,4 @@ services: mongo: image: ${MONGODB_IMAGE:-percona/percona-server-mongodb:3.4} ports: - - 27017 - + - "27017:27017" From fcbb140088f415cb8054f64aadb7a45e755677b5 Mon Sep 17 00:00:00 2001 From: Kamil Dziedzic Date: Thu, 31 Aug 2017 20:25:21 +0200 Subject: [PATCH 047/104] older versions of MongoDB return different error for trying to explain insert --- glide.lock | 18 +++++----- glide.yaml | 1 + src/go/mongolib/explain/explain_test.go | 44 +++++++++++++++++++++++++ 3 files changed, 55 insertions(+), 8 deletions(-) diff --git a/glide.lock b/glide.lock index 61f7f8c4..529dd93f 100644 --- a/glide.lock +++ b/glide.lock @@ -1,5 +1,5 @@ -hash: 203838fffdc6549caf8a6a439df2e2df48fe15449dedc702b632f2b06f66ae72 -updated: 2017-08-18T11:00:19.296275985+02:00 +hash: 6d30e29455f610ee47cc43bafd9390da029e7fe8cf5dafe510e423e9c0e897a0 +updated: 2017-08-31T20:21:56.600678687+02:00 imports: - name: github.com/bradfitz/slice version: d9036e2120b5ddfa53f3ebccd618c4af275f47da @@ -8,7 +8,7 @@ imports: subpackages: - oleutil - name: github.com/golang/mock - version: 1df903b45f27b0b3685fa78609b653a54c7eead8 + version: 18f6dd13ccdd227b8ebc546ca95cd62a02f3970c subpackages: - gomock - name: github.com/hashicorp/go-version @@ -17,6 +17,8 @@ imports: version: bf9dde6d0d2c004a008c27aaee91170c786f6db8 - name: github.com/kr/pretty version: cfb55aafdaf3ec08f0db22699ab822c50091b1c4 +- name: github.com/Masterminds/semver + version: 517734cc7d6470c0d07130e40fd40bdeb9bcd3fd - name: github.com/montanaflynn/stats version: 4a163274fa4ca0b524ccee24757d7bec79475aca - name: github.com/pborman/getopt @@ -24,7 +26,7 @@ imports: subpackages: - v2 - name: github.com/percona/pmgo - version: 9566dc76df319b856a12f24a3b6852a0c6463eff + version: 43e01b1a87fe20317bf4329d4ab3cb8d58d50886 subpackages: - pmgomock - name: github.com/pkg/errors @@ -32,7 +34,7 @@ imports: - name: github.com/satori/go.uuid version: 5bf94b69c6b68ee1b541973bb8e1144db23a194b - name: github.com/shirou/gopsutil - version: 1c211f0807a3436707409fa313599dd8c7a48664 + version: a452de7c734a0fa0f16d2e5725b0fa5934d9fbec subpackages: - cpu - host @@ -43,7 +45,7 @@ imports: - name: github.com/shirou/w32 version: bb4de0191aa41b5507caa14b0650cdbddcd9280b - name: github.com/sirupsen/logrus - version: 68806b4b77355d6c8577a2c8bbc6d547a5272491 + version: 89742aefa4b206dcf400792f3bd35b542998eb3b - name: github.com/StackExchange/wmi version: ea383cf3ba6ec950874b8486cd72356d007c768f - name: go4.org @@ -51,7 +53,7 @@ imports: subpackages: - reflectutil - name: golang.org/x/crypto - version: b176d7def5d71bdd214203491f89843ed217f420 + version: 81e90905daefcd6fd217b62423c0908922eadb30 subpackages: - ssh/terminal - name: golang.org/x/net @@ -59,7 +61,7 @@ imports: subpackages: - context - name: golang.org/x/sys - version: 43e60d72a8e2bd92ee98319ba9a384a0e9837c08 + version: bb24a47a89eac6c1227fbcb2ae37a8b9ed323366 subpackages: - unix - windows diff --git a/glide.yaml b/glide.yaml index d63fe93c..54eb5ee6 100644 --- a/glide.yaml +++ b/glide.yaml @@ -16,6 +16,7 @@ import: - package: gopkg.in/mgo.v2 subpackages: - bson +- package: github.com/Masterminds/semver testImport: - package: github.com/golang/mock subpackages: diff --git a/src/go/mongolib/explain/explain_test.go b/src/go/mongolib/explain/explain_test.go index 7d9df704..94872856 100644 --- a/src/go/mongolib/explain/explain_test.go +++ b/src/go/mongolib/explain/explain_test.go @@ -5,8 +5,10 @@ import ( "io/ioutil" "log" "os" + "strings" "testing" + "github.com/Masterminds/semver" "github.com/percona/percona-toolkit/src/go/lib/tutil" "github.com/percona/percona-toolkit/src/go/mongolib/proto" "github.com/percona/pmgo" @@ -131,6 +133,26 @@ func TestExplain(t *testing.T) { } defer session.Close() + bi, err := session.BuildInfo() + if err != nil { + t.Fatalf("cannot get BuildInfo: %s", err) + } + + versions := []string{ + "2.6.12", + "3.0.15", + "3.2.16", + "3.4.7", + "3.5.11", + } + + // For versions < 3.4 trying to explain "insert" returns different error + if ok, _ := Constraint("< 3.4", bi.Version); ok { + for _, v := range versions { + expectError["insert_"+v] = "Only update and delete write ops can be explained" + } + } + ex := New(session) for _, file := range files { t.Run(file.Name(), func(t *testing.T) { @@ -160,3 +182,25 @@ func TestExplain(t *testing.T) { }) } } + +func Constraint(constraint, version string) (bool, error) { + // Drop everything after first dash. + // Version with dash is considered a pre-release + // but some MongoDB builds add additional information after dash + // even though it's not considered a pre-release but a release. + s := strings.SplitN(version, "-", 2) + version = s[0] + + // Create new version + v, err := semver.NewVersion(version) + if err != nil { + return false, err + } + + // Check if version matches constraint + constraints, err := semver.NewConstraint(constraint) + if err != nil { + return false, err + } + return constraints.Check(v), nil +} From 6866380a28d5978161437922af0143d9f5bf2752 Mon Sep 17 00:00:00 2001 From: Kamil Dziedzic Date: Thu, 31 Aug 2017 20:33:49 +0200 Subject: [PATCH 048/104] stop profiler before exiting test --- src/go/mongolib/profiler/profiler_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/go/mongolib/profiler/profiler_test.go b/src/go/mongolib/profiler/profiler_test.go index ee8e564b..4818aeb7 100644 --- a/src/go/mongolib/profiler/profiler_test.go +++ b/src/go/mongolib/profiler/profiler_test.go @@ -288,6 +288,8 @@ func TestCalcStats(t *testing.T) { prof := NewProfiler(iter, filters, nil, s) prof.Start() + defer prof.Stop() + select { case queries := <-prof.QueriesChan(): s := queries.CalcQueriesStats(1) From 878589018967b63ed053d6428d5e7e8a94524cd9 Mon Sep 17 00:00:00 2001 From: Kamil Dziedzic Date: Thu, 31 Aug 2017 20:35:17 +0200 Subject: [PATCH 049/104] Let's try with older versions --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 07066a51..a523e8e3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,6 +11,8 @@ services: env: matrix: + - MONGODB_IMAGE=mongo:2.6 + - MONGODB_IMAGE=mongo:3.0 - MONGODB_IMAGE=mongo:3.2 - MONGODB_IMAGE=mongo:3.4 - MONGODB_IMAGE=percona/percona-server-mongodb:3.2 From 9af30c010ea9c3febad5369026f7e57a7e632fc3 Mon Sep 17 00:00:00 2001 From: Kamil Dziedzic Date: Thu, 31 Aug 2017 21:05:00 +0200 Subject: [PATCH 050/104] For MongoDB < 3.0 explain is not supported --- .travis.yml | 1 + src/go/mongolib/explain/explain_test.go | 131 ++++++++---------------- 2 files changed, 45 insertions(+), 87 deletions(-) diff --git a/.travis.yml b/.travis.yml index a523e8e3..cb7e89d9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,6 +15,7 @@ env: - MONGODB_IMAGE=mongo:3.0 - MONGODB_IMAGE=mongo:3.2 - MONGODB_IMAGE=mongo:3.4 + - MONGODB_IMAGE=percona/percona-server-mongodb:3.0 - MONGODB_IMAGE=percona/percona-server-mongodb:3.2 - MONGODB_IMAGE=percona/percona-server-mongodb:3.4 diff --git a/src/go/mongolib/explain/explain_test.go b/src/go/mongolib/explain/explain_test.go index 94872856..522b657e 100644 --- a/src/go/mongolib/explain/explain_test.go +++ b/src/go/mongolib/explain/explain_test.go @@ -37,90 +37,6 @@ func TestMain(m *testing.M) { func TestExplain(t *testing.T) { t.Parallel() - dir := vars.RootPath + samples + "/doc/out/" - files, err := ioutil.ReadDir(dir) - if err != nil { - t.Fatalf("cannot list samples: %s", err) - } - - expectError := map[string]string{ - "aggregate_2.6.12": "Cannot explain cmd: aggregate", - "aggregate_3.0.15": "Cannot explain cmd: aggregate", - "aggregate_3.2.16": "Cannot explain cmd: aggregate", - "aggregate_3.4.7": "Cannot explain cmd: aggregate", - "aggregate_3.5.11": "Cannot explain cmd: aggregate", - "count_2.6.12": "", - "count_3.0.15": "", - "count_3.2.16": "", - "count_3.4.7": "", - "count_3.5.11": "", - "count_with_query_2.6.12": "", - "count_with_query_3.0.15": "", - "count_with_query_3.2.16": "", - "count_with_query_3.4.7": "", - "count_with_query_3.5.11": "", - "delete_2.6.12": "", - "delete_3.0.15": "", - "delete_3.2.16": "", - "delete_3.4.7": "", - "delete_3.5.11": "", - "delete_all_2.6.12": "", - "delete_all_3.0.15": "", - "delete_all_3.2.16": "", - "delete_all_3.4.7": "", - "delete_all_3.5.11": "", - "distinct_2.6.12": "", - "distinct_3.0.15": "", - "distinct_3.2.16": "", - "distinct_3.4.7": "", - "distinct_3.5.11": "", - "find_empty_2.6.12": "", - "find_empty_3.0.15": "", - "find_empty_3.2.16": "", - "find_empty_3.4.7": "", - "find_empty_3.5.11": "", - "find_2.6.12": "", - "find_3.0.15": "", - "find_3.2.16": "", - "find_3.4.7": "", - "find_3.5.11": "", - "find_andrii_2.6.12": "", - "find_andrii_3.0.15": "", - "find_andrii_3.2.16": "", - "find_andrii_3.4.7": "", - "find_andrii_3.5.11": "", - "findandmodify_2.6.12": "", - "findandmodify_3.0.15": "", - "findandmodify_3.2.16": "", - "findandmodify_3.4.7": "", - "findandmodify_3.5.11": "", - "geonear_2.6.12": "Cannot explain cmd: geoNear", - "geonear_3.0.15": "Cannot explain cmd: geoNear", - "geonear_3.2.16": "Cannot explain cmd: geoNear", - "geonear_3.4.7": "Cannot explain cmd: geoNear", - "geonear_3.5.11": "Cannot explain cmd: geoNear", - "group_2.6.12": "", - "group_3.0.15": "", - "group_3.2.16": "", - "group_3.4.7": "", - "group_3.5.11": "", - "insert_2.6.12": "Cannot explain cmd: insert", - "insert_3.0.15": "Cannot explain cmd: insert", - "insert_3.2.16": "Cannot explain cmd: insert", - "insert_3.4.7": "Cannot explain cmd: insert", - "insert_3.5.11": "Cannot explain cmd: insert", - "mapreduce_2.6.12": "Cannot explain cmd: mapReduce", - "mapreduce_3.0.15": "Cannot explain cmd: mapReduce", - "mapreduce_3.2.16": "Cannot explain cmd: mapReduce", - "mapreduce_3.4.7": "Cannot explain cmd: mapReduce", - "mapreduce_3.5.11": "Cannot explain cmd: mapReduce", - "update_2.6.12": "", - "update_3.0.15": "", - "update_3.2.16": "", - "update_3.4.7": "", - "update_3.5.11": "", - } - dialer := pmgo.NewDialer() dialInfo, err := pmgo.ParseURL("") if err != nil { @@ -133,6 +49,12 @@ func TestExplain(t *testing.T) { } defer session.Close() + dir := vars.RootPath + samples + "/doc/out/" + files, err := ioutil.ReadDir(dir) + if err != nil { + t.Fatalf("cannot list samples: %s", err) + } + bi, err := session.BuildInfo() if err != nil { t.Fatalf("cannot get BuildInfo: %s", err) @@ -146,10 +68,45 @@ func TestExplain(t *testing.T) { "3.5.11", } - // For versions < 3.4 trying to explain "insert" returns different error - if ok, _ := Constraint("< 3.4", bi.Version); ok { + samples := map[string]string{ + "aggregate": "Cannot explain cmd: aggregate", + "count": "", + "count_with_query": "", + "delete": "", + "delete_all": "", + "distinct": "", + "find_empty": "", + "find": "", + "find_andrii": "", + "findandmodify": "", + "geonear": "Cannot explain cmd: geoNear", + "group": "", + "insert": "Cannot explain cmd: insert", + "mapreduce": "Cannot explain cmd: mapReduce", + "update": "", + } + + expectError := map[string]string{} + + // For versions < 3.0 explain is not supported + if ok, _ := Constraint("< 3.0", bi.Version); ok { for _, v := range versions { - expectError["insert_"+v] = "Only update and delete write ops can be explained" + for sample := range samples { + expectError[sample+"_"+v] = "no such cmd: explain" + } + } + } else { + for _, v := range versions { + for sample, msg := range samples { + expectError[sample+"_"+v] = msg + } + } + + // For versions >= 3.0, < 3.4 trying to explain "insert" returns different error + if ok, _ := Constraint(">= 3.0, < 3.4", bi.Version); ok { + for _, v := range versions { + expectError["insert_"+v] = "Only update and delete write ops can be explained" + } } } From 31eb04fc885c9ab5f1c220e73cc9e3f7e8906259 Mon Sep 17 00:00:00 2001 From: Kamil Dziedzic Date: Thu, 31 Aug 2017 21:09:11 +0200 Subject: [PATCH 051/104] explain for distinct and findAndModify was introduced in Mongo 3.4 --- src/go/mongolib/explain/explain_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/go/mongolib/explain/explain_test.go b/src/go/mongolib/explain/explain_test.go index 522b657e..13e6fb78 100644 --- a/src/go/mongolib/explain/explain_test.go +++ b/src/go/mongolib/explain/explain_test.go @@ -108,6 +108,14 @@ func TestExplain(t *testing.T) { expectError["insert_"+v] = "Only update and delete write ops can be explained" } } + + // Explaining `distinct` and `findAndModify` was introduced in MongoDB 3.2 + if ok, _ := Constraint(">= 3.0, < 3.2", bi.Version); ok { + for _, v := range versions { + expectError["distinct_"+v] = "Cannot explain cmd: distinct" + expectError["findandmodify_"+v] = "Cannot explain cmd: findAndModify" + } + } } ex := New(session) From 7d4be1b34820a46a409fa695556d45ecb1fced5e Mon Sep 17 00:00:00 2001 From: Kamil Dziedzic Date: Thu, 31 Aug 2017 22:12:01 +0200 Subject: [PATCH 052/104] drop $db; fix group --- src/go/mongolib/proto/system.profile.go | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/src/go/mongolib/proto/system.profile.go b/src/go/mongolib/proto/system.profile.go index df4013d5..2c95bfed 100644 --- a/src/go/mongolib/proto/system.profile.go +++ b/src/go/mongolib/proto/system.profile.go @@ -138,6 +138,18 @@ func (self ExampleQuery) ExplainCmd() bson.D { {"find", coll}, {"filter", filter}, } + } else { + for i := range cmd { + // drop $db param as it is not supported in MongoDB 3.0 + if cmd[i].Name == "$db" { + if len(cmd) - 1 == i { + cmd = cmd[:i] + } else { + cmd = append(cmd[:i], cmd[i+1:]...) + } + break + } + } } case "update": s := strings.SplitN(self.Ns, ".", 2) @@ -192,8 +204,8 @@ func (self ExampleQuery) ExplainCmd() bson.D { break } - if v, ok := cmd[0].Value.(BsonD); ok { - for i := range v { + if group, ok := cmd[0].Value.(BsonD); ok { + for i := range group { // for MongoDB <= 3.2 // "$reduce" : function () {} // It is then Unmarshaled as empty value, so in essence not working @@ -206,9 +218,9 @@ func (self ExampleQuery) ExplainCmd() bson.D { // // The $reduce function shouldn't affect explain execution plan (e.g. what indexes are picked) // so we ignore it for now until we find better way to handle this issue - if v[i].Name == "$reduce" { - v[i].Value = "" - cmd[0].Value = v + if group[i].Name == "$reduce" { + group[i].Value = "{}" + cmd[0].Value = group break } } From b5bbedab58ecf3cc9ea27235689ca4122c3aa0a5 Mon Sep 17 00:00:00 2001 From: Kamil Dziedzic Date: Thu, 31 Aug 2017 22:25:26 +0200 Subject: [PATCH 053/104] add travis for go part --- .travis.yml | 54 ++++++++++++++++++++++++++++++++++++++++++++++ docker-compose.yml | 6 ++++++ 2 files changed, 60 insertions(+) create mode 100644 .travis.yml create mode 100644 docker-compose.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..cb7e89d9 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,54 @@ +dist: trusty +sudo: required + +language: go + +go: + - 1.8.x + +services: + - docker + +env: + matrix: + - MONGODB_IMAGE=mongo:2.6 + - MONGODB_IMAGE=mongo:3.0 + - MONGODB_IMAGE=mongo:3.2 + - MONGODB_IMAGE=mongo:3.4 + - MONGODB_IMAGE=percona/percona-server-mongodb:3.0 + - MONGODB_IMAGE=percona/percona-server-mongodb:3.2 + - MONGODB_IMAGE=percona/percona-server-mongodb:3.4 + +matrix: + include: + - go: tip + env: + +install: + - go get -u github.com/Masterminds/glide + # remove vendor dir and re-fetch it to check later if it's correct with `git diff --exit-code` + - rm -rf vendor/ + - glide install + # check if vendor dir is correct + - git diff --exit-code + +before_script: + # run docker containers + - docker-compose up -d + # log versions + - docker --version + - docker-compose --version + - docker-compose exec mongo mongo --version + # we need at least one document in test db + - mongo --eval 'db.init.insert({})' + +script: + - go test -timeout 1m $(glide nv) + +notifications: + email: false + slack: + on_success: change + on_failure: change + rooms: + secure: E5ZRDFtbVmQCo2SLCdvecpaRIZPC35+0srkyA9jVq0BJpvVY6pm4OQceAugy/g5cd6c2reTN9oNSjNF62BKpoJxPuIuu8/JdlvUMMxgxnGkCC1R6hAddbapvIe4EXlybLPGy8kAG7OkYVpGHtWwN3U5MfF7/tGeqL2y8C3fCDZA= diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..1f1901da --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,6 @@ +version: '3' +services: + mongo: + image: ${MONGODB_IMAGE:-percona/percona-server-mongodb:3.4} + ports: + - "27017:27017" From b2818cc80095695e7af94c5dc1ee6e24dd10029f Mon Sep 17 00:00:00 2001 From: Kamil Dziedzic Date: Fri, 1 Sep 2017 10:39:21 +0200 Subject: [PATCH 054/104] change test to be more predictable --- src/go/mongolib/proto/main_test.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/go/mongolib/proto/main_test.go b/src/go/mongolib/proto/main_test.go index c6d96154..60179394 100644 --- a/src/go/mongolib/proto/main_test.go +++ b/src/go/mongolib/proto/main_test.go @@ -6,8 +6,6 @@ import ( "os" "testing" - "github.com/percona/percona-toolkit/src/go/mongolib/proto" - mgo "gopkg.in/mgo.v2" "gopkg.in/mgo.v2/bson" "gopkg.in/mgo.v2/dbtest" @@ -37,11 +35,10 @@ func TestMain(m *testing.M) { } func ExampleServerStatus() { - ss := proto.ServerStatus{} - if err := session.DB("admin").Run(bson.D{{"serverStatus", 1}, {"recordStats", 1}}, &ss); err != nil { + ss := map[string]interface{}{} + if err := session.DB("admin").Run(bson.D{{"ping", 1}}, &ss); err != nil { panic(err) } fmt.Printf("%+v", ss) - // Output: - + // Output: map[ok:1] } From edd1b97ea3950d3c849a5787c9252cacb62289c5 Mon Sep 17 00:00:00 2001 From: Kamil Dziedzic Date: Fri, 1 Sep 2017 11:52:00 +0200 Subject: [PATCH 055/104] keep queries in order to make it more predictible --- src/go/mongolib/stats/stats.go | 32 ++++++++++++++++++++++++++--- src/go/mongolib/stats/stats_test.go | 9 ++++---- 2 files changed, 34 insertions(+), 7 deletions(-) diff --git a/src/go/mongolib/stats/stats.go b/src/go/mongolib/stats/stats.go index e7c38b84..9123d79e 100644 --- a/src/go/mongolib/stats/stats.go +++ b/src/go/mongolib/stats/stats.go @@ -4,6 +4,7 @@ import ( "crypto/md5" "encoding/json" "fmt" + "sort" "sync" "time" @@ -110,9 +111,15 @@ func (s *Stats) Queries() Queries { s.RLock() defer s.RUnlock() + keys := GroupKeys{} + for key := range s.queryInfoAndCounters { + keys = append(keys, key) + } + sort.Sort(keys) + queries := []QueryInfoAndCounters{} - for _, v := range s.queryInfoAndCounters { - queries = append(queries, *v) + for _, key := range keys { + queries = append(queries, *s.queryInfoAndCounters[key]) } return queries } @@ -184,10 +191,29 @@ func (a Times) Len() int { return len(a) } func (a Times) Swap(i, j int) { a[i], a[j] = a[j], a[i] } func (a Times) Less(i, j int) bool { return a[i].Before(a[j]) } +type GroupKeys []GroupKey + +func (a GroupKeys) Len() int { return len(a) } +func (a GroupKeys) Swap(i, j int) { a[i], a[j] = a[j], a[i] } +func (a GroupKeys) Less(i, j int) bool { return a[i].String() < a[j].String() } + type GroupKey struct { Operation string - Fingerprint string Namespace string + Fingerprint string +} + +func (g GroupKey) String() string { + v := struct { + Operation string + Fingerprint string + Namespace string + }{ + g.Operation, + g.Fingerprint, + g.Namespace, + } + return fmt.Sprintf("%s", v) } type totalCounters struct { diff --git a/src/go/mongolib/stats/stats_test.go b/src/go/mongolib/stats/stats_test.go index d1e4b3f8..9291c7f9 100644 --- a/src/go/mongolib/stats/stats_test.go +++ b/src/go/mongolib/stats/stats_test.go @@ -1,15 +1,16 @@ package stats import ( - "github.com/golang/mock/gomock" - "github.com/percona/percona-toolkit/src/go/lib/tutil" - "github.com/percona/percona-toolkit/src/go/mongolib/fingerprinter" - "github.com/percona/percona-toolkit/src/go/mongolib/proto" "log" "os" "reflect" "testing" "time" + + "github.com/golang/mock/gomock" + "github.com/percona/percona-toolkit/src/go/lib/tutil" + "github.com/percona/percona-toolkit/src/go/mongolib/fingerprinter" + "github.com/percona/percona-toolkit/src/go/mongolib/proto" ) const ( From f84372a5730dd579aeb7684510196c6a8a05ae09 Mon Sep 17 00:00:00 2001 From: Kamil Dziedzic Date: Fri, 1 Sep 2017 11:56:29 +0200 Subject: [PATCH 056/104] add go 1.9 --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index cb7e89d9..062ba31b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,6 +21,8 @@ env: matrix: include: + - go: 1.9.x + env: - go: tip env: From 74b34dc74dbeb2cfc1f2eb010f9702f5e14aa0ee Mon Sep 17 00:00:00 2001 From: Kamil Dziedzic Date: Fri, 1 Sep 2017 11:58:35 +0200 Subject: [PATCH 057/104] strip vendor dir --- .travis.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 062ba31b..6c558257 100644 --- a/.travis.yml +++ b/.travis.yml @@ -28,11 +28,7 @@ matrix: install: - go get -u github.com/Masterminds/glide - # remove vendor dir and re-fetch it to check later if it's correct with `git diff --exit-code` - - rm -rf vendor/ - - glide install - # check if vendor dir is correct - - git diff --exit-code + - glide install -v before_script: # run docker containers From 691c03460055911aed47b810492212d074e35887 Mon Sep 17 00:00:00 2001 From: Kamil Dziedzic Date: Fri, 1 Sep 2017 12:00:44 +0200 Subject: [PATCH 058/104] s/ServerStatus/Ping/ --- src/go/mongolib/proto/main_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/go/mongolib/proto/main_test.go b/src/go/mongolib/proto/main_test.go index 60179394..45a00723 100644 --- a/src/go/mongolib/proto/main_test.go +++ b/src/go/mongolib/proto/main_test.go @@ -34,7 +34,7 @@ func TestMain(m *testing.M) { os.Exit(retCode) } -func ExampleServerStatus() { +func ExamplePing() { ss := map[string]interface{}{} if err := session.DB("admin").Run(bson.D{{"ping", 1}}, &ss); err != nil { panic(err) From a5b5fb88fa0ed01d0ad04f733e81d4bbd18d4d7e Mon Sep 17 00:00:00 2001 From: Kamil Dziedzic Date: Mon, 4 Sep 2017 14:10:01 +0200 Subject: [PATCH 059/104] fix .travis.yml after merge --- .travis.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index b7413f48..6c558257 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,14 +29,6 @@ matrix: install: - go get -u github.com/Masterminds/glide - glide install -v - # run docker containers - - docker-compose up -d - # log versions - - docker --version - - docker-compose --version - - docker-compose exec mongo mongo --version - # we need at least one document in test db - - mongo --eval 'db.init.insert({})' before_script: # run docker containers From f0396cc8d6ea93361d1399072e326e6ce33fa5cd Mon Sep 17 00:00:00 2001 From: Kamil Dziedzic Date: Mon, 4 Sep 2017 15:52:58 +0200 Subject: [PATCH 060/104] fix after merge --- src/go/mongolib/stats/stats.go | 1 - 1 file changed, 1 deletion(-) diff --git a/src/go/mongolib/stats/stats.go b/src/go/mongolib/stats/stats.go index 3fa27218..43e3de70 100644 --- a/src/go/mongolib/stats/stats.go +++ b/src/go/mongolib/stats/stats.go @@ -2,7 +2,6 @@ package stats import ( "crypto/md5" - "encoding/json" "fmt" "sort" "sync" From 6fa8dc5161d85f5ce1e559cde682074420e4bea3 Mon Sep 17 00:00:00 2001 From: Kamil Dziedzic Date: Mon, 4 Sep 2017 15:53:37 +0200 Subject: [PATCH 061/104] fmt --- src/go/mongolib/proto/system.profile.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/go/mongolib/proto/system.profile.go b/src/go/mongolib/proto/system.profile.go index 2c95bfed..41d00f90 100644 --- a/src/go/mongolib/proto/system.profile.go +++ b/src/go/mongolib/proto/system.profile.go @@ -142,7 +142,7 @@ func (self ExampleQuery) ExplainCmd() bson.D { for i := range cmd { // drop $db param as it is not supported in MongoDB 3.0 if cmd[i].Name == "$db" { - if len(cmd) - 1 == i { + if len(cmd)-1 == i { cmd = cmd[:i] } else { cmd = append(cmd[:i], cmd[i+1:]...) From 738f9809f8653c2079c9f88a3d373eb01c3c3fd4 Mon Sep 17 00:00:00 2001 From: Carlos Salguero Date: Mon, 4 Sep 2017 12:03:36 -0300 Subject: [PATCH 062/104] PT-167 Still need to add tests Description here --- bin/pt-kill | 30 +++++++++++- bin/pt-query-digest | 14 +++++- lib/Processlist.pm | 17 ++++++- t/pt-kill/pt_167.t | 93 ++++++++++++++++++++++++++++++++++++ t/pt-kill/samples/pt_167.sql | 0 5 files changed, 150 insertions(+), 4 deletions(-) create mode 100644 t/pt-kill/pt_167.t create mode 100644 t/pt-kill/samples/pt_167.sql diff --git a/bin/pt-kill b/bin/pt-kill index 6d1fb47e..67e13b3b 100755 --- a/bin/pt-kill +++ b/bin/pt-kill @@ -3297,6 +3297,17 @@ sub new { foreach my $arg ( qw(MasterSlave) ) { die "I need a $arg argument" unless $args{$arg}; } + my $kill_busy_commands = {}; + if ($args{kill_busy_commands}) { + for my $command (split /,/,$args{kill_busy_commands}) { + $command =~ s/^\s+|\s+$//g; + $kill_busy_commands->{$command} = 1; + } + } else { + $kill_busy_commands->{Query} = 1; + } + $args{kill_busy_commands} = $kill_busy_commands; + my $self = { %args, polls => 0, @@ -3523,7 +3534,7 @@ sub find { next QUERY; } - if ( $find_spec{busy_time} && ($query->{Command} || '') eq 'Query' ) { + if ( $find_spec{busy_time} && exists($self->{kill_busy_commands}->{$query->{Command} || ''}) ) { next QUERY unless defined($query->{Time}); if ( $query->{Time} < $find_spec{busy_time} ) { PTDEBUG && _d("Query isn't running long enough"); @@ -6788,7 +6799,7 @@ sub main { DSNParser => $dp, Quoter => "Quoter", ); - my $pl = new Processlist(MasterSlave => $ms); + my $pl = new Processlist(MasterSlave => $ms, kill_busy_commands => $o->get('kill-busy-commands')); my $qr = new QueryRewriter(); my $cxn; @@ -8198,6 +8209,21 @@ that pt-kill matched and killed a query. See also L<"--wait-before-kill"> and L<"--wait-after-kill">. +=item --kill-busy-commands + +default: Query + +group: Actions + +Comma sepatated list of commands that will be watched/killed if they ran for +more than L<"--busy-time"> seconds. Default: C + +By default, L<"--busy-time"> kills only C commands but in some cases, it +is needed to make L<"--busy-time"> to watch and kill other commands. For example, +a prepared statement execution command is C instead of C. In this +case, specifying C<--kill-busy-commands=Query,Execute> will also kill the prepared +stamente execution. + =item --kill-query group: Actions diff --git a/bin/pt-query-digest b/bin/pt-query-digest index b90f3426..f01767a5 100755 --- a/bin/pt-query-digest +++ b/bin/pt-query-digest @@ -3251,6 +3251,17 @@ sub new { foreach my $arg ( qw(MasterSlave) ) { die "I need a $arg argument" unless $args{$arg}; } + my $kill_busy_commands = {}; + if ($args{kill_busy_commands}) { + for my $command (split /,/,$args{kill_busy_commands}) { + $command =~ s/^\s+|\s+$//g; + $kill_busy_commands->{$command} = 1; + } + } else { + $kill_busy_commands->{Query} = 1; + } + $args{kill_busy_commands} = $kill_busy_commands; + my $self = { %args, polls => 0, @@ -3465,6 +3476,7 @@ sub find { my $ms = $self->{MasterSlave}; my @matches; + $self->{_reasons_for_matching} = undef; QUERY: foreach my $query ( @$proclist ) { PTDEBUG && _d('Checking query', Dumper($query)); @@ -3476,7 +3488,7 @@ sub find { next QUERY; } - if ( $find_spec{busy_time} && ($query->{Command} || '') eq 'Query' ) { + if ( $find_spec{busy_time} && exists($self->{kill_busy_commands}->{$query->{Command} || ''}) ) { next QUERY unless defined($query->{Time}); if ( $query->{Time} < $find_spec{busy_time} ) { PTDEBUG && _d("Query isn't running long enough"); diff --git a/lib/Processlist.pm b/lib/Processlist.pm index 0546b1ce..a953a1c6 100644 --- a/lib/Processlist.pm +++ b/lib/Processlist.pm @@ -69,6 +69,19 @@ sub new { foreach my $arg ( qw(MasterSlave) ) { die "I need a $arg argument" unless $args{$arg}; } + # Convert the list of kill commands (Query, Execute, etc) to a hashref for + # faster check later + my $kill_busy_commands = {}; + if ($args{kill_busy_commands}) { + for my $command (split /,/,$args{kill_busy_commands}) { + $command =~ s/^\s+|\s+$//g; + $kill_busy_commands->{$command} = 1; + } + } else { + $kill_busy_commands->{Query} = 1; + } + $args{kill_busy_commands} = $kill_busy_commands; + my $self = { %args, polls => 0, @@ -471,6 +484,7 @@ sub find { my $ms = $self->{MasterSlave}; my @matches; + $self->{_reasons_for_matching} = undef; QUERY: foreach my $query ( @$proclist ) { PTDEBUG && _d('Checking query', Dumper($query)); @@ -484,7 +498,8 @@ sub find { } # Match special busy_time. - if ( $find_spec{busy_time} && ($query->{Command} || '') eq 'Query' ) { + #if ( $find_spec{busy_time} && ($query->{Command} || '') eq 'Query' ) { + if ( $find_spec{busy_time} && exists($self->{kill_busy_commands}->{$query->{Command} || ''}) ) { next QUERY unless defined($query->{Time}); if ( $query->{Time} < $find_spec{busy_time} ) { PTDEBUG && _d("Query isn't running long enough"); diff --git a/t/pt-kill/pt_167.t b/t/pt-kill/pt_167.t new file mode 100644 index 00000000..494c7283 --- /dev/null +++ b/t/pt-kill/pt_167.t @@ -0,0 +1,93 @@ +#!/usr/bin/env perl + +BEGIN { + die "The PERCONA_TOOLKIT_BRANCH environment variable is not set.\n" + unless $ENV{PERCONA_TOOLKIT_BRANCH} && -d $ENV{PERCONA_TOOLKIT_BRANCH}; + unshift @INC, "$ENV{PERCONA_TOOLKIT_BRANCH}/lib"; +}; + +use strict; +use warnings FATAL => 'all'; +use English qw(-no_match_vars); +use Time::HiRes qw(sleep); +use Test::More; + +use PerconaTest; +use Sandbox; +require "$trunk/bin/pt-kill"; + +use Data::Dumper; +$Data::Dumper::Indent = 1; +$Data::Dumper::Sortkeys = 1; +$Data::Dumper::Quotekeys = 0; + +my $dp = new DSNParser(opts=>$dsn_opts); +my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp); +my $dbh = $sb->get_dbh_for('master'); + +if ( !$dbh ) { + plan skip_all => 'Cannot connect to sandbox master'; +} + +my $output; +my $dsn = $sb->dsn_for('master'); +my $cnf = '/tmp/12345/my.sandbox.cnf'; + +# ############################################################################# +# Test that --kill-query only kills the query, not the connection. +# ############################################################################# + +# Here's how this works. This cmd is going to try 2 queries on the same +# connection: sleep5 and sleep3. --kill-query will kill sleep5 causing +# sleep3 to start using the same connection id (pid). +system("/tmp/12345/use -e 'select sleep(5); select sleep(2)' >/dev/null&"); +sleep 0.5; + +SKIP: { + + skip "TODO"; + my $iterations=99; + my $query = 'select benchmark(?, md5("when will it end?"))'; + my $ps = $dbh->prepare($query); + $ps->execute($iterations); + my $rows = $dbh->selectall_hashref('show processlist', 'id'); + my $pid = 0; # reuse, reset + map { $pid = $_->{id} } + grep { $_->{info} && $_->{info} =~ m/select sleep\(15\)/ } + values %$rows; + + ok( + $pid, + 'Got proc id of sleeping query' + ); + + $output = output( + sub { pt_kill::main('-F', $cnf, qw(--busy-time 4s --print --match-info "^(select|SELECT)")), }, + ); + like( + $output, + qr/KILL QUERY $pid /, + '--kill-query' + ); + + sleep 1; + $rows = $dbh->selectall_hashref('show processlist', 'id'); + my $con_alive = grep { $_->{id} eq $pid } values %$rows; + ok( + $con_alive, + 'Killed query, not connection' + ); + + is( + ($rows->{$pid}->{info} || ''), + 'select sleep(3)', + 'Connection is still alive' + ); +} + +# ############################################################################# +# Done. +# ############################################################################# +$sb->wipe_clean($dbh); +ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox"); +done_testing; diff --git a/t/pt-kill/samples/pt_167.sql b/t/pt-kill/samples/pt_167.sql new file mode 100644 index 00000000..e69de29b From 185076f8ec67a2c0083f389f0274c07c82949c90 Mon Sep 17 00:00:00 2001 From: Kamil Dziedzic Date: Wed, 6 Sep 2017 11:22:45 +0200 Subject: [PATCH 063/104] basic support for EXPLAIN and EVAL --- src/go/mongolib/explain/explain_test.go | 2 ++ .../mongolib/fingerprinter/fingerprinter.go | 23 ++++++++++++++++--- .../fingerprinter/fingerprinter_test.go | 10 ++++++++ src/go/mongolib/proto/system.profile.go | 16 +++++++++++++ src/go/tests/doc/script/profile/eval.js | 1 + src/go/tests/doc/script/profile/explain.js | 3 +++ 6 files changed, 52 insertions(+), 3 deletions(-) create mode 100644 src/go/tests/doc/script/profile/eval.js create mode 100644 src/go/tests/doc/script/profile/explain.js diff --git a/src/go/mongolib/explain/explain_test.go b/src/go/mongolib/explain/explain_test.go index 13e6fb78..c2826ab2 100644 --- a/src/go/mongolib/explain/explain_test.go +++ b/src/go/mongolib/explain/explain_test.go @@ -84,6 +84,8 @@ func TestExplain(t *testing.T) { "insert": "Cannot explain cmd: insert", "mapreduce": "Cannot explain cmd: mapReduce", "update": "", + "explain": "Cannot explain cmd: explain", + "eval": "Cannot explain cmd: eval", } expectError := map[string]string{} diff --git a/src/go/mongolib/fingerprinter/fingerprinter.go b/src/go/mongolib/fingerprinter/fingerprinter.go index 621a091b..7369e5fc 100644 --- a/src/go/mongolib/fingerprinter/fingerprinter.go +++ b/src/go/mongolib/fingerprinter/fingerprinter.go @@ -81,20 +81,31 @@ func (f *Fingerprint) Fingerprint(doc proto.SystemProfile) (string, error) { switch doc.Op { case "remove", "update": op = doc.Op - ns := strings.Split(doc.Ns, ".") + ns := strings.SplitN(doc.Ns, ".", 2) if len(ns) == 2 { collection = ns[1] } case "insert": op = doc.Op - ns := strings.Split(doc.Ns, ".") + ns := strings.SplitN(doc.Ns, ".", 2) if len(ns) == 2 { collection = ns[1] } retKeys = []string{} case "query": + // EXPLAIN MongoDB 2.6: + // "query" : { + // "query" : { + // + // }, + // "$explain" : true + // }, + if _, ok := doc.Query.Map()["$explain"]; ok { + op = "explain" + break + } op = "find" - ns := strings.Split(doc.Ns, ".") + ns := strings.SplitN(doc.Ns, ".", 2) if len(ns) == 2 { collection = ns[1] } @@ -140,6 +151,12 @@ func (f *Fingerprint) Fingerprint(doc proto.SystemProfile) (string, error) { } case "geoNear": retKeys = []string{} + case "explain": + retKeys = []string{} + case "$eval": + op = "eval" + collection = "" + retKeys = []string{} } } diff --git a/src/go/mongolib/fingerprinter/fingerprinter_test.go b/src/go/mongolib/fingerprinter/fingerprinter_test.go index cbdb1d96..8225452d 100644 --- a/src/go/mongolib/fingerprinter/fingerprinter_test.go +++ b/src/go/mongolib/fingerprinter/fingerprinter_test.go @@ -113,6 +113,16 @@ func TestFingerprints(t *testing.T) { "distinct_3.2.16": "DISTINCT coll a,b", "distinct_3.4.7": "DISTINCT coll a,b", "distinct_3.5.11": "DISTINCT coll a,b", + "explain_2.6.12": "EXPLAIN", + "explain_3.0.15": "EXPLAIN", + "explain_3.2.16": "EXPLAIN", + "explain_3.4.7": "EXPLAIN", + "explain_3.5.11": "EXPLAIN", + "eval_2.6.12": "EVAL", + "eval_3.0.15": "EVAL", + "eval_3.2.16": "EVAL", + "eval_3.4.7": "EVAL", + "eval_3.5.11": "EVAL", "find_empty_2.6.12": "FIND coll", "find_empty_3.0.15": "FIND coll", "find_empty_3.2.16": "FIND coll", diff --git a/src/go/mongolib/proto/system.profile.go b/src/go/mongolib/proto/system.profile.go index 41d00f90..295c3a55 100644 --- a/src/go/mongolib/proto/system.profile.go +++ b/src/go/mongolib/proto/system.profile.go @@ -120,6 +120,22 @@ func (self ExampleQuery) ExplainCmd() bson.D { if cmd.Len() == 0 { cmd = self.Query } + + // MongoDB 2.6: + // + // "query" : { + // "query" : { + // + // }, + // "$explain" : true + // }, + if _, ok := cmd.Map()["$explain"]; ok { + cmd = BsonD{ + {"explain", ""}, + } + break + } + if cmd.Len() == 0 || cmd[0].Name != "find" { var filter interface{} if cmd.Len() > 0 && cmd[0].Name == "query" { diff --git a/src/go/tests/doc/script/profile/eval.js b/src/go/tests/doc/script/profile/eval.js new file mode 100644 index 00000000..fb3c07d9 --- /dev/null +++ b/src/go/tests/doc/script/profile/eval.js @@ -0,0 +1 @@ +db.eval("db") diff --git a/src/go/tests/doc/script/profile/explain.js b/src/go/tests/doc/script/profile/explain.js new file mode 100644 index 00000000..fcf81bce --- /dev/null +++ b/src/go/tests/doc/script/profile/explain.js @@ -0,0 +1,3 @@ +var coll = db.coll + +coll.find().explain() From 59add049611d766b4b639a084f3720e72d6c7772 Mon Sep 17 00:00:00 2001 From: Kamil Dziedzic Date: Wed, 6 Sep 2017 13:45:23 +0200 Subject: [PATCH 064/104] missing test data --- src/go/tests/doc/out/eval_2.6.12 | 30 +++++++++++++++++ src/go/tests/doc/out/eval_3.0.15 | 42 ++++++++++++++++++++++++ src/go/tests/doc/out/eval_3.2.16 | 38 ++++++++++++++++++++++ src/go/tests/doc/out/eval_3.4.7 | 34 ++++++++++++++++++++ src/go/tests/doc/out/eval_3.5.11 | 35 ++++++++++++++++++++ src/go/tests/doc/out/explain_2.6.12 | 46 ++++++++++++++++++++++++++ src/go/tests/doc/out/explain_3.0.15 | 50 +++++++++++++++++++++++++++++ src/go/tests/doc/out/explain_3.2.16 | 43 +++++++++++++++++++++++++ src/go/tests/doc/out/explain_3.4.7 | 39 ++++++++++++++++++++++ src/go/tests/doc/out/explain_3.5.11 | 40 +++++++++++++++++++++++ 10 files changed, 397 insertions(+) create mode 100644 src/go/tests/doc/out/eval_2.6.12 create mode 100644 src/go/tests/doc/out/eval_3.0.15 create mode 100644 src/go/tests/doc/out/eval_3.2.16 create mode 100644 src/go/tests/doc/out/eval_3.4.7 create mode 100644 src/go/tests/doc/out/eval_3.5.11 create mode 100644 src/go/tests/doc/out/explain_2.6.12 create mode 100644 src/go/tests/doc/out/explain_3.0.15 create mode 100644 src/go/tests/doc/out/explain_3.2.16 create mode 100644 src/go/tests/doc/out/explain_3.4.7 create mode 100644 src/go/tests/doc/out/explain_3.5.11 diff --git a/src/go/tests/doc/out/eval_2.6.12 b/src/go/tests/doc/out/eval_2.6.12 new file mode 100644 index 00000000..132d8f0c --- /dev/null +++ b/src/go/tests/doc/out/eval_2.6.12 @@ -0,0 +1,30 @@ +{ + "op" : "command", + "ns" : "test.$cmd", + "command" : { + "$eval" : "db" + }, + "keyUpdates" : 0, + "numYield" : 0, + "lockStats" : { + "timeLockedMicros" : { + "R" : NumberLong(0), + "W" : NumberLong(64994) + }, + "timeAcquiringMicros" : { + "R" : NumberLong(0), + "W" : NumberLong(5), + "r" : NumberLong(0), + "w" : NumberLong(7) + } + }, + "responseLength" : 108, + "millis" : 65, + "execStats" : { + + }, + "ts" : ISODate("2017-09-05T19:39:24.522Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/eval_3.0.15 b/src/go/tests/doc/out/eval_3.0.15 new file mode 100644 index 00000000..ebfc7ce9 --- /dev/null +++ b/src/go/tests/doc/out/eval_3.0.15 @@ -0,0 +1,42 @@ +{ + "op" : "command", + "ns" : "test.$cmd", + "command" : { + "$eval" : "db" + }, + "keyUpdates" : 0, + "writeConflicts" : 0, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(3), + "W" : NumberLong(1) + } + }, + "MMAPV1Journal" : { + "acquireCount" : { + "w" : NumberLong(1) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "R" : NumberLong(1) + } + } + }, + "responseLength" : 108, + "millis" : 35, + "execStats" : { + + }, + "ts" : ISODate("2017-09-05T19:39:32.054Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/eval_3.2.16 b/src/go/tests/doc/out/eval_3.2.16 new file mode 100644 index 00000000..a977cb1f --- /dev/null +++ b/src/go/tests/doc/out/eval_3.2.16 @@ -0,0 +1,38 @@ +{ + "op" : "command", + "ns" : "test", + "command" : { + "$eval" : "db" + }, + "keyUpdates" : 0, + "writeConflicts" : 0, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(3), + "W" : NumberLong(1) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "r" : NumberLong(1) + } + } + }, + "responseLength" : 93, + "protocol" : "op_command", + "millis" : 88, + "execStats" : { + + }, + "ts" : ISODate("2017-09-05T19:39:41.581Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/eval_3.4.7 b/src/go/tests/doc/out/eval_3.4.7 new file mode 100644 index 00000000..9d2e9786 --- /dev/null +++ b/src/go/tests/doc/out/eval_3.4.7 @@ -0,0 +1,34 @@ +{ + "op" : "command", + "ns" : "test", + "command" : { + "$eval" : "db" + }, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(3), + "W" : NumberLong(1) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "r" : NumberLong(1) + } + } + }, + "responseLength" : 93, + "protocol" : "op_command", + "millis" : 91, + "ts" : ISODate("2017-09-05T19:39:48.888Z"), + "client" : "127.0.0.1", + "appName" : "MongoDB Shell", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/eval_3.5.11 b/src/go/tests/doc/out/eval_3.5.11 new file mode 100644 index 00000000..3cc988e0 --- /dev/null +++ b/src/go/tests/doc/out/eval_3.5.11 @@ -0,0 +1,35 @@ +{ + "op" : "command", + "ns" : "test", + "command" : { + "$eval" : "db", + "$db" : "test" + }, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(3), + "W" : NumberLong(1) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "r" : NumberLong(1) + } + } + }, + "responseLength" : 93, + "protocol" : "op_msg", + "millis" : 47, + "ts" : ISODate("2017-09-05T19:40:00.171Z"), + "client" : "127.0.0.1", + "appName" : "MongoDB Shell", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/explain_2.6.12 b/src/go/tests/doc/out/explain_2.6.12 new file mode 100644 index 00000000..0abbb9a0 --- /dev/null +++ b/src/go/tests/doc/out/explain_2.6.12 @@ -0,0 +1,46 @@ +{ + "op" : "query", + "ns" : "test.coll", + "query" : { + "query" : { + + }, + "$explain" : true + }, + "ntoreturn" : 0, + "ntoskip" : 0, + "nscanned" : 44, + "nscannedObjects" : 44, + "keyUpdates" : 0, + "numYield" : 0, + "lockStats" : { + "timeLockedMicros" : { + "r" : NumberLong(95), + "w" : NumberLong(0) + }, + "timeAcquiringMicros" : { + "r" : NumberLong(14), + "w" : NumberLong(6) + } + }, + "nreturned" : 1, + "responseLength" : 583, + "millis" : 0, + "execStats" : { + "type" : "COLLSCAN", + "works" : 46, + "yields" : 0, + "unyields" : 0, + "invalidates" : 0, + "advanced" : 44, + "needTime" : 1, + "needFetch" : 0, + "isEOF" : 1, + "docsTested" : 44, + "children" : [ ] + }, + "ts" : ISODate("2017-09-05T19:39:24.666Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/explain_3.0.15 b/src/go/tests/doc/out/explain_3.0.15 new file mode 100644 index 00000000..4c79d0e5 --- /dev/null +++ b/src/go/tests/doc/out/explain_3.0.15 @@ -0,0 +1,50 @@ +{ + "op" : "command", + "ns" : "test.$cmd", + "command" : { + "explain" : { + "find" : "coll", + "filter" : { + + }, + "options" : { + + } + }, + "verbosity" : "queryPlanner" + }, + "keyUpdates" : 0, + "writeConflicts" : 0, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(2) + } + }, + "MMAPV1Journal" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "R" : NumberLong(1) + } + } + }, + "responseLength" : 379, + "millis" : 0, + "execStats" : { + + }, + "ts" : ISODate("2017-09-05T19:39:32.210Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/explain_3.2.16 b/src/go/tests/doc/out/explain_3.2.16 new file mode 100644 index 00000000..aa91a9ae --- /dev/null +++ b/src/go/tests/doc/out/explain_3.2.16 @@ -0,0 +1,43 @@ +{ + "op" : "command", + "ns" : "test.coll", + "command" : { + "explain" : { + "find" : "coll", + "filter" : { + + } + }, + "verbosity" : "queryPlanner" + }, + "keyUpdates" : 0, + "writeConflicts" : 0, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(2) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "r" : NumberLong(1) + } + } + }, + "responseLength" : 364, + "protocol" : "op_command", + "millis" : 0, + "execStats" : { + + }, + "ts" : ISODate("2017-09-05T19:39:41.753Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/explain_3.4.7 b/src/go/tests/doc/out/explain_3.4.7 new file mode 100644 index 00000000..748d51be --- /dev/null +++ b/src/go/tests/doc/out/explain_3.4.7 @@ -0,0 +1,39 @@ +{ + "op" : "command", + "ns" : "test.coll", + "command" : { + "explain" : { + "find" : "coll", + "filter" : { + + } + }, + "verbosity" : "queryPlanner" + }, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(2) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "r" : NumberLong(1) + } + } + }, + "responseLength" : 328, + "protocol" : "op_command", + "millis" : 0, + "ts" : ISODate("2017-09-05T19:39:49.065Z"), + "client" : "127.0.0.1", + "appName" : "MongoDB Shell", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/explain_3.5.11 b/src/go/tests/doc/out/explain_3.5.11 new file mode 100644 index 00000000..7b23d107 --- /dev/null +++ b/src/go/tests/doc/out/explain_3.5.11 @@ -0,0 +1,40 @@ +{ + "op" : "command", + "ns" : "test.coll", + "command" : { + "explain" : { + "find" : "coll", + "filter" : { + + } + }, + "verbosity" : "queryPlanner", + "$db" : "test" + }, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(2) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "r" : NumberLong(1) + } + } + }, + "responseLength" : 329, + "protocol" : "op_msg", + "millis" : 0, + "ts" : ISODate("2017-09-05T19:40:00.433Z"), + "client" : "127.0.0.1", + "appName" : "MongoDB Shell", + "allUsers" : [ ], + "user" : "" +} From fec1a1f75883a20a96301fd4a2c9d7bb469447d7 Mon Sep 17 00:00:00 2001 From: Carlos Salguero Date: Wed, 6 Sep 2017 16:46:47 -0300 Subject: [PATCH 065/104] PT-167 pt-kill kills prepared statements w/o checking busy-time --- bin/pt-kill | 2 +- t/pt-kill/pt_167.t | 113 ++++++++++++++++++----------------- t/pt-kill/samples/pt_167.sql | 4 ++ 3 files changed, 64 insertions(+), 55 deletions(-) diff --git a/bin/pt-kill b/bin/pt-kill index 67e13b3b..11663760 100755 --- a/bin/pt-kill +++ b/bin/pt-kill @@ -47,7 +47,7 @@ BEGIN { { package Percona::Toolkit; -our $VERSION = '3.0.4'; +our $VERSION = '3.0.5'; use strict; use warnings FATAL => 'all'; diff --git a/t/pt-kill/pt_167.t b/t/pt-kill/pt_167.t index 494c7283..a133cd25 100644 --- a/t/pt-kill/pt_167.t +++ b/t/pt-kill/pt_167.t @@ -11,6 +11,7 @@ use warnings FATAL => 'all'; use English qw(-no_match_vars); use Time::HiRes qw(sleep); use Test::More; +use threads; use PerconaTest; use Sandbox; @@ -21,6 +22,13 @@ $Data::Dumper::Indent = 1; $Data::Dumper::Sortkeys = 1; $Data::Dumper::Quotekeys = 0; + +my $o = new OptionParser(description => 'Diskstats', + file => "$trunk/bin/pt-kill", +); +$o->get_specs("$trunk/bin/pt-table-checksum"); +$o->get_opts(); + my $dp = new DSNParser(opts=>$dsn_opts); my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp); my $dbh = $sb->get_dbh_for('master'); @@ -29,62 +37,59 @@ if ( !$dbh ) { plan skip_all => 'Cannot connect to sandbox master'; } -my $output; -my $dsn = $sb->dsn_for('master'); -my $cnf = '/tmp/12345/my.sandbox.cnf'; - -# ############################################################################# -# Test that --kill-query only kills the query, not the connection. -# ############################################################################# - -# Here's how this works. This cmd is going to try 2 queries on the same -# connection: sleep5 and sleep3. --kill-query will kill sleep5 causing -# sleep3 to start using the same connection id (pid). -system("/tmp/12345/use -e 'select sleep(5); select sleep(2)' >/dev/null&"); -sleep 0.5; - -SKIP: { - - skip "TODO"; - my $iterations=99; - my $query = 'select benchmark(?, md5("when will it end?"))'; - my $ps = $dbh->prepare($query); - $ps->execute($iterations); - my $rows = $dbh->selectall_hashref('show processlist', 'id'); - my $pid = 0; # reuse, reset - map { $pid = $_->{id} } - grep { $_->{info} && $_->{info} =~ m/select sleep\(15\)/ } - values %$rows; - - ok( - $pid, - 'Got proc id of sleeping query' - ); - - $output = output( - sub { pt_kill::main('-F', $cnf, qw(--busy-time 4s --print --match-info "^(select|SELECT)")), }, - ); - like( - $output, - qr/KILL QUERY $pid /, - '--kill-query' - ); - - sleep 1; - $rows = $dbh->selectall_hashref('show processlist', 'id'); - my $con_alive = grep { $_->{id} eq $pid } values %$rows; - ok( - $con_alive, - 'Killed query, not connection' - ); - - is( - ($rows->{$pid}->{info} || ''), - 'select sleep(3)', - 'Connection is still alive' - ); +$sb->load_file('master', "t/pt-kill/samples/pt_167.sql"); +my $ps = $dbh->prepare('INSERT INTO test.foo VALUES (?)'); +for (my $i=0; $i < 20000; $i++) { + $ps->execute($i); } +sub start_thread { + my ($dp, $o, $dsn, $sleep_time) = @_; + + diag("Thread started"); + + my $cxn = new Cxn(DSNParser => $dp, OptionParser => $o, dsn => $dsn); + $cxn->connect(); + my $dbh = $cxn->dbh(); + my $sth = $dbh->prepare('SELECT COUNT(*) FROM (SELECT a.id AS a_id, b.id AS b_id FROM foo AS a, foo AS b) AS c'); + # Since this query is going to be killed, wrap the execution in an eval to prevent + # displaying the error message. + eval { + $sth->execute(); + }; +} + +my $dsn = "h=127.1,P=12345,u=msandbox,p=msandbox,D=test;mysql_server_prepare=1"; +my $thr = threads->create('start_thread', $dp, $o, $dp->parse($dsn), 1); +$thr->detach(); +threads->yield(); + +sleep(1); + +my $rows = $dbh->selectall_hashref('show processlist', 'id'); +my $pid = 0; # reuse, reset +map { $pid = $_->{id} } +grep { $_->{info} && $_->{info} =~ m/SELECT COUNT\(\*\) FROM \(SELECT a.id/ } +values %$rows; + +ok( + $pid, + "Got proc id of sleeping query: $pid" +); + +$dsn = $sb->dsn_for('master'); +my $output = output( + sub { pt_kill::main($dsn, "--kill-busy-commands","Query,Execute", qw(--run-time 3s --kill --busy-time 2s --print --match-info), "^(select|SELECT)"), }, + stderr => 1, +); + +like( + $output, + qr/KILL $pid \(Execute/, + '--kill-query' +) or diag($output); + + # ############################################################################# # Done. # ############################################################################# diff --git a/t/pt-kill/samples/pt_167.sql b/t/pt-kill/samples/pt_167.sql index e69de29b..0b15466e 100644 --- a/t/pt-kill/samples/pt_167.sql +++ b/t/pt-kill/samples/pt_167.sql @@ -0,0 +1,4 @@ +DROP DATABASE IF EXISTS test; +CREATE DATABASE test; + +create table test.foo (id integer); From 3928b1e47f9d2cea502f4884379b3ba664e92d7e Mon Sep 17 00:00:00 2001 From: MATSUU Takuto Date: Wed, 13 Sep 2017 18:01:47 +0900 Subject: [PATCH 066/104] fix a formula --- src/go/mongolib/stats/stats.go | 2 +- src/go/tests/profiler_docs_stats.want.json | 6 +++--- src/go/tests/profiler_docs_total_stats.want.json | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/go/mongolib/stats/stats.go b/src/go/mongolib/stats/stats.go index 9123d79e..2f84147e 100644 --- a/src/go/mongolib/stats/stats.go +++ b/src/go/mongolib/stats/stats.go @@ -281,7 +281,7 @@ func countersToStats(query QueryInfoAndCounters, uptime int64, tc totalCounters) queryStats.QueryTime.Pct = queryStats.QueryTime.Total * 100 / tc.QueryTime } if tc.Bytes > 0 { - queryStats.ResponseLength.Pct = queryStats.ResponseLength.Total / tc.Bytes + queryStats.ResponseLength.Pct = queryStats.ResponseLength.Total * 100 / tc.Bytes } if queryStats.Returned.Total > 0 { queryStats.Ratio = queryStats.Scanned.Total / queryStats.Returned.Total diff --git a/src/go/tests/profiler_docs_stats.want.json b/src/go/tests/profiler_docs_stats.want.json index fc203be0..3c0e01df 100644 --- a/src/go/tests/profiler_docs_stats.want.json +++ b/src/go/tests/profiler_docs_stats.want.json @@ -22,7 +22,7 @@ "Median": 0 }, "ResponseLength": { - "Pct": 0.9995949739087844, + "Pct": 99.95949739087844, "Total": 1061230, "Min": 1061230, "Max": 1061230, @@ -75,7 +75,7 @@ "Median": 7 }, "ResponseLength": { - "Pct": 0.00020251304560782172, + "Pct": 0.020251304560782172, "Total": 215, "Min": 215, "Max": 215, @@ -128,7 +128,7 @@ "Median": 0 }, "ResponseLength": { - "Pct": 0.00020251304560782172, + "Pct": 0.020251304560782172, "Total": 215, "Min": 215, "Max": 215, diff --git a/src/go/tests/profiler_docs_total_stats.want.json b/src/go/tests/profiler_docs_total_stats.want.json index 39bc4c5c..7bcdfeb0 100755 --- a/src/go/tests/profiler_docs_total_stats.want.json +++ b/src/go/tests/profiler_docs_total_stats.want.json @@ -21,7 +21,7 @@ "Median": 0 }, "ResponseLength": { - "Pct": 1, + "Pct": 100, "Total": 1061660, "Min": 215, "Max": 1061230, From 08cfe9bd94387f6d8cd4c0e373f092ad0995adfa Mon Sep 17 00:00:00 2001 From: MATSUU Takuto Date: Wed, 13 Sep 2017 18:05:28 +0900 Subject: [PATCH 067/104] set Rank parameter --- src/go/pt-mongodb-query-digest/main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/go/pt-mongodb-query-digest/main.go b/src/go/pt-mongodb-query-digest/main.go index ae0d174e..dc87f8cd 100644 --- a/src/go/pt-mongodb-query-digest/main.go +++ b/src/go/pt-mongodb-query-digest/main.go @@ -165,7 +165,8 @@ func main() { if opts.Limit > 0 && len(sortedQueryStats) > opts.Limit { sortedQueryStats = sortedQueryStats[:opts.Limit] } - for _, qs := range sortedQueryStats { + for i, qs := range sortedQueryStats { + qs.Rank = i + 1 t.Execute(os.Stdout, qs) } From 31d130cbdec2a41b9d9dea41f7ff178a16470957 Mon Sep 17 00:00:00 2001 From: MATSUU Takuto Date: Wed, 13 Sep 2017 18:10:12 +0900 Subject: [PATCH 068/104] set Count parameter for totalStats --- src/go/mongolib/stats/stats.go | 1 + src/go/tests/profiler_docs_total_stats.want.json | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/go/mongolib/stats/stats.go b/src/go/mongolib/stats/stats.go index 2f84147e..0534b029 100644 --- a/src/go/mongolib/stats/stats.go +++ b/src/go/mongolib/stats/stats.go @@ -293,6 +293,7 @@ func countersToStats(query QueryInfoAndCounters, uptime int64, tc totalCounters) func aggregateCounters(queries []QueryInfoAndCounters) QueryInfoAndCounters { qt := QueryInfoAndCounters{} for _, query := range queries { + qt.Count += query.Count qt.NScanned = append(qt.NScanned, query.NScanned...) qt.NReturned = append(qt.NReturned, query.NReturned...) qt.QueryTime = append(qt.QueryTime, query.QueryTime...) diff --git a/src/go/tests/profiler_docs_total_stats.want.json b/src/go/tests/profiler_docs_total_stats.want.json index 7bcdfeb0..3a06993d 100755 --- a/src/go/tests/profiler_docs_total_stats.want.json +++ b/src/go/tests/profiler_docs_total_stats.want.json @@ -6,7 +6,7 @@ "Fingerprint": "", "FirstSeen": "0001-01-01T00:00:00Z", "LastSeen": "0001-01-01T00:00:00Z", - "Count": 0, + "Count": 3, "QPS": 0, "Rank": 0, "Ratio": 134.33333333333334, From aec4ac03cbbcc49d9b8746e9903259979cfbb2b3 Mon Sep 17 00:00:00 2001 From: MATSUU Takuto Date: Wed, 13 Sep 2017 18:33:19 +0900 Subject: [PATCH 069/104] sort Ratio like Count Because Scanned.Max / Returned.Max is not meaningful data. --- src/go/pt-mongodb-query-digest/main.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/go/pt-mongodb-query-digest/main.go b/src/go/pt-mongodb-query-digest/main.go index dc87f8cd..2acd0cb0 100644 --- a/src/go/pt-mongodb-query-digest/main.go +++ b/src/go/pt-mongodb-query-digest/main.go @@ -427,15 +427,11 @@ func sortQueries(queries []stats.QueryStats, orderby []string) []stats.QueryStat case "ratio": f = func(c1, c2 *stats.QueryStats) bool { - ratio1 := c1.Scanned.Max / c1.Returned.Max - ratio2 := c2.Scanned.Max / c2.Returned.Max - return ratio1 < ratio2 + return c1.Ratio < c2.Ratio } case "-ratio": f = func(c1, c2 *stats.QueryStats) bool { - ratio1 := c1.Scanned.Max / c1.Returned.Max - ratio2 := c2.Scanned.Max / c2.Returned.Max - return ratio1 > ratio2 + return c1.Ratio > c2.Ratio } // From 8ce461a7c1931558f44f574694ad56ad257141c6 Mon Sep 17 00:00:00 2001 From: MATSUU Takuto Date: Wed, 13 Sep 2017 18:36:07 +0900 Subject: [PATCH 070/104] support versions less than 3.2.0 docsExamined is renamed from nscannedObjects in 3.2.0. --- src/go/mongolib/proto/system.profile.go | 2 ++ src/go/mongolib/stats/stats.go | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/go/mongolib/proto/system.profile.go b/src/go/mongolib/proto/system.profile.go index 3bb4494d..fb45b1f0 100644 --- a/src/go/mongolib/proto/system.profile.go +++ b/src/go/mongolib/proto/system.profile.go @@ -2,11 +2,13 @@ package proto import "time" +// docsExamined is renamed from nscannedObjects in 3.2.0 type SystemProfile struct { AllUsers []interface{} `bson:"allUsers"` Client string `bson:"client"` CursorExhausted bool `bson:"cursorExhausted"` DocsExamined int `bson:"docsExamined"` + NscannedObjects int `bson:"nscannedObjects"` ExecStats struct { Advanced int `bson:"advanced"` ExecutionTimeMillisEstimate int `bson:"executionTimeMillisEstimate"` diff --git a/src/go/mongolib/stats/stats.go b/src/go/mongolib/stats/stats.go index 0534b029..408377b2 100644 --- a/src/go/mongolib/stats/stats.go +++ b/src/go/mongolib/stats/stats.go @@ -91,7 +91,12 @@ func (s *Stats) Add(doc proto.SystemProfile) error { s.setQueryInfoAndCounters(key, qiac) } qiac.Count++ - qiac.NScanned = append(qiac.NScanned, float64(doc.DocsExamined)) + // docsExamined is renamed from nscannedObjects in 3.2.0. + if doc.NscannedObjects > 0 { + qiac.NScanned = append(qiac.NScanned, float64(doc.NscannedObjects)) + } else { + qiac.NScanned = append(qiac.NScanned, float64(doc.DocsExamined)) + } qiac.NReturned = append(qiac.NReturned, float64(doc.Nreturned)) qiac.QueryTime = append(qiac.QueryTime, float64(doc.Millis)) qiac.ResponseLength = append(qiac.ResponseLength, float64(doc.ResponseLength)) From c18fdc8a01867422a9d63a440cfc0880d8dd2c0f Mon Sep 17 00:00:00 2001 From: MATSUU Takuto Date: Wed, 13 Sep 2017 23:05:51 +0900 Subject: [PATCH 071/104] fix test --- src/go/tests/profiler_docs_total_stats.want.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/go/tests/profiler_docs_total_stats.want.json b/src/go/tests/profiler_docs_total_stats.want.json index 3a06993d..6b074890 100755 --- a/src/go/tests/profiler_docs_total_stats.want.json +++ b/src/go/tests/profiler_docs_total_stats.want.json @@ -7,7 +7,7 @@ "FirstSeen": "0001-01-01T00:00:00Z", "LastSeen": "0001-01-01T00:00:00Z", "Count": 3, - "QPS": 0, + "QPS": 3, "Rank": 0, "Ratio": 134.33333333333334, "QueryTime": { From 0ef4590c2e1c6b247297e54b2eaf02fb1a135068 Mon Sep 17 00:00:00 2001 From: Kamil Dziedzic Date: Thu, 14 Sep 2017 16:23:13 +0200 Subject: [PATCH 072/104] PMM-1429: test metrics for different operations and MongoDB versions --- src/go/lib/tutil/util.go | 2 +- src/go/mongolib/stats/stats_test.go | 96 ++ src/go/tests/expect/stats_all/sum.json | 909 ++++++++++++++++++ .../expect/stats_single/aggregate_2.6.12 | 27 + .../expect/stats_single/aggregate_3.0.15 | 27 + .../expect/stats_single/aggregate_3.2.16 | 27 + .../tests/expect/stats_single/aggregate_3.4.7 | 27 + .../expect/stats_single/aggregate_3.5.11 | 27 + src/go/tests/expect/stats_single/count_2.6.12 | 27 + src/go/tests/expect/stats_single/count_3.0.15 | 27 + src/go/tests/expect/stats_single/count_3.2.16 | 27 + src/go/tests/expect/stats_single/count_3.4.7 | 27 + src/go/tests/expect/stats_single/count_3.5.11 | 27 + .../stats_single/count_with_query_2.6.12 | 27 + .../stats_single/count_with_query_3.0.15 | 27 + .../stats_single/count_with_query_3.2.16 | 27 + .../stats_single/count_with_query_3.4.7 | 27 + .../stats_single/count_with_query_3.5.11 | 27 + .../tests/expect/stats_single/delete_2.6.12 | 27 + .../tests/expect/stats_single/delete_3.0.15 | 27 + .../tests/expect/stats_single/delete_3.2.16 | 27 + src/go/tests/expect/stats_single/delete_3.4.7 | 27 + .../tests/expect/stats_single/delete_3.5.11 | 27 + .../expect/stats_single/delete_all_2.6.12 | 27 + .../expect/stats_single/delete_all_3.0.15 | 27 + .../expect/stats_single/delete_all_3.2.16 | 27 + .../expect/stats_single/delete_all_3.4.7 | 27 + .../expect/stats_single/delete_all_3.5.11 | 27 + .../tests/expect/stats_single/distinct_2.6.12 | 27 + .../tests/expect/stats_single/distinct_3.0.15 | 27 + .../tests/expect/stats_single/distinct_3.2.16 | 27 + .../tests/expect/stats_single/distinct_3.4.7 | 27 + .../tests/expect/stats_single/distinct_3.5.11 | 27 + src/go/tests/expect/stats_single/eval_2.6.12 | 27 + src/go/tests/expect/stats_single/eval_3.0.15 | 27 + src/go/tests/expect/stats_single/eval_3.2.16 | 27 + src/go/tests/expect/stats_single/eval_3.4.7 | 27 + src/go/tests/expect/stats_single/eval_3.5.11 | 27 + .../tests/expect/stats_single/explain_2.6.12 | 27 + .../tests/expect/stats_single/explain_3.0.15 | 27 + .../tests/expect/stats_single/explain_3.2.16 | 27 + .../tests/expect/stats_single/explain_3.4.7 | 27 + .../tests/expect/stats_single/explain_3.5.11 | 27 + src/go/tests/expect/stats_single/find_2.6.12 | 27 + src/go/tests/expect/stats_single/find_3.0.15 | 27 + src/go/tests/expect/stats_single/find_3.2.16 | 27 + src/go/tests/expect/stats_single/find_3.4.7 | 27 + src/go/tests/expect/stats_single/find_3.5.11 | 27 + .../expect/stats_single/find_andrii_2.6.12 | 27 + .../expect/stats_single/find_andrii_3.0.15 | 27 + .../expect/stats_single/find_andrii_3.2.16 | 27 + .../expect/stats_single/find_andrii_3.4.7 | 27 + .../expect/stats_single/find_andrii_3.5.11 | 27 + .../expect/stats_single/find_empty_2.6.12 | 27 + .../expect/stats_single/find_empty_3.0.15 | 27 + .../expect/stats_single/find_empty_3.2.16 | 27 + .../expect/stats_single/find_empty_3.4.7 | 27 + .../expect/stats_single/find_empty_3.5.11 | 27 + .../expect/stats_single/findandmodify_2.6.12 | 27 + .../expect/stats_single/findandmodify_3.0.15 | 27 + .../expect/stats_single/findandmodify_3.2.16 | 27 + .../expect/stats_single/findandmodify_3.4.7 | 27 + .../expect/stats_single/findandmodify_3.5.11 | 27 + .../tests/expect/stats_single/geonear_2.6.12 | 27 + .../tests/expect/stats_single/geonear_3.0.15 | 27 + .../tests/expect/stats_single/geonear_3.2.16 | 27 + .../tests/expect/stats_single/geonear_3.4.7 | 27 + .../tests/expect/stats_single/geonear_3.5.11 | 27 + src/go/tests/expect/stats_single/group_2.6.12 | 27 + src/go/tests/expect/stats_single/group_3.0.15 | 27 + src/go/tests/expect/stats_single/group_3.2.16 | 27 + src/go/tests/expect/stats_single/group_3.4.7 | 27 + src/go/tests/expect/stats_single/group_3.5.11 | 27 + .../tests/expect/stats_single/insert_2.6.12 | 27 + .../tests/expect/stats_single/insert_3.0.15 | 27 + .../tests/expect/stats_single/insert_3.2.16 | 27 + src/go/tests/expect/stats_single/insert_3.4.7 | 27 + .../tests/expect/stats_single/insert_3.5.11 | 27 + .../expect/stats_single/mapreduce_2.6.12 | 27 + .../expect/stats_single/mapreduce_3.0.15 | 27 + .../expect/stats_single/mapreduce_3.2.16 | 27 + .../tests/expect/stats_single/mapreduce_3.4.7 | 27 + .../expect/stats_single/mapreduce_3.5.11 | 27 + .../tests/expect/stats_single/update_2.6.12 | 27 + .../tests/expect/stats_single/update_3.0.15 | 27 + .../tests/expect/stats_single/update_3.2.16 | 27 + src/go/tests/expect/stats_single/update_3.4.7 | 27 + .../tests/expect/stats_single/update_3.5.11 | 27 + 88 files changed, 3301 insertions(+), 1 deletion(-) create mode 100755 src/go/tests/expect/stats_all/sum.json create mode 100755 src/go/tests/expect/stats_single/aggregate_2.6.12 create mode 100755 src/go/tests/expect/stats_single/aggregate_3.0.15 create mode 100755 src/go/tests/expect/stats_single/aggregate_3.2.16 create mode 100755 src/go/tests/expect/stats_single/aggregate_3.4.7 create mode 100755 src/go/tests/expect/stats_single/aggregate_3.5.11 create mode 100755 src/go/tests/expect/stats_single/count_2.6.12 create mode 100755 src/go/tests/expect/stats_single/count_3.0.15 create mode 100755 src/go/tests/expect/stats_single/count_3.2.16 create mode 100755 src/go/tests/expect/stats_single/count_3.4.7 create mode 100755 src/go/tests/expect/stats_single/count_3.5.11 create mode 100755 src/go/tests/expect/stats_single/count_with_query_2.6.12 create mode 100755 src/go/tests/expect/stats_single/count_with_query_3.0.15 create mode 100755 src/go/tests/expect/stats_single/count_with_query_3.2.16 create mode 100755 src/go/tests/expect/stats_single/count_with_query_3.4.7 create mode 100755 src/go/tests/expect/stats_single/count_with_query_3.5.11 create mode 100755 src/go/tests/expect/stats_single/delete_2.6.12 create mode 100755 src/go/tests/expect/stats_single/delete_3.0.15 create mode 100755 src/go/tests/expect/stats_single/delete_3.2.16 create mode 100755 src/go/tests/expect/stats_single/delete_3.4.7 create mode 100755 src/go/tests/expect/stats_single/delete_3.5.11 create mode 100755 src/go/tests/expect/stats_single/delete_all_2.6.12 create mode 100755 src/go/tests/expect/stats_single/delete_all_3.0.15 create mode 100755 src/go/tests/expect/stats_single/delete_all_3.2.16 create mode 100755 src/go/tests/expect/stats_single/delete_all_3.4.7 create mode 100755 src/go/tests/expect/stats_single/delete_all_3.5.11 create mode 100755 src/go/tests/expect/stats_single/distinct_2.6.12 create mode 100755 src/go/tests/expect/stats_single/distinct_3.0.15 create mode 100755 src/go/tests/expect/stats_single/distinct_3.2.16 create mode 100755 src/go/tests/expect/stats_single/distinct_3.4.7 create mode 100755 src/go/tests/expect/stats_single/distinct_3.5.11 create mode 100755 src/go/tests/expect/stats_single/eval_2.6.12 create mode 100755 src/go/tests/expect/stats_single/eval_3.0.15 create mode 100755 src/go/tests/expect/stats_single/eval_3.2.16 create mode 100755 src/go/tests/expect/stats_single/eval_3.4.7 create mode 100755 src/go/tests/expect/stats_single/eval_3.5.11 create mode 100755 src/go/tests/expect/stats_single/explain_2.6.12 create mode 100755 src/go/tests/expect/stats_single/explain_3.0.15 create mode 100755 src/go/tests/expect/stats_single/explain_3.2.16 create mode 100755 src/go/tests/expect/stats_single/explain_3.4.7 create mode 100755 src/go/tests/expect/stats_single/explain_3.5.11 create mode 100755 src/go/tests/expect/stats_single/find_2.6.12 create mode 100755 src/go/tests/expect/stats_single/find_3.0.15 create mode 100755 src/go/tests/expect/stats_single/find_3.2.16 create mode 100755 src/go/tests/expect/stats_single/find_3.4.7 create mode 100755 src/go/tests/expect/stats_single/find_3.5.11 create mode 100755 src/go/tests/expect/stats_single/find_andrii_2.6.12 create mode 100755 src/go/tests/expect/stats_single/find_andrii_3.0.15 create mode 100755 src/go/tests/expect/stats_single/find_andrii_3.2.16 create mode 100755 src/go/tests/expect/stats_single/find_andrii_3.4.7 create mode 100755 src/go/tests/expect/stats_single/find_andrii_3.5.11 create mode 100755 src/go/tests/expect/stats_single/find_empty_2.6.12 create mode 100755 src/go/tests/expect/stats_single/find_empty_3.0.15 create mode 100755 src/go/tests/expect/stats_single/find_empty_3.2.16 create mode 100755 src/go/tests/expect/stats_single/find_empty_3.4.7 create mode 100755 src/go/tests/expect/stats_single/find_empty_3.5.11 create mode 100755 src/go/tests/expect/stats_single/findandmodify_2.6.12 create mode 100755 src/go/tests/expect/stats_single/findandmodify_3.0.15 create mode 100755 src/go/tests/expect/stats_single/findandmodify_3.2.16 create mode 100755 src/go/tests/expect/stats_single/findandmodify_3.4.7 create mode 100755 src/go/tests/expect/stats_single/findandmodify_3.5.11 create mode 100755 src/go/tests/expect/stats_single/geonear_2.6.12 create mode 100755 src/go/tests/expect/stats_single/geonear_3.0.15 create mode 100755 src/go/tests/expect/stats_single/geonear_3.2.16 create mode 100755 src/go/tests/expect/stats_single/geonear_3.4.7 create mode 100755 src/go/tests/expect/stats_single/geonear_3.5.11 create mode 100755 src/go/tests/expect/stats_single/group_2.6.12 create mode 100755 src/go/tests/expect/stats_single/group_3.0.15 create mode 100755 src/go/tests/expect/stats_single/group_3.2.16 create mode 100755 src/go/tests/expect/stats_single/group_3.4.7 create mode 100755 src/go/tests/expect/stats_single/group_3.5.11 create mode 100755 src/go/tests/expect/stats_single/insert_2.6.12 create mode 100755 src/go/tests/expect/stats_single/insert_3.0.15 create mode 100755 src/go/tests/expect/stats_single/insert_3.2.16 create mode 100755 src/go/tests/expect/stats_single/insert_3.4.7 create mode 100755 src/go/tests/expect/stats_single/insert_3.5.11 create mode 100755 src/go/tests/expect/stats_single/mapreduce_2.6.12 create mode 100755 src/go/tests/expect/stats_single/mapreduce_3.0.15 create mode 100755 src/go/tests/expect/stats_single/mapreduce_3.2.16 create mode 100755 src/go/tests/expect/stats_single/mapreduce_3.4.7 create mode 100755 src/go/tests/expect/stats_single/mapreduce_3.5.11 create mode 100755 src/go/tests/expect/stats_single/update_2.6.12 create mode 100755 src/go/tests/expect/stats_single/update_3.0.15 create mode 100755 src/go/tests/expect/stats_single/update_3.2.16 create mode 100755 src/go/tests/expect/stats_single/update_3.4.7 create mode 100755 src/go/tests/expect/stats_single/update_3.5.11 diff --git a/src/go/lib/tutil/util.go b/src/go/lib/tutil/util.go index 5cbf9cad..aa2b8ef9 100644 --- a/src/go/lib/tutil/util.go +++ b/src/go/lib/tutil/util.go @@ -86,7 +86,7 @@ func WriteJson(filename string, data interface{}) error { if err != nil { return err } - err = ioutil.WriteFile(filename, buf, 777) + err = ioutil.WriteFile(filename, buf, 0777) if err != nil { return err } diff --git a/src/go/mongolib/stats/stats_test.go b/src/go/mongolib/stats/stats_test.go index 88f9eefc..68f01c7f 100644 --- a/src/go/mongolib/stats/stats_test.go +++ b/src/go/mongolib/stats/stats_test.go @@ -6,6 +6,8 @@ import ( "reflect" "testing" "time" + "io/ioutil" + "fmt" "github.com/golang/mock/gomock" "github.com/percona/percona-toolkit/src/go/lib/tutil" @@ -165,3 +167,97 @@ func TestStats(t *testing.T) { t.Errorf("Error \nGot:%#v\nWant: %#v\n", got, want) } } + +func TestStatsSingle(t *testing.T) { + t.Parallel() + + dirExpect := vars.RootPath + samples + "/expect/stats_single/" + + dir := vars.RootPath + samples + "/doc/out/" + files, err := ioutil.ReadDir(dir) + if err != nil { + t.Fatalf("cannot list samples: %s", err) + } + + fp := fingerprinter.NewFingerprinter(fingerprinter.DEFAULT_KEY_FILTERS) + + for _, file := range files { + f := file.Name() + t.Run(f, func(t *testing.T) { + t.Parallel() + + doc := proto.SystemProfile{} + err = tutil.LoadBson(dir+f, &doc) + if err != nil { + t.Fatalf("cannot load sample %s: %s", dir+f, err) + } + s := New(fp) + + err = s.Add(doc) + if err != nil { + t.Errorf("Error processing doc: %s\n", err.Error()) + } + got := s.Queries() + expect := Queries{} + if tutil.ShouldUpdateSamples() { + err := tutil.WriteJson(dirExpect+f, got) + if err != nil { + fmt.Printf("cannot update samples: %s", err.Error()) + } + } + err = tutil.LoadJson(dirExpect+f, &expect) + if err != nil { + t.Fatalf("cannot load expected data %s: %s", dirExpect+f, err) + } + if !reflect.DeepEqual(got, expect) { + t.Errorf("s.Queries() = %s, want %s", got, expect) + } + }) + } + +} + +func TestStatsAll(t *testing.T) { + t.Parallel() + + f := vars.RootPath + samples + "/expect/stats_all/sum.json" + + dir := vars.RootPath + samples + "/doc/out/" + files, err := ioutil.ReadDir(dir) + if err != nil { + t.Fatalf("cannot list samples: %s", err) + } + + fp := fingerprinter.NewFingerprinter(fingerprinter.DEFAULT_KEY_FILTERS) + s := New(fp) + + for _, file := range files { + doc := proto.SystemProfile{} + err = tutil.LoadBson(dir+file.Name(), &doc) + if err != nil { + t.Fatalf("cannot load sample %s: %s", dir+file.Name(), err) + } + + err = s.Add(doc) + if err != nil { + t.Errorf("Error processing doc: %s\n", err.Error()) + } + } + + got := s.Queries() + expect := Queries{} + if tutil.ShouldUpdateSamples() { + err := tutil.WriteJson(f, got) + if err != nil { + fmt.Printf("cannot update samples: %s", err.Error()) + } + } + err = tutil.LoadJson(f, &expect) + if err != nil { + t.Fatalf("cannot load expected data %s: %s", f, err) + } + if !reflect.DeepEqual(got, expect) { + t.Errorf("s.Queries() = %s, want %s", got, expect) + } +} + diff --git a/src/go/tests/expect/stats_all/sum.json b/src/go/tests/expect/stats_all/sum.json new file mode 100755 index 00000000..3280a0d1 --- /dev/null +++ b/src/go/tests/expect/stats_all/sum.json @@ -0,0 +1,909 @@ +[ + { + "ID": "59899eb380b4e48c345fb6f997d06bfa", + "Namespace": "test.$cmd", + "Operation": "command", + "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"aggregate\":\"coll\",\"pipeline\":[{\"$match\":{\"a\":{\"$gte\":2}}}],\"cursor\":{}}}\n", + "Fingerprint": "AGGREGATE coll a", + "FirstSeen": "2017-08-20T15:39:14.658Z", + "LastSeen": "2017-08-20T15:39:20.858Z", + "TableScan": false, + "Count": 2, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0, + 0 + ], + "NScanned": [ + 0, + 0 + ], + "QueryTime": [ + 0, + 2 + ], + "ResponseLength": [ + 385, + 385 + ] + }, + { + "ID": "020d9f1058f3bf08e3b1afb1ef883d44", + "Namespace": "test.$cmd", + "Operation": "command", + "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"count\":\"coll\",\"query\":{},\"fields\":{}}}\n", + "Fingerprint": "COUNT coll", + "FirstSeen": "2017-08-20T15:39:14.823Z", + "LastSeen": "2017-08-20T15:39:20.982Z", + "TableScan": false, + "Count": 2, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0, + 0 + ], + "NScanned": [ + 0, + 0 + ], + "QueryTime": [ + 0, + 0 + ], + "ResponseLength": [ + 48, + 44 + ] + }, + { + "ID": "5eee3fe927f2234d7655f4fcc7fead0a", + "Namespace": "test.$cmd", + "Operation": "command", + "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"count\":\"coll\",\"query\":{\"a\":{\"$gt\":5}},\"fields\":{}}}\n", + "Fingerprint": "COUNT coll a", + "FirstSeen": "2017-08-20T15:39:14.971Z", + "LastSeen": "2017-08-20T15:39:21.124Z", + "TableScan": false, + "Count": 2, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0, + 0 + ], + "NScanned": [ + 0, + 0 + ], + "QueryTime": [ + 0, + 0 + ], + "ResponseLength": [ + 48, + 44 + ] + }, + { + "ID": "24acf4277fabf2a382f266bb4e6e8e3e", + "Namespace": "test.$cmd", + "Operation": "command", + "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"distinct\":\"coll\",\"key\":\"a\",\"query\":{\"b\":{\"$gte\":5}}}}\n", + "Fingerprint": "DISTINCT coll a,b", + "FirstSeen": "2017-08-20T15:39:15.323Z", + "LastSeen": "2017-08-20T15:39:21.392Z", + "TableScan": false, + "Count": 2, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0, + 0 + ], + "NScanned": [ + 0, + 0 + ], + "QueryTime": [ + 0, + 0 + ], + "ResponseLength": [ + 254, + 261 + ] + }, + { + "ID": "3335908aa111fe5eedf75479d9b1eb72", + "Namespace": "test.$cmd", + "Operation": "command", + "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"$eval\":\"db\"}}\n", + "Fingerprint": "EVAL", + "FirstSeen": "2017-09-05T19:39:24.522Z", + "LastSeen": "2017-09-05T19:39:32.054Z", + "TableScan": false, + "Count": 2, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0, + 0 + ], + "NScanned": [ + 0, + 0 + ], + "QueryTime": [ + 65, + 35 + ], + "ResponseLength": [ + 108, + 108 + ] + }, + { + "ID": "ada85b4f1473b9a1fb37158a8481e20e", + "Namespace": "test.$cmd", + "Operation": "command", + "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"explain\":{\"find\":\"coll\",\"filter\":{},\"options\":{}},\"verbosity\":\"queryPlanner\"}}\n", + "Fingerprint": "EXPLAIN", + "FirstSeen": "2017-09-05T19:39:32.21Z", + "LastSeen": "2017-09-05T19:39:32.21Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 379 + ] + }, + { + "ID": "3d52ee232b8c4e1068dd90741632614a", + "Namespace": "test.$cmd", + "Operation": "command", + "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"findandmodify\":\"coll\",\"query\":{\"a\":2},\"update\":{\"$inc\":{\"b\":1}}},\"updateobj\":{\"$inc\":{\"b\":1}}}\n", + "Fingerprint": "FINDANDMODIFY coll a", + "FirstSeen": "2017-08-20T15:39:15.903Z", + "LastSeen": "2017-08-20T15:39:21.902Z", + "TableScan": false, + "Count": 2, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0, + 0 + ], + "NScanned": [ + 0, + 0 + ], + "QueryTime": [ + 0, + 0 + ], + "ResponseLength": [ + 131, + 131 + ] + }, + { + "ID": "eb3d8174e05f442cc5c3269eb50667d6", + "Namespace": "test.$cmd", + "Operation": "command", + "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"geoNear\":\"coll\",\"near\":{\"type\":\"Point\",\"coordinates\":[1,1]},\"spherical\":true}}\n", + "Fingerprint": "GEONEAR coll", + "FirstSeen": "2017-08-20T15:39:16.061Z", + "LastSeen": "2017-08-20T15:39:22.055Z", + "TableScan": false, + "Count": 2, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0, + 0 + ], + "NScanned": [ + 0, + 0 + ], + "QueryTime": [ + 1, + 3 + ], + "ResponseLength": [ + 1406, + 1398 + ] + }, + { + "ID": "225e5819de843c1779f1118f2f01b77e", + "Namespace": "test.$cmd", + "Operation": "command", + "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"group\":{\"key\":{\"a\":1,\"b\":1},\"cond\":{\"b\":3},\"initial\":{},\"ns\":\"coll\",\"$reduce\":\"\"}}}\n", + "Fingerprint": "GROUP coll a,b", + "FirstSeen": "2017-08-20T15:39:16.325Z", + "LastSeen": "2017-08-20T15:39:22.271Z", + "TableScan": false, + "Count": 2, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0, + 0 + ], + "NScanned": [ + 0, + 0 + ], + "QueryTime": [ + 77, + 54 + ], + "ResponseLength": [ + 135, + 139 + ] + }, + { + "ID": "23ca094f285d0cd9538fb1b1f6ef0f4f", + "Namespace": "test.$cmd", + "Operation": "command", + "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"mapreduce\":\"coll\",\"map\":\"\",\"reduce\":\"\",\"query\":{\"a\":{\"$gte\":0}},\"out\":{\"inline\":1}}}\n", + "Fingerprint": "MAPREDUCE coll a", + "FirstSeen": "2017-08-20T15:39:16.701Z", + "LastSeen": "2017-08-20T15:39:22.582Z", + "TableScan": false, + "Count": 2, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0, + 0 + ], + "NScanned": [ + 0, + 0 + ], + "QueryTime": [ + 33, + 26 + ], + "ResponseLength": [ + 233, + 233 + ] + }, + { + "ID": "11e1b6f695d43b1b5a2f7e6de2ad8305", + "Namespace": "test.coll", + "Operation": "command", + "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"aggregate\":\"coll\",\"pipeline\":[{\"$match\":{\"a\":{\"$gte\":2}}}],\"cursor\":{}}}\n", + "Fingerprint": "AGGREGATE coll a", + "FirstSeen": "2017-08-20T15:39:29.915Z", + "LastSeen": "2017-08-20T15:39:47.203Z", + "TableScan": false, + "Count": 3, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0, + 8, + 8 + ], + "NScanned": [ + 0, + 8, + 8 + ], + "QueryTime": [ + 2, + 0, + 2 + ], + "ResponseLength": [ + 388, + 370, + 370 + ] + }, + { + "ID": "29701e3d37e0adb35ebd70b7ef2b3f3d", + "Namespace": "test.coll", + "Operation": "command", + "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"count\":\"coll\",\"query\":{},\"fields\":{}}}\n", + "Fingerprint": "COUNT coll", + "FirstSeen": "2017-08-20T15:39:30.094Z", + "LastSeen": "2017-08-20T15:39:47.396Z", + "TableScan": false, + "Count": 3, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0, + 0, + 0 + ], + "NScanned": [ + 0, + 0, + 0 + ], + "QueryTime": [ + 0, + 0, + 0 + ], + "ResponseLength": [ + 47, + 29, + 29 + ] + }, + { + "ID": "2300d7f2d372205544f249b010e9b8ad", + "Namespace": "test.coll", + "Operation": "command", + "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"count\":\"coll\",\"query\":{\"a\":{\"$gt\":5}},\"fields\":{}}}\n", + "Fingerprint": "COUNT coll a", + "FirstSeen": "2017-08-20T15:39:30.251Z", + "LastSeen": "2017-08-20T15:39:47.573Z", + "TableScan": false, + "Count": 3, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0, + 0, + 0 + ], + "NScanned": [ + 0, + 0, + 0 + ], + "QueryTime": [ + 0, + 0, + 0 + ], + "ResponseLength": [ + 47, + 29, + 29 + ] + }, + { + "ID": "a4be6ed97c946182af7e30cf818afdac", + "Namespace": "test.coll", + "Operation": "command", + "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"distinct\":\"coll\",\"key\":\"a\",\"query\":{\"b\":{\"$gte\":5}}}}\n", + "Fingerprint": "DISTINCT coll a,b", + "FirstSeen": "2017-08-20T15:39:30.748Z", + "LastSeen": "2017-08-20T15:39:47.927Z", + "TableScan": false, + "Count": 3, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0, + 0, + 0 + ], + "NScanned": [ + 0, + 10, + 10 + ], + "QueryTime": [ + 0, + 0, + 0 + ], + "ResponseLength": [ + 264, + 145, + 145 + ] + }, + { + "ID": "e2f53c6824c5cbe454e33e128b350d1e", + "Namespace": "test.coll", + "Operation": "command", + "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"explain\":{\"find\":\"coll\",\"filter\":{}},\"verbosity\":\"queryPlanner\"}}\n", + "Fingerprint": "EXPLAIN", + "FirstSeen": "2017-09-05T19:39:41.753Z", + "LastSeen": "2017-09-05T19:40:00.433Z", + "TableScan": false, + "Count": 3, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0, + 0, + 0 + ], + "NScanned": [ + 0, + 0, + 0 + ], + "QueryTime": [ + 0, + 0, + 0 + ], + "ResponseLength": [ + 364, + 328, + 329 + ] + }, + { + "ID": "9423eaa90c222686d092c04f001fb369", + "Namespace": "test.coll", + "Operation": "command", + "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"findandmodify\":\"coll\",\"query\":{\"a\":2},\"update\":{\"$inc\":{\"b\":1}}},\"updateobj\":{\"$inc\":{\"b\":1}}}\n", + "Fingerprint": "FINDANDMODIFY coll a", + "FirstSeen": "2017-08-20T15:39:31.548Z", + "LastSeen": "2017-08-20T15:39:48.636Z", + "TableScan": false, + "Count": 3, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0, + 0, + 0 + ], + "NScanned": [ + 3, + 3, + 3 + ], + "QueryTime": [ + 0, + 0, + 0 + ], + "ResponseLength": [ + 116, + 116, + 116 + ] + }, + { + "ID": "dd20c739baef5a3fd9352c350c7e69f1", + "Namespace": "test.coll", + "Operation": "command", + "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"geoNear\":\"coll\",\"near\":{\"type\":\"Point\",\"coordinates\":[1,1]},\"spherical\":true}}\n", + "Fingerprint": "GEONEAR coll", + "FirstSeen": "2017-08-20T15:39:31.797Z", + "LastSeen": "2017-08-20T15:39:48.842Z", + "TableScan": false, + "Count": 3, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0, + 0, + 0 + ], + "NScanned": [ + 0, + 10, + 10 + ], + "QueryTime": [ + 8, + 11, + 7 + ], + "ResponseLength": [ + 1401, + 1383, + 1383 + ] + }, + { + "ID": "018a055f724d418b80e66b98bfdb25a5", + "Namespace": "test.coll", + "Operation": "command", + "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"group\":{\"key\":{\"a\":1,\"b\":1},\"cond\":{\"b\":3},\"initial\":{},\"ns\":\"coll\",\"$reduce\":\"\"}}}\n", + "Fingerprint": "GROUP coll a,b", + "FirstSeen": "2017-08-20T15:39:32.101Z", + "LastSeen": "2017-08-20T15:39:49.276Z", + "TableScan": false, + "Count": 3, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0, + 0, + 0 + ], + "NScanned": [ + 0, + 2, + 2 + ], + "QueryTime": [ + 74, + 77, + 68 + ], + "ResponseLength": [ + 142, + 124, + 124 + ] + }, + { + "ID": "130827f5b7afe1369f619ccd5cd61ec4", + "Namespace": "test.coll", + "Operation": "command", + "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"mapreduce\":\"coll\",\"map\":\"\",\"reduce\":\"\",\"query\":{\"a\":{\"$gte\":0}},\"out\":{\"inline\":1}}}\n", + "Fingerprint": "MAPREDUCE coll a", + "FirstSeen": "2017-08-20T15:39:32.572Z", + "LastSeen": "2017-08-20T15:39:49.68Z", + "TableScan": false, + "Count": 3, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0, + 0, + 0 + ], + "NScanned": [ + 0, + 3, + 3 + ], + "QueryTime": [ + 31, + 43, + 35 + ], + "ResponseLength": [ + 218, + 218, + 218 + ] + }, + { + "ID": "71b3d6aa44d34aaa02cd65bad3e25f49", + "Namespace": "test", + "Operation": "command", + "Query": "{\"ns\":\"test\",\"op\":\"command\",\"command\":{\"$eval\":\"db\"}}\n", + "Fingerprint": "EVAL", + "FirstSeen": "2017-09-05T19:39:41.581Z", + "LastSeen": "2017-09-05T19:40:00.171Z", + "TableScan": false, + "Count": 3, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0, + 0, + 0 + ], + "NScanned": [ + 0, + 0, + 0 + ], + "QueryTime": [ + 88, + 91, + 47 + ], + "ResponseLength": [ + 93, + 93, + 93 + ] + }, + { + "ID": "a7ce8dee16beadb767484112e6b29af3", + "Namespace": "test.coll", + "Operation": "insert", + "Query": "{\"ns\":\"test.coll\",\"op\":\"insert\",\"query\":{\"_id\":1}}\n", + "Fingerprint": "INSERT coll", + "FirstSeen": "2017-08-20T15:39:16.473Z", + "LastSeen": "2017-08-20T15:39:49.44Z", + "TableScan": false, + "Count": 5, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0, + 0, + 0, + 0, + 0 + ], + "NScanned": [ + 0, + 0, + 0, + 0, + 0 + ], + "QueryTime": [ + 0, + 0, + 0, + 0, + 0 + ], + "ResponseLength": [ + 0, + 0, + 25, + 29, + 29 + ] + }, + { + "ID": "4c06ec043313864d76669ddc2a1be353", + "Namespace": "test.coll", + "Operation": "query", + "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"query\":{\"query\":{},\"$explain\":true}}\n", + "Fingerprint": "EXPLAIN", + "FirstSeen": "2017-09-05T19:39:24.666Z", + "LastSeen": "2017-09-05T19:39:24.666Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 1 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 583 + ] + }, + { + "ID": "b9a4b74ac8b3747f44951490e6279b96", + "Namespace": "test.coll", + "Operation": "query", + "Query": "{\"ns\":\"test.coll\",\"op\":\"query\"}\n", + "Fingerprint": "FIND coll", + "FirstSeen": "2017-08-20T15:39:15.75Z", + "LastSeen": "2017-08-20T15:39:48.429Z", + "TableScan": false, + "Count": 5, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 49, + 49, + 49, + 49, + 49 + ], + "NScanned": [ + 0, + 0, + 49, + 49, + 49 + ], + "QueryTime": [ + 0, + 0, + 0, + 0, + 0 + ], + "ResponseLength": [ + 1846, + 1846, + 2112, + 2094, + 2094 + ] + }, + { + "ID": "4e9241090af6f4a49545baf7c015fb5c", + "Namespace": "test.coll", + "Operation": "query", + "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"query\":{\"a\":1}}\n", + "Fingerprint": "FIND coll a", + "FirstSeen": "2017-08-20T15:39:15.457Z", + "LastSeen": "2017-08-20T15:39:48.107Z", + "TableScan": false, + "Count": 5, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 6, + 6, + 6, + 6, + 6 + ], + "NScanned": [ + 0, + 0, + 6, + 6, + 6 + ], + "QueryTime": [ + 0, + 0, + 0, + 0, + 1 + ], + "ResponseLength": [ + 251, + 251, + 349, + 331, + 331 + ] + }, + { + "ID": "dddda7545e797b073966c514f9b6fe49", + "Namespace": "test.coll", + "Operation": "query", + "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"query\":{\"query\":{\"$and\":[{\"k\":{\"$gt\":1}},{\"k\":{\"$lt\":2}},{\"$or\":[{\"c\":{\"$in\":[\"/^0/\",\"/^2/\",\"/^4/\",\"/^6/\"]}},{\"pad\":{\"$in\":[\"/9$/\",\"/7$/\",\"/5$/\",\"/3$/\"]}}]}]},\"orderby\":{\"k\":-1}}}\n", + "Fingerprint": "FIND coll c,k,pad", + "FirstSeen": "2017-08-20T15:39:15.616Z", + "LastSeen": "2017-08-20T15:39:48.277Z", + "TableScan": false, + "Count": 5, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0, + 0, + 0, + 0, + 0 + ], + "NScanned": [ + 0, + 0, + 49, + 49, + 49 + ], + "QueryTime": [ + 0, + 0, + 0, + 0, + 0 + ], + "ResponseLength": [ + 20, + 20, + 100, + 82, + 82 + ] + }, + { + "ID": "bab52c8aa977c96ecd148c015ae07c42", + "Namespace": "test.coll", + "Operation": "remove", + "Query": "{\"ns\":\"test.coll\",\"op\":\"remove\",\"query\":{\"a\":{\"$gte\":2},\"b\":{\"$gte\":2}}}\n", + "Fingerprint": "REMOVE coll a,b", + "FirstSeen": "2017-08-20T15:39:15.126Z", + "LastSeen": "2017-08-30T10:55:19.142Z", + "TableScan": false, + "Count": 10, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "NScanned": [ + 0, + 0, + 0, + 4, + 4, + 0, + 0, + 0, + 39, + 39 + ], + "QueryTime": [ + 0, + 0, + 1, + 0, + 0, + 0, + 1, + 0, + 0, + 0 + ], + "ResponseLength": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ] + }, + { + "ID": "27cb39e62745b1ff4121b4bf6f21fb12", + "Namespace": "test.coll", + "Operation": "update", + "Query": "{\"ns\":\"test.coll\",\"op\":\"update\",\"query\":{\"a\":{\"$gte\":2}},\"updateobj\":{\"$set\":{\"c\":1},\"$inc\":{\"a\":-10}}}\n", + "Fingerprint": "UPDATE coll a", + "FirstSeen": "2017-08-20T15:39:16.921Z", + "LastSeen": "2017-08-20T15:39:49.855Z", + "TableScan": false, + "Count": 5, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0, + 0, + 0, + 0, + 0 + ], + "NScanned": [ + 0, + 0, + 1, + 1, + 1 + ], + "QueryTime": [ + 0, + 0, + 0, + 0, + 0 + ], + "ResponseLength": [ + 0, + 0, + 0, + 0, + 0 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/aggregate_2.6.12 b/src/go/tests/expect/stats_single/aggregate_2.6.12 new file mode 100755 index 00000000..afc40cc0 --- /dev/null +++ b/src/go/tests/expect/stats_single/aggregate_2.6.12 @@ -0,0 +1,27 @@ +[ + { + "ID": "59899eb380b4e48c345fb6f997d06bfa", + "Namespace": "test.$cmd", + "Operation": "command", + "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"aggregate\":\"coll\",\"pipeline\":[{\"$match\":{\"a\":{\"$gte\":2}}}],\"cursor\":{}}}\n", + "Fingerprint": "AGGREGATE coll a", + "FirstSeen": "2017-08-20T15:39:14.658Z", + "LastSeen": "2017-08-20T15:39:14.658Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 385 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/aggregate_3.0.15 b/src/go/tests/expect/stats_single/aggregate_3.0.15 new file mode 100755 index 00000000..b3b94e5d --- /dev/null +++ b/src/go/tests/expect/stats_single/aggregate_3.0.15 @@ -0,0 +1,27 @@ +[ + { + "ID": "59899eb380b4e48c345fb6f997d06bfa", + "Namespace": "test.$cmd", + "Operation": "command", + "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"aggregate\":\"coll\",\"pipeline\":[{\"$match\":{\"a\":{\"$gte\":2}}}],\"cursor\":{}}}\n", + "Fingerprint": "AGGREGATE coll a", + "FirstSeen": "2017-08-20T15:39:20.858Z", + "LastSeen": "2017-08-20T15:39:20.858Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 2 + ], + "ResponseLength": [ + 385 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/aggregate_3.2.16 b/src/go/tests/expect/stats_single/aggregate_3.2.16 new file mode 100755 index 00000000..f34c0dfb --- /dev/null +++ b/src/go/tests/expect/stats_single/aggregate_3.2.16 @@ -0,0 +1,27 @@ +[ + { + "ID": "11e1b6f695d43b1b5a2f7e6de2ad8305", + "Namespace": "test.coll", + "Operation": "command", + "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"aggregate\":\"coll\",\"pipeline\":[{\"$match\":{\"a\":{\"$gte\":2}}}],\"cursor\":{}}}\n", + "Fingerprint": "AGGREGATE coll a", + "FirstSeen": "2017-08-20T15:39:29.915Z", + "LastSeen": "2017-08-20T15:39:29.915Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 2 + ], + "ResponseLength": [ + 388 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/aggregate_3.4.7 b/src/go/tests/expect/stats_single/aggregate_3.4.7 new file mode 100755 index 00000000..602bdc9e --- /dev/null +++ b/src/go/tests/expect/stats_single/aggregate_3.4.7 @@ -0,0 +1,27 @@ +[ + { + "ID": "11e1b6f695d43b1b5a2f7e6de2ad8305", + "Namespace": "test.coll", + "Operation": "command", + "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"aggregate\":\"coll\",\"pipeline\":[{\"$match\":{\"a\":{\"$gte\":2}}}],\"cursor\":{}}}\n", + "Fingerprint": "AGGREGATE coll a", + "FirstSeen": "2017-08-20T15:39:36.711Z", + "LastSeen": "2017-08-20T15:39:36.711Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 8 + ], + "NScanned": [ + 8 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 370 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/aggregate_3.5.11 b/src/go/tests/expect/stats_single/aggregate_3.5.11 new file mode 100755 index 00000000..72f7afcd --- /dev/null +++ b/src/go/tests/expect/stats_single/aggregate_3.5.11 @@ -0,0 +1,27 @@ +[ + { + "ID": "11e1b6f695d43b1b5a2f7e6de2ad8305", + "Namespace": "test.coll", + "Operation": "command", + "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"aggregate\":\"coll\",\"pipeline\":[{\"$match\":{\"a\":{\"$gte\":2}}}],\"cursor\":{},\"$db\":\"test\"}}\n", + "Fingerprint": "AGGREGATE coll a", + "FirstSeen": "2017-08-20T15:39:47.203Z", + "LastSeen": "2017-08-20T15:39:47.203Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 8 + ], + "NScanned": [ + 8 + ], + "QueryTime": [ + 2 + ], + "ResponseLength": [ + 370 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/count_2.6.12 b/src/go/tests/expect/stats_single/count_2.6.12 new file mode 100755 index 00000000..62fdc209 --- /dev/null +++ b/src/go/tests/expect/stats_single/count_2.6.12 @@ -0,0 +1,27 @@ +[ + { + "ID": "020d9f1058f3bf08e3b1afb1ef883d44", + "Namespace": "test.$cmd", + "Operation": "command", + "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"count\":\"coll\",\"query\":{},\"fields\":{}}}\n", + "Fingerprint": "COUNT coll", + "FirstSeen": "2017-08-20T15:39:14.823Z", + "LastSeen": "2017-08-20T15:39:14.823Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 48 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/count_3.0.15 b/src/go/tests/expect/stats_single/count_3.0.15 new file mode 100755 index 00000000..3ef8caf6 --- /dev/null +++ b/src/go/tests/expect/stats_single/count_3.0.15 @@ -0,0 +1,27 @@ +[ + { + "ID": "020d9f1058f3bf08e3b1afb1ef883d44", + "Namespace": "test.$cmd", + "Operation": "command", + "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"count\":\"coll\",\"query\":{},\"fields\":{}}}\n", + "Fingerprint": "COUNT coll", + "FirstSeen": "2017-08-20T15:39:20.982Z", + "LastSeen": "2017-08-20T15:39:20.982Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 44 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/count_3.2.16 b/src/go/tests/expect/stats_single/count_3.2.16 new file mode 100755 index 00000000..a1f347e8 --- /dev/null +++ b/src/go/tests/expect/stats_single/count_3.2.16 @@ -0,0 +1,27 @@ +[ + { + "ID": "29701e3d37e0adb35ebd70b7ef2b3f3d", + "Namespace": "test.coll", + "Operation": "command", + "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"count\":\"coll\",\"query\":{},\"fields\":{}}}\n", + "Fingerprint": "COUNT coll", + "FirstSeen": "2017-08-20T15:39:30.094Z", + "LastSeen": "2017-08-20T15:39:30.094Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 47 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/count_3.4.7 b/src/go/tests/expect/stats_single/count_3.4.7 new file mode 100755 index 00000000..660719fa --- /dev/null +++ b/src/go/tests/expect/stats_single/count_3.4.7 @@ -0,0 +1,27 @@ +[ + { + "ID": "29701e3d37e0adb35ebd70b7ef2b3f3d", + "Namespace": "test.coll", + "Operation": "command", + "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"count\":\"coll\",\"query\":{},\"fields\":{}}}\n", + "Fingerprint": "COUNT coll", + "FirstSeen": "2017-08-20T15:39:36.897Z", + "LastSeen": "2017-08-20T15:39:36.897Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 29 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/count_3.5.11 b/src/go/tests/expect/stats_single/count_3.5.11 new file mode 100755 index 00000000..ffd0ca42 --- /dev/null +++ b/src/go/tests/expect/stats_single/count_3.5.11 @@ -0,0 +1,27 @@ +[ + { + "ID": "29701e3d37e0adb35ebd70b7ef2b3f3d", + "Namespace": "test.coll", + "Operation": "command", + "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"count\":\"coll\",\"query\":{},\"fields\":{},\"$db\":\"test\"}}\n", + "Fingerprint": "COUNT coll", + "FirstSeen": "2017-08-20T15:39:47.396Z", + "LastSeen": "2017-08-20T15:39:47.396Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 29 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/count_with_query_2.6.12 b/src/go/tests/expect/stats_single/count_with_query_2.6.12 new file mode 100755 index 00000000..27e9e3bf --- /dev/null +++ b/src/go/tests/expect/stats_single/count_with_query_2.6.12 @@ -0,0 +1,27 @@ +[ + { + "ID": "5eee3fe927f2234d7655f4fcc7fead0a", + "Namespace": "test.$cmd", + "Operation": "command", + "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"count\":\"coll\",\"query\":{\"a\":{\"$gt\":5}},\"fields\":{}}}\n", + "Fingerprint": "COUNT coll a", + "FirstSeen": "2017-08-20T15:39:14.971Z", + "LastSeen": "2017-08-20T15:39:14.971Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 48 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/count_with_query_3.0.15 b/src/go/tests/expect/stats_single/count_with_query_3.0.15 new file mode 100755 index 00000000..8c81f114 --- /dev/null +++ b/src/go/tests/expect/stats_single/count_with_query_3.0.15 @@ -0,0 +1,27 @@ +[ + { + "ID": "5eee3fe927f2234d7655f4fcc7fead0a", + "Namespace": "test.$cmd", + "Operation": "command", + "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"count\":\"coll\",\"query\":{\"a\":{\"$gt\":5}},\"fields\":{}}}\n", + "Fingerprint": "COUNT coll a", + "FirstSeen": "2017-08-20T15:39:21.124Z", + "LastSeen": "2017-08-20T15:39:21.124Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 44 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/count_with_query_3.2.16 b/src/go/tests/expect/stats_single/count_with_query_3.2.16 new file mode 100755 index 00000000..e46b5be7 --- /dev/null +++ b/src/go/tests/expect/stats_single/count_with_query_3.2.16 @@ -0,0 +1,27 @@ +[ + { + "ID": "2300d7f2d372205544f249b010e9b8ad", + "Namespace": "test.coll", + "Operation": "command", + "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"count\":\"coll\",\"query\":{\"a\":{\"$gt\":5}},\"fields\":{}}}\n", + "Fingerprint": "COUNT coll a", + "FirstSeen": "2017-08-20T15:39:30.251Z", + "LastSeen": "2017-08-20T15:39:30.251Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 47 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/count_with_query_3.4.7 b/src/go/tests/expect/stats_single/count_with_query_3.4.7 new file mode 100755 index 00000000..a26da1e8 --- /dev/null +++ b/src/go/tests/expect/stats_single/count_with_query_3.4.7 @@ -0,0 +1,27 @@ +[ + { + "ID": "2300d7f2d372205544f249b010e9b8ad", + "Namespace": "test.coll", + "Operation": "command", + "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"count\":\"coll\",\"query\":{\"a\":{\"$gt\":5}},\"fields\":{}}}\n", + "Fingerprint": "COUNT coll a", + "FirstSeen": "2017-08-20T15:39:37.077Z", + "LastSeen": "2017-08-20T15:39:37.077Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 29 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/count_with_query_3.5.11 b/src/go/tests/expect/stats_single/count_with_query_3.5.11 new file mode 100755 index 00000000..71f31676 --- /dev/null +++ b/src/go/tests/expect/stats_single/count_with_query_3.5.11 @@ -0,0 +1,27 @@ +[ + { + "ID": "2300d7f2d372205544f249b010e9b8ad", + "Namespace": "test.coll", + "Operation": "command", + "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"count\":\"coll\",\"query\":{\"a\":{\"$gt\":5}},\"fields\":{},\"$db\":\"test\"}}\n", + "Fingerprint": "COUNT coll a", + "FirstSeen": "2017-08-20T15:39:47.573Z", + "LastSeen": "2017-08-20T15:39:47.573Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 29 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/delete_2.6.12 b/src/go/tests/expect/stats_single/delete_2.6.12 new file mode 100755 index 00000000..8eda72ed --- /dev/null +++ b/src/go/tests/expect/stats_single/delete_2.6.12 @@ -0,0 +1,27 @@ +[ + { + "ID": "bab52c8aa977c96ecd148c015ae07c42", + "Namespace": "test.coll", + "Operation": "remove", + "Query": "{\"ns\":\"test.coll\",\"op\":\"remove\",\"query\":{\"a\":{\"$gte\":2},\"b\":{\"$gte\":2}}}\n", + "Fingerprint": "REMOVE coll a,b", + "FirstSeen": "2017-08-20T15:39:15.126Z", + "LastSeen": "2017-08-20T15:39:15.126Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 0 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/delete_3.0.15 b/src/go/tests/expect/stats_single/delete_3.0.15 new file mode 100755 index 00000000..8186ab31 --- /dev/null +++ b/src/go/tests/expect/stats_single/delete_3.0.15 @@ -0,0 +1,27 @@ +[ + { + "ID": "bab52c8aa977c96ecd148c015ae07c42", + "Namespace": "test.coll", + "Operation": "remove", + "Query": "{\"ns\":\"test.coll\",\"op\":\"remove\",\"query\":{\"a\":{\"$gte\":2},\"b\":{\"$gte\":2}}}\n", + "Fingerprint": "REMOVE coll a,b", + "FirstSeen": "2017-08-20T15:39:21.265Z", + "LastSeen": "2017-08-20T15:39:21.265Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 0 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/delete_3.2.16 b/src/go/tests/expect/stats_single/delete_3.2.16 new file mode 100755 index 00000000..261dc6b0 --- /dev/null +++ b/src/go/tests/expect/stats_single/delete_3.2.16 @@ -0,0 +1,27 @@ +[ + { + "ID": "bab52c8aa977c96ecd148c015ae07c42", + "Namespace": "test.coll", + "Operation": "remove", + "Query": "{\"ns\":\"test.coll\",\"op\":\"remove\",\"query\":{\"a\":{\"$gte\":2},\"b\":{\"$gte\":2}}}\n", + "Fingerprint": "REMOVE coll a,b", + "FirstSeen": "2017-08-20T15:39:30.543Z", + "LastSeen": "2017-08-20T15:39:30.543Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 1 + ], + "ResponseLength": [ + 0 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/delete_3.4.7 b/src/go/tests/expect/stats_single/delete_3.4.7 new file mode 100755 index 00000000..5ff3e534 --- /dev/null +++ b/src/go/tests/expect/stats_single/delete_3.4.7 @@ -0,0 +1,27 @@ +[ + { + "ID": "bab52c8aa977c96ecd148c015ae07c42", + "Namespace": "test.coll", + "Operation": "remove", + "Query": "{\"ns\":\"test.coll\",\"op\":\"remove\",\"query\":{\"a\":{\"$gte\":2},\"b\":{\"$gte\":2}}}\n", + "Fingerprint": "REMOVE coll a,b", + "FirstSeen": "2017-08-20T15:39:37.279Z", + "LastSeen": "2017-08-20T15:39:37.279Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 4 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 0 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/delete_3.5.11 b/src/go/tests/expect/stats_single/delete_3.5.11 new file mode 100755 index 00000000..713b8fd7 --- /dev/null +++ b/src/go/tests/expect/stats_single/delete_3.5.11 @@ -0,0 +1,27 @@ +[ + { + "ID": "bab52c8aa977c96ecd148c015ae07c42", + "Namespace": "test.coll", + "Operation": "remove", + "Query": "{\"ns\":\"test.coll\",\"op\":\"remove\",\"command\":{\"q\":{\"a\":{\"$gte\":2},\"b\":{\"$gte\":2}},\"limit\":1}}\n", + "Fingerprint": "REMOVE coll a,b", + "FirstSeen": "2017-08-20T15:39:47.745Z", + "LastSeen": "2017-08-20T15:39:47.745Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 4 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 0 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/delete_all_2.6.12 b/src/go/tests/expect/stats_single/delete_all_2.6.12 new file mode 100755 index 00000000..e66c8de9 --- /dev/null +++ b/src/go/tests/expect/stats_single/delete_all_2.6.12 @@ -0,0 +1,27 @@ +[ + { + "ID": "bab52c8aa977c96ecd148c015ae07c42", + "Namespace": "test.coll", + "Operation": "remove", + "Query": "{\"ns\":\"test.coll\",\"op\":\"remove\",\"query\":{\"a\":{\"$gte\":2},\"b\":{\"$gte\":2}}}\n", + "Fingerprint": "REMOVE coll a,b", + "FirstSeen": "2017-08-30T10:54:45.348Z", + "LastSeen": "2017-08-30T10:54:45.348Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 0 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/delete_all_3.0.15 b/src/go/tests/expect/stats_single/delete_all_3.0.15 new file mode 100755 index 00000000..acde6c57 --- /dev/null +++ b/src/go/tests/expect/stats_single/delete_all_3.0.15 @@ -0,0 +1,27 @@ +[ + { + "ID": "bab52c8aa977c96ecd148c015ae07c42", + "Namespace": "test.coll", + "Operation": "remove", + "Query": "{\"ns\":\"test.coll\",\"op\":\"remove\",\"query\":{\"a\":{\"$gte\":2},\"b\":{\"$gte\":2}}}\n", + "Fingerprint": "REMOVE coll a,b", + "FirstSeen": "2017-08-30T10:54:52.821Z", + "LastSeen": "2017-08-30T10:54:52.821Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 1 + ], + "ResponseLength": [ + 0 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/delete_all_3.2.16 b/src/go/tests/expect/stats_single/delete_all_3.2.16 new file mode 100755 index 00000000..fb44fb95 --- /dev/null +++ b/src/go/tests/expect/stats_single/delete_all_3.2.16 @@ -0,0 +1,27 @@ +[ + { + "ID": "bab52c8aa977c96ecd148c015ae07c42", + "Namespace": "test.coll", + "Operation": "remove", + "Query": "{\"ns\":\"test.coll\",\"op\":\"remove\",\"query\":{\"a\":{\"$gte\":2},\"b\":{\"$gte\":2}}}\n", + "Fingerprint": "REMOVE coll a,b", + "FirstSeen": "2017-08-30T10:55:02.238Z", + "LastSeen": "2017-08-30T10:55:02.238Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 0 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/delete_all_3.4.7 b/src/go/tests/expect/stats_single/delete_all_3.4.7 new file mode 100755 index 00000000..b29696f5 --- /dev/null +++ b/src/go/tests/expect/stats_single/delete_all_3.4.7 @@ -0,0 +1,27 @@ +[ + { + "ID": "bab52c8aa977c96ecd148c015ae07c42", + "Namespace": "test.coll", + "Operation": "remove", + "Query": "{\"ns\":\"test.coll\",\"op\":\"remove\",\"query\":{\"a\":{\"$gte\":2},\"b\":{\"$gte\":2}}}\n", + "Fingerprint": "REMOVE coll a,b", + "FirstSeen": "2017-08-30T10:55:09.833Z", + "LastSeen": "2017-08-30T10:55:09.833Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 39 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 0 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/delete_all_3.5.11 b/src/go/tests/expect/stats_single/delete_all_3.5.11 new file mode 100755 index 00000000..9f55141f --- /dev/null +++ b/src/go/tests/expect/stats_single/delete_all_3.5.11 @@ -0,0 +1,27 @@ +[ + { + "ID": "bab52c8aa977c96ecd148c015ae07c42", + "Namespace": "test.coll", + "Operation": "remove", + "Query": "{\"ns\":\"test.coll\",\"op\":\"remove\",\"command\":{\"q\":{\"a\":{\"$gte\":2},\"b\":{\"$gte\":2}},\"limit\":0}}\n", + "Fingerprint": "REMOVE coll a,b", + "FirstSeen": "2017-08-30T10:55:19.142Z", + "LastSeen": "2017-08-30T10:55:19.142Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 39 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 0 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/distinct_2.6.12 b/src/go/tests/expect/stats_single/distinct_2.6.12 new file mode 100755 index 00000000..ff012779 --- /dev/null +++ b/src/go/tests/expect/stats_single/distinct_2.6.12 @@ -0,0 +1,27 @@ +[ + { + "ID": "24acf4277fabf2a382f266bb4e6e8e3e", + "Namespace": "test.$cmd", + "Operation": "command", + "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"distinct\":\"coll\",\"key\":\"a\",\"query\":{\"b\":{\"$gte\":5}}}}\n", + "Fingerprint": "DISTINCT coll a,b", + "FirstSeen": "2017-08-20T15:39:15.323Z", + "LastSeen": "2017-08-20T15:39:15.323Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 254 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/distinct_3.0.15 b/src/go/tests/expect/stats_single/distinct_3.0.15 new file mode 100755 index 00000000..bce6b254 --- /dev/null +++ b/src/go/tests/expect/stats_single/distinct_3.0.15 @@ -0,0 +1,27 @@ +[ + { + "ID": "24acf4277fabf2a382f266bb4e6e8e3e", + "Namespace": "test.$cmd", + "Operation": "command", + "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"distinct\":\"coll\",\"key\":\"a\",\"query\":{\"b\":{\"$gte\":5}}}}\n", + "Fingerprint": "DISTINCT coll a,b", + "FirstSeen": "2017-08-20T15:39:21.392Z", + "LastSeen": "2017-08-20T15:39:21.392Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 261 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/distinct_3.2.16 b/src/go/tests/expect/stats_single/distinct_3.2.16 new file mode 100755 index 00000000..84971238 --- /dev/null +++ b/src/go/tests/expect/stats_single/distinct_3.2.16 @@ -0,0 +1,27 @@ +[ + { + "ID": "a4be6ed97c946182af7e30cf818afdac", + "Namespace": "test.coll", + "Operation": "command", + "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"distinct\":\"coll\",\"key\":\"a\",\"query\":{\"b\":{\"$gte\":5}}}}\n", + "Fingerprint": "DISTINCT coll a,b", + "FirstSeen": "2017-08-20T15:39:30.748Z", + "LastSeen": "2017-08-20T15:39:30.748Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 264 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/distinct_3.4.7 b/src/go/tests/expect/stats_single/distinct_3.4.7 new file mode 100755 index 00000000..9de485cf --- /dev/null +++ b/src/go/tests/expect/stats_single/distinct_3.4.7 @@ -0,0 +1,27 @@ +[ + { + "ID": "a4be6ed97c946182af7e30cf818afdac", + "Namespace": "test.coll", + "Operation": "command", + "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"distinct\":\"coll\",\"key\":\"a\",\"query\":{\"b\":{\"$gte\":5}}}}\n", + "Fingerprint": "DISTINCT coll a,b", + "FirstSeen": "2017-08-20T15:39:37.511Z", + "LastSeen": "2017-08-20T15:39:37.511Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 10 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 145 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/distinct_3.5.11 b/src/go/tests/expect/stats_single/distinct_3.5.11 new file mode 100755 index 00000000..c65bced7 --- /dev/null +++ b/src/go/tests/expect/stats_single/distinct_3.5.11 @@ -0,0 +1,27 @@ +[ + { + "ID": "a4be6ed97c946182af7e30cf818afdac", + "Namespace": "test.coll", + "Operation": "command", + "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"distinct\":\"coll\",\"key\":\"a\",\"query\":{\"b\":{\"$gte\":5}},\"$db\":\"test\"}}\n", + "Fingerprint": "DISTINCT coll a,b", + "FirstSeen": "2017-08-20T15:39:47.927Z", + "LastSeen": "2017-08-20T15:39:47.927Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 10 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 145 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/eval_2.6.12 b/src/go/tests/expect/stats_single/eval_2.6.12 new file mode 100755 index 00000000..1d237078 --- /dev/null +++ b/src/go/tests/expect/stats_single/eval_2.6.12 @@ -0,0 +1,27 @@ +[ + { + "ID": "3335908aa111fe5eedf75479d9b1eb72", + "Namespace": "test.$cmd", + "Operation": "command", + "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"$eval\":\"db\"}}\n", + "Fingerprint": "EVAL", + "FirstSeen": "2017-09-05T19:39:24.522Z", + "LastSeen": "2017-09-05T19:39:24.522Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 65 + ], + "ResponseLength": [ + 108 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/eval_3.0.15 b/src/go/tests/expect/stats_single/eval_3.0.15 new file mode 100755 index 00000000..9d23619b --- /dev/null +++ b/src/go/tests/expect/stats_single/eval_3.0.15 @@ -0,0 +1,27 @@ +[ + { + "ID": "3335908aa111fe5eedf75479d9b1eb72", + "Namespace": "test.$cmd", + "Operation": "command", + "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"$eval\":\"db\"}}\n", + "Fingerprint": "EVAL", + "FirstSeen": "2017-09-05T19:39:32.054Z", + "LastSeen": "2017-09-05T19:39:32.054Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 35 + ], + "ResponseLength": [ + 108 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/eval_3.2.16 b/src/go/tests/expect/stats_single/eval_3.2.16 new file mode 100755 index 00000000..291e6997 --- /dev/null +++ b/src/go/tests/expect/stats_single/eval_3.2.16 @@ -0,0 +1,27 @@ +[ + { + "ID": "71b3d6aa44d34aaa02cd65bad3e25f49", + "Namespace": "test", + "Operation": "command", + "Query": "{\"ns\":\"test\",\"op\":\"command\",\"command\":{\"$eval\":\"db\"}}\n", + "Fingerprint": "EVAL", + "FirstSeen": "2017-09-05T19:39:41.581Z", + "LastSeen": "2017-09-05T19:39:41.581Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 88 + ], + "ResponseLength": [ + 93 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/eval_3.4.7 b/src/go/tests/expect/stats_single/eval_3.4.7 new file mode 100755 index 00000000..829ccd72 --- /dev/null +++ b/src/go/tests/expect/stats_single/eval_3.4.7 @@ -0,0 +1,27 @@ +[ + { + "ID": "71b3d6aa44d34aaa02cd65bad3e25f49", + "Namespace": "test", + "Operation": "command", + "Query": "{\"ns\":\"test\",\"op\":\"command\",\"command\":{\"$eval\":\"db\"}}\n", + "Fingerprint": "EVAL", + "FirstSeen": "2017-09-05T19:39:48.888Z", + "LastSeen": "2017-09-05T19:39:48.888Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 91 + ], + "ResponseLength": [ + 93 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/eval_3.5.11 b/src/go/tests/expect/stats_single/eval_3.5.11 new file mode 100755 index 00000000..87ee3cba --- /dev/null +++ b/src/go/tests/expect/stats_single/eval_3.5.11 @@ -0,0 +1,27 @@ +[ + { + "ID": "71b3d6aa44d34aaa02cd65bad3e25f49", + "Namespace": "test", + "Operation": "command", + "Query": "{\"ns\":\"test\",\"op\":\"command\",\"command\":{\"$eval\":\"db\",\"$db\":\"test\"}}\n", + "Fingerprint": "EVAL", + "FirstSeen": "2017-09-05T19:40:00.171Z", + "LastSeen": "2017-09-05T19:40:00.171Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 47 + ], + "ResponseLength": [ + 93 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/explain_2.6.12 b/src/go/tests/expect/stats_single/explain_2.6.12 new file mode 100755 index 00000000..66510eb5 --- /dev/null +++ b/src/go/tests/expect/stats_single/explain_2.6.12 @@ -0,0 +1,27 @@ +[ + { + "ID": "4c06ec043313864d76669ddc2a1be353", + "Namespace": "test.coll", + "Operation": "query", + "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"query\":{\"query\":{},\"$explain\":true}}\n", + "Fingerprint": "EXPLAIN", + "FirstSeen": "2017-09-05T19:39:24.666Z", + "LastSeen": "2017-09-05T19:39:24.666Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 1 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 583 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/explain_3.0.15 b/src/go/tests/expect/stats_single/explain_3.0.15 new file mode 100755 index 00000000..9f8c72e8 --- /dev/null +++ b/src/go/tests/expect/stats_single/explain_3.0.15 @@ -0,0 +1,27 @@ +[ + { + "ID": "ada85b4f1473b9a1fb37158a8481e20e", + "Namespace": "test.$cmd", + "Operation": "command", + "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"explain\":{\"find\":\"coll\",\"filter\":{},\"options\":{}},\"verbosity\":\"queryPlanner\"}}\n", + "Fingerprint": "EXPLAIN", + "FirstSeen": "2017-09-05T19:39:32.21Z", + "LastSeen": "2017-09-05T19:39:32.21Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 379 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/explain_3.2.16 b/src/go/tests/expect/stats_single/explain_3.2.16 new file mode 100755 index 00000000..6952422c --- /dev/null +++ b/src/go/tests/expect/stats_single/explain_3.2.16 @@ -0,0 +1,27 @@ +[ + { + "ID": "e2f53c6824c5cbe454e33e128b350d1e", + "Namespace": "test.coll", + "Operation": "command", + "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"explain\":{\"find\":\"coll\",\"filter\":{}},\"verbosity\":\"queryPlanner\"}}\n", + "Fingerprint": "EXPLAIN", + "FirstSeen": "2017-09-05T19:39:41.753Z", + "LastSeen": "2017-09-05T19:39:41.753Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 364 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/explain_3.4.7 b/src/go/tests/expect/stats_single/explain_3.4.7 new file mode 100755 index 00000000..a507942b --- /dev/null +++ b/src/go/tests/expect/stats_single/explain_3.4.7 @@ -0,0 +1,27 @@ +[ + { + "ID": "e2f53c6824c5cbe454e33e128b350d1e", + "Namespace": "test.coll", + "Operation": "command", + "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"explain\":{\"find\":\"coll\",\"filter\":{}},\"verbosity\":\"queryPlanner\"}}\n", + "Fingerprint": "EXPLAIN", + "FirstSeen": "2017-09-05T19:39:49.065Z", + "LastSeen": "2017-09-05T19:39:49.065Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 328 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/explain_3.5.11 b/src/go/tests/expect/stats_single/explain_3.5.11 new file mode 100755 index 00000000..af4822c3 --- /dev/null +++ b/src/go/tests/expect/stats_single/explain_3.5.11 @@ -0,0 +1,27 @@ +[ + { + "ID": "e2f53c6824c5cbe454e33e128b350d1e", + "Namespace": "test.coll", + "Operation": "command", + "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"explain\":{\"find\":\"coll\",\"filter\":{}},\"verbosity\":\"queryPlanner\",\"$db\":\"test\"}}\n", + "Fingerprint": "EXPLAIN", + "FirstSeen": "2017-09-05T19:40:00.433Z", + "LastSeen": "2017-09-05T19:40:00.433Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 329 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/find_2.6.12 b/src/go/tests/expect/stats_single/find_2.6.12 new file mode 100755 index 00000000..5bebe3e4 --- /dev/null +++ b/src/go/tests/expect/stats_single/find_2.6.12 @@ -0,0 +1,27 @@ +[ + { + "ID": "4e9241090af6f4a49545baf7c015fb5c", + "Namespace": "test.coll", + "Operation": "query", + "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"query\":{\"a\":1}}\n", + "Fingerprint": "FIND coll a", + "FirstSeen": "2017-08-20T15:39:15.457Z", + "LastSeen": "2017-08-20T15:39:15.457Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 6 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 251 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/find_3.0.15 b/src/go/tests/expect/stats_single/find_3.0.15 new file mode 100755 index 00000000..51c0e9c7 --- /dev/null +++ b/src/go/tests/expect/stats_single/find_3.0.15 @@ -0,0 +1,27 @@ +[ + { + "ID": "4e9241090af6f4a49545baf7c015fb5c", + "Namespace": "test.coll", + "Operation": "query", + "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"query\":{\"a\":1}}\n", + "Fingerprint": "FIND coll a", + "FirstSeen": "2017-08-20T15:39:21.515Z", + "LastSeen": "2017-08-20T15:39:21.515Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 6 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 251 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/find_3.2.16 b/src/go/tests/expect/stats_single/find_3.2.16 new file mode 100755 index 00000000..db83ddc9 --- /dev/null +++ b/src/go/tests/expect/stats_single/find_3.2.16 @@ -0,0 +1,27 @@ +[ + { + "ID": "4e9241090af6f4a49545baf7c015fb5c", + "Namespace": "test.coll", + "Operation": "query", + "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"query\":{\"find\":\"coll\",\"filter\":{\"a\":1}}}\n", + "Fingerprint": "FIND coll a", + "FirstSeen": "2017-08-20T15:39:30.913Z", + "LastSeen": "2017-08-20T15:39:30.913Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 6 + ], + "NScanned": [ + 6 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 349 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/find_3.4.7 b/src/go/tests/expect/stats_single/find_3.4.7 new file mode 100755 index 00000000..90940edf --- /dev/null +++ b/src/go/tests/expect/stats_single/find_3.4.7 @@ -0,0 +1,27 @@ +[ + { + "ID": "4e9241090af6f4a49545baf7c015fb5c", + "Namespace": "test.coll", + "Operation": "query", + "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"query\":{\"find\":\"coll\",\"filter\":{\"a\":1}}}\n", + "Fingerprint": "FIND coll a", + "FirstSeen": "2017-08-20T15:39:37.66Z", + "LastSeen": "2017-08-20T15:39:37.66Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 6 + ], + "NScanned": [ + 6 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 331 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/find_3.5.11 b/src/go/tests/expect/stats_single/find_3.5.11 new file mode 100755 index 00000000..dd1fe141 --- /dev/null +++ b/src/go/tests/expect/stats_single/find_3.5.11 @@ -0,0 +1,27 @@ +[ + { + "ID": "4e9241090af6f4a49545baf7c015fb5c", + "Namespace": "test.coll", + "Operation": "query", + "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"command\":{\"find\":\"coll\",\"filter\":{\"a\":1},\"$db\":\"test\"}}\n", + "Fingerprint": "FIND coll a", + "FirstSeen": "2017-08-20T15:39:48.107Z", + "LastSeen": "2017-08-20T15:39:48.107Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 6 + ], + "NScanned": [ + 6 + ], + "QueryTime": [ + 1 + ], + "ResponseLength": [ + 331 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/find_andrii_2.6.12 b/src/go/tests/expect/stats_single/find_andrii_2.6.12 new file mode 100755 index 00000000..772cac77 --- /dev/null +++ b/src/go/tests/expect/stats_single/find_andrii_2.6.12 @@ -0,0 +1,27 @@ +[ + { + "ID": "dddda7545e797b073966c514f9b6fe49", + "Namespace": "test.coll", + "Operation": "query", + "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"query\":{\"query\":{\"$and\":[{\"k\":{\"$gt\":1}},{\"k\":{\"$lt\":2}},{\"$or\":[{\"c\":{\"$in\":[\"/^0/\",\"/^2/\",\"/^4/\",\"/^6/\"]}},{\"pad\":{\"$in\":[\"/9$/\",\"/7$/\",\"/5$/\",\"/3$/\"]}}]}]},\"orderby\":{\"k\":-1}}}\n", + "Fingerprint": "FIND coll c,k,pad", + "FirstSeen": "2017-08-20T15:39:15.616Z", + "LastSeen": "2017-08-20T15:39:15.616Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 20 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/find_andrii_3.0.15 b/src/go/tests/expect/stats_single/find_andrii_3.0.15 new file mode 100755 index 00000000..51158b39 --- /dev/null +++ b/src/go/tests/expect/stats_single/find_andrii_3.0.15 @@ -0,0 +1,27 @@ +[ + { + "ID": "dddda7545e797b073966c514f9b6fe49", + "Namespace": "test.coll", + "Operation": "query", + "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"query\":{\"query\":{\"$and\":[{\"k\":{\"$gt\":1}},{\"k\":{\"$lt\":2}},{\"$or\":[{\"c\":{\"$in\":[\"/^0/\",\"/^2/\",\"/^4/\",\"/^6/\"]}},{\"pad\":{\"$in\":[\"/9$/\",\"/7$/\",\"/5$/\",\"/3$/\"]}}]}]},\"orderby\":{\"k\":-1}}}\n", + "Fingerprint": "FIND coll c,k,pad", + "FirstSeen": "2017-08-20T15:39:21.656Z", + "LastSeen": "2017-08-20T15:39:21.656Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 20 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/find_andrii_3.2.16 b/src/go/tests/expect/stats_single/find_andrii_3.2.16 new file mode 100755 index 00000000..4d7551d0 --- /dev/null +++ b/src/go/tests/expect/stats_single/find_andrii_3.2.16 @@ -0,0 +1,27 @@ +[ + { + "ID": "dddda7545e797b073966c514f9b6fe49", + "Namespace": "test.coll", + "Operation": "query", + "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"query\":{\"find\":\"coll\",\"filter\":{\"$and\":[{\"k\":{\"$gt\":1}},{\"k\":{\"$lt\":2}},{\"$or\":[{\"c\":{\"$in\":[\"/^0/\",\"/^2/\",\"/^4/\",\"/^6/\"]}},{\"pad\":{\"$in\":[\"/9$/\",\"/7$/\",\"/5$/\",\"/3$/\"]}}]}]},\"limit\":100,\"singleBatch\":false,\"sort\":{\"k\":-1}}}\n", + "Fingerprint": "FIND coll c,k,pad", + "FirstSeen": "2017-08-20T15:39:31.085Z", + "LastSeen": "2017-08-20T15:39:31.085Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 49 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 100 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/find_andrii_3.4.7 b/src/go/tests/expect/stats_single/find_andrii_3.4.7 new file mode 100755 index 00000000..6f1d5db0 --- /dev/null +++ b/src/go/tests/expect/stats_single/find_andrii_3.4.7 @@ -0,0 +1,27 @@ +[ + { + "ID": "dddda7545e797b073966c514f9b6fe49", + "Namespace": "test.coll", + "Operation": "query", + "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"query\":{\"find\":\"coll\",\"filter\":{\"$and\":[{\"k\":{\"$gt\":1}},{\"k\":{\"$lt\":2}},{\"$or\":[{\"c\":{\"$in\":[\"/^0/\",\"/^2/\",\"/^4/\",\"/^6/\"]}},{\"pad\":{\"$in\":[\"/9$/\",\"/7$/\",\"/5$/\",\"/3$/\"]}}]}]},\"limit\":100,\"singleBatch\":false,\"sort\":{\"k\":-1}}}\n", + "Fingerprint": "FIND coll c,k,pad", + "FirstSeen": "2017-08-20T15:39:37.823Z", + "LastSeen": "2017-08-20T15:39:37.823Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 49 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 82 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/find_andrii_3.5.11 b/src/go/tests/expect/stats_single/find_andrii_3.5.11 new file mode 100755 index 00000000..cbcd190d --- /dev/null +++ b/src/go/tests/expect/stats_single/find_andrii_3.5.11 @@ -0,0 +1,27 @@ +[ + { + "ID": "dddda7545e797b073966c514f9b6fe49", + "Namespace": "test.coll", + "Operation": "query", + "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"command\":{\"find\":\"coll\",\"filter\":{\"$and\":[{\"k\":{\"$gt\":1}},{\"k\":{\"$lt\":2}},{\"$or\":[{\"c\":{\"$in\":[\"/^0/\",\"/^2/\",\"/^4/\",\"/^6/\"]}},{\"pad\":{\"$in\":[\"/9$/\",\"/7$/\",\"/5$/\",\"/3$/\"]}}]}]},\"limit\":100,\"singleBatch\":false,\"sort\":{\"k\":-1},\"$db\":\"test\"}}\n", + "Fingerprint": "FIND coll c,k,pad", + "FirstSeen": "2017-08-20T15:39:48.277Z", + "LastSeen": "2017-08-20T15:39:48.277Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 49 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 82 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/find_empty_2.6.12 b/src/go/tests/expect/stats_single/find_empty_2.6.12 new file mode 100755 index 00000000..7a222871 --- /dev/null +++ b/src/go/tests/expect/stats_single/find_empty_2.6.12 @@ -0,0 +1,27 @@ +[ + { + "ID": "b9a4b74ac8b3747f44951490e6279b96", + "Namespace": "test.coll", + "Operation": "query", + "Query": "{\"ns\":\"test.coll\",\"op\":\"query\"}\n", + "Fingerprint": "FIND coll", + "FirstSeen": "2017-08-20T15:39:15.75Z", + "LastSeen": "2017-08-20T15:39:15.75Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 49 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 1846 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/find_empty_3.0.15 b/src/go/tests/expect/stats_single/find_empty_3.0.15 new file mode 100755 index 00000000..7a699886 --- /dev/null +++ b/src/go/tests/expect/stats_single/find_empty_3.0.15 @@ -0,0 +1,27 @@ +[ + { + "ID": "b9a4b74ac8b3747f44951490e6279b96", + "Namespace": "test.coll", + "Operation": "query", + "Query": "{\"ns\":\"test.coll\",\"op\":\"query\"}\n", + "Fingerprint": "FIND coll", + "FirstSeen": "2017-08-20T15:39:21.769Z", + "LastSeen": "2017-08-20T15:39:21.769Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 49 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 1846 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/find_empty_3.2.16 b/src/go/tests/expect/stats_single/find_empty_3.2.16 new file mode 100755 index 00000000..8ef5e7b0 --- /dev/null +++ b/src/go/tests/expect/stats_single/find_empty_3.2.16 @@ -0,0 +1,27 @@ +[ + { + "ID": "b9a4b74ac8b3747f44951490e6279b96", + "Namespace": "test.coll", + "Operation": "query", + "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"query\":{\"find\":\"coll\",\"filter\":{}}}\n", + "Fingerprint": "FIND coll", + "FirstSeen": "2017-08-20T15:39:31.294Z", + "LastSeen": "2017-08-20T15:39:31.294Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 49 + ], + "NScanned": [ + 49 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 2112 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/find_empty_3.4.7 b/src/go/tests/expect/stats_single/find_empty_3.4.7 new file mode 100755 index 00000000..494082cf --- /dev/null +++ b/src/go/tests/expect/stats_single/find_empty_3.4.7 @@ -0,0 +1,27 @@ +[ + { + "ID": "b9a4b74ac8b3747f44951490e6279b96", + "Namespace": "test.coll", + "Operation": "query", + "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"query\":{\"find\":\"coll\",\"filter\":{}}}\n", + "Fingerprint": "FIND coll", + "FirstSeen": "2017-08-20T15:39:37.964Z", + "LastSeen": "2017-08-20T15:39:37.964Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 49 + ], + "NScanned": [ + 49 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 2094 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/find_empty_3.5.11 b/src/go/tests/expect/stats_single/find_empty_3.5.11 new file mode 100755 index 00000000..a01d4131 --- /dev/null +++ b/src/go/tests/expect/stats_single/find_empty_3.5.11 @@ -0,0 +1,27 @@ +[ + { + "ID": "b9a4b74ac8b3747f44951490e6279b96", + "Namespace": "test.coll", + "Operation": "query", + "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"command\":{\"find\":\"coll\",\"filter\":{},\"$db\":\"test\"}}\n", + "Fingerprint": "FIND coll", + "FirstSeen": "2017-08-20T15:39:48.429Z", + "LastSeen": "2017-08-20T15:39:48.429Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 49 + ], + "NScanned": [ + 49 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 2094 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/findandmodify_2.6.12 b/src/go/tests/expect/stats_single/findandmodify_2.6.12 new file mode 100755 index 00000000..ad3022c9 --- /dev/null +++ b/src/go/tests/expect/stats_single/findandmodify_2.6.12 @@ -0,0 +1,27 @@ +[ + { + "ID": "3d52ee232b8c4e1068dd90741632614a", + "Namespace": "test.$cmd", + "Operation": "command", + "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"findandmodify\":\"coll\",\"query\":{\"a\":2},\"update\":{\"$inc\":{\"b\":1}}},\"updateobj\":{\"$inc\":{\"b\":1}}}\n", + "Fingerprint": "FINDANDMODIFY coll a", + "FirstSeen": "2017-08-20T15:39:15.903Z", + "LastSeen": "2017-08-20T15:39:15.903Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 131 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/findandmodify_3.0.15 b/src/go/tests/expect/stats_single/findandmodify_3.0.15 new file mode 100755 index 00000000..527cada3 --- /dev/null +++ b/src/go/tests/expect/stats_single/findandmodify_3.0.15 @@ -0,0 +1,27 @@ +[ + { + "ID": "3d52ee232b8c4e1068dd90741632614a", + "Namespace": "test.$cmd", + "Operation": "command", + "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"findandmodify\":\"coll\",\"query\":{\"a\":2},\"update\":{\"$inc\":{\"b\":1}}},\"updateobj\":{\"$inc\":{\"b\":1}}}\n", + "Fingerprint": "FINDANDMODIFY coll a", + "FirstSeen": "2017-08-20T15:39:21.902Z", + "LastSeen": "2017-08-20T15:39:21.902Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 131 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/findandmodify_3.2.16 b/src/go/tests/expect/stats_single/findandmodify_3.2.16 new file mode 100755 index 00000000..e6d5143e --- /dev/null +++ b/src/go/tests/expect/stats_single/findandmodify_3.2.16 @@ -0,0 +1,27 @@ +[ + { + "ID": "9423eaa90c222686d092c04f001fb369", + "Namespace": "test.coll", + "Operation": "command", + "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"findandmodify\":\"coll\",\"query\":{\"a\":2},\"update\":{\"$inc\":{\"b\":1}}},\"updateobj\":{\"$inc\":{\"b\":1}}}\n", + "Fingerprint": "FINDANDMODIFY coll a", + "FirstSeen": "2017-08-20T15:39:31.548Z", + "LastSeen": "2017-08-20T15:39:31.548Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 3 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 116 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/findandmodify_3.4.7 b/src/go/tests/expect/stats_single/findandmodify_3.4.7 new file mode 100755 index 00000000..76565000 --- /dev/null +++ b/src/go/tests/expect/stats_single/findandmodify_3.4.7 @@ -0,0 +1,27 @@ +[ + { + "ID": "9423eaa90c222686d092c04f001fb369", + "Namespace": "test.coll", + "Operation": "command", + "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"findandmodify\":\"coll\",\"query\":{\"a\":2},\"update\":{\"$inc\":{\"b\":1}}},\"updateobj\":{\"$inc\":{\"b\":1}}}\n", + "Fingerprint": "FINDANDMODIFY coll a", + "FirstSeen": "2017-08-20T15:39:38.196Z", + "LastSeen": "2017-08-20T15:39:38.196Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 3 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 116 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/findandmodify_3.5.11 b/src/go/tests/expect/stats_single/findandmodify_3.5.11 new file mode 100755 index 00000000..15d8f9b6 --- /dev/null +++ b/src/go/tests/expect/stats_single/findandmodify_3.5.11 @@ -0,0 +1,27 @@ +[ + { + "ID": "9423eaa90c222686d092c04f001fb369", + "Namespace": "test.coll", + "Operation": "command", + "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"findandmodify\":\"coll\",\"query\":{\"a\":2},\"update\":{\"$inc\":{\"b\":1}},\"$db\":\"test\"}}\n", + "Fingerprint": "FINDANDMODIFY coll a", + "FirstSeen": "2017-08-20T15:39:48.636Z", + "LastSeen": "2017-08-20T15:39:48.636Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 3 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 116 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/geonear_2.6.12 b/src/go/tests/expect/stats_single/geonear_2.6.12 new file mode 100755 index 00000000..c8552af3 --- /dev/null +++ b/src/go/tests/expect/stats_single/geonear_2.6.12 @@ -0,0 +1,27 @@ +[ + { + "ID": "eb3d8174e05f442cc5c3269eb50667d6", + "Namespace": "test.$cmd", + "Operation": "command", + "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"geoNear\":\"coll\",\"near\":{\"type\":\"Point\",\"coordinates\":[1,1]},\"spherical\":true}}\n", + "Fingerprint": "GEONEAR coll", + "FirstSeen": "2017-08-20T15:39:16.061Z", + "LastSeen": "2017-08-20T15:39:16.061Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 1 + ], + "ResponseLength": [ + 1406 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/geonear_3.0.15 b/src/go/tests/expect/stats_single/geonear_3.0.15 new file mode 100755 index 00000000..3ebbe6e5 --- /dev/null +++ b/src/go/tests/expect/stats_single/geonear_3.0.15 @@ -0,0 +1,27 @@ +[ + { + "ID": "eb3d8174e05f442cc5c3269eb50667d6", + "Namespace": "test.$cmd", + "Operation": "command", + "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"geoNear\":\"coll\",\"near\":{\"type\":\"Point\",\"coordinates\":[1,1]},\"spherical\":true}}\n", + "Fingerprint": "GEONEAR coll", + "FirstSeen": "2017-08-20T15:39:22.055Z", + "LastSeen": "2017-08-20T15:39:22.055Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 3 + ], + "ResponseLength": [ + 1398 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/geonear_3.2.16 b/src/go/tests/expect/stats_single/geonear_3.2.16 new file mode 100755 index 00000000..520db8ab --- /dev/null +++ b/src/go/tests/expect/stats_single/geonear_3.2.16 @@ -0,0 +1,27 @@ +[ + { + "ID": "dd20c739baef5a3fd9352c350c7e69f1", + "Namespace": "test.coll", + "Operation": "command", + "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"geoNear\":\"coll\",\"near\":{\"type\":\"Point\",\"coordinates\":[1,1]},\"spherical\":true}}\n", + "Fingerprint": "GEONEAR coll", + "FirstSeen": "2017-08-20T15:39:31.797Z", + "LastSeen": "2017-08-20T15:39:31.797Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 8 + ], + "ResponseLength": [ + 1401 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/geonear_3.4.7 b/src/go/tests/expect/stats_single/geonear_3.4.7 new file mode 100755 index 00000000..15fdaf43 --- /dev/null +++ b/src/go/tests/expect/stats_single/geonear_3.4.7 @@ -0,0 +1,27 @@ +[ + { + "ID": "dd20c739baef5a3fd9352c350c7e69f1", + "Namespace": "test.coll", + "Operation": "command", + "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"geoNear\":\"coll\",\"near\":{\"type\":\"Point\",\"coordinates\":[1,1]},\"spherical\":true}}\n", + "Fingerprint": "GEONEAR coll", + "FirstSeen": "2017-08-20T15:39:38.432Z", + "LastSeen": "2017-08-20T15:39:38.432Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 10 + ], + "QueryTime": [ + 11 + ], + "ResponseLength": [ + 1383 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/geonear_3.5.11 b/src/go/tests/expect/stats_single/geonear_3.5.11 new file mode 100755 index 00000000..33edc9df --- /dev/null +++ b/src/go/tests/expect/stats_single/geonear_3.5.11 @@ -0,0 +1,27 @@ +[ + { + "ID": "dd20c739baef5a3fd9352c350c7e69f1", + "Namespace": "test.coll", + "Operation": "command", + "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"geoNear\":\"coll\",\"near\":{\"type\":\"Point\",\"coordinates\":[1,1]},\"spherical\":true,\"$db\":\"test\"}}\n", + "Fingerprint": "GEONEAR coll", + "FirstSeen": "2017-08-20T15:39:48.842Z", + "LastSeen": "2017-08-20T15:39:48.842Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 10 + ], + "QueryTime": [ + 7 + ], + "ResponseLength": [ + 1383 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/group_2.6.12 b/src/go/tests/expect/stats_single/group_2.6.12 new file mode 100755 index 00000000..b3b28131 --- /dev/null +++ b/src/go/tests/expect/stats_single/group_2.6.12 @@ -0,0 +1,27 @@ +[ + { + "ID": "225e5819de843c1779f1118f2f01b77e", + "Namespace": "test.$cmd", + "Operation": "command", + "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"group\":{\"key\":{\"a\":1,\"b\":1},\"cond\":{\"b\":3},\"initial\":{},\"ns\":\"coll\",\"$reduce\":\"\"}}}\n", + "Fingerprint": "GROUP coll a,b", + "FirstSeen": "2017-08-20T15:39:16.325Z", + "LastSeen": "2017-08-20T15:39:16.325Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 77 + ], + "ResponseLength": [ + 135 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/group_3.0.15 b/src/go/tests/expect/stats_single/group_3.0.15 new file mode 100755 index 00000000..a1e96670 --- /dev/null +++ b/src/go/tests/expect/stats_single/group_3.0.15 @@ -0,0 +1,27 @@ +[ + { + "ID": "225e5819de843c1779f1118f2f01b77e", + "Namespace": "test.$cmd", + "Operation": "command", + "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"group\":{\"key\":{\"a\":1,\"b\":1},\"cond\":{\"b\":3},\"initial\":{},\"ns\":\"coll\",\"$reduce\":\"\"}}}\n", + "Fingerprint": "GROUP coll a,b", + "FirstSeen": "2017-08-20T15:39:22.271Z", + "LastSeen": "2017-08-20T15:39:22.271Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 54 + ], + "ResponseLength": [ + 139 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/group_3.2.16 b/src/go/tests/expect/stats_single/group_3.2.16 new file mode 100755 index 00000000..cbf45bf4 --- /dev/null +++ b/src/go/tests/expect/stats_single/group_3.2.16 @@ -0,0 +1,27 @@ +[ + { + "ID": "018a055f724d418b80e66b98bfdb25a5", + "Namespace": "test.coll", + "Operation": "command", + "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"group\":{\"key\":{\"a\":1,\"b\":1},\"cond\":{\"b\":3},\"initial\":{},\"ns\":\"coll\",\"$reduce\":\"\"}}}\n", + "Fingerprint": "GROUP coll a,b", + "FirstSeen": "2017-08-20T15:39:32.101Z", + "LastSeen": "2017-08-20T15:39:32.101Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 74 + ], + "ResponseLength": [ + 142 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/group_3.4.7 b/src/go/tests/expect/stats_single/group_3.4.7 new file mode 100755 index 00000000..d1c8e3d8 --- /dev/null +++ b/src/go/tests/expect/stats_single/group_3.4.7 @@ -0,0 +1,27 @@ +[ + { + "ID": "018a055f724d418b80e66b98bfdb25a5", + "Namespace": "test.coll", + "Operation": "command", + "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"group\":{\"key\":{\"a\":1,\"b\":1},\"cond\":{\"b\":3},\"initial\":{},\"ns\":\"coll\",\"$reduce\":{\"code\":\"function () {}\"}}}}\n", + "Fingerprint": "GROUP coll a,b", + "FirstSeen": "2017-08-20T15:39:38.886Z", + "LastSeen": "2017-08-20T15:39:38.886Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 2 + ], + "QueryTime": [ + 77 + ], + "ResponseLength": [ + 124 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/group_3.5.11 b/src/go/tests/expect/stats_single/group_3.5.11 new file mode 100755 index 00000000..2d91c5f9 --- /dev/null +++ b/src/go/tests/expect/stats_single/group_3.5.11 @@ -0,0 +1,27 @@ +[ + { + "ID": "018a055f724d418b80e66b98bfdb25a5", + "Namespace": "test.coll", + "Operation": "command", + "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"group\":{\"key\":{\"a\":1,\"b\":1},\"cond\":{\"b\":3},\"initial\":{},\"ns\":\"coll\",\"$reduce\":{\"code\":\"function () {}\"}},\"$db\":\"test\"}}\n", + "Fingerprint": "GROUP coll a,b", + "FirstSeen": "2017-08-20T15:39:49.276Z", + "LastSeen": "2017-08-20T15:39:49.276Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 2 + ], + "QueryTime": [ + 68 + ], + "ResponseLength": [ + 124 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/insert_2.6.12 b/src/go/tests/expect/stats_single/insert_2.6.12 new file mode 100755 index 00000000..58dc5cbb --- /dev/null +++ b/src/go/tests/expect/stats_single/insert_2.6.12 @@ -0,0 +1,27 @@ +[ + { + "ID": "a7ce8dee16beadb767484112e6b29af3", + "Namespace": "test.coll", + "Operation": "insert", + "Query": "{\"ns\":\"test.coll\",\"op\":\"insert\",\"query\":{\"_id\":1}}\n", + "Fingerprint": "INSERT coll", + "FirstSeen": "2017-08-20T15:39:16.473Z", + "LastSeen": "2017-08-20T15:39:16.473Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 0 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/insert_3.0.15 b/src/go/tests/expect/stats_single/insert_3.0.15 new file mode 100755 index 00000000..24de4102 --- /dev/null +++ b/src/go/tests/expect/stats_single/insert_3.0.15 @@ -0,0 +1,27 @@ +[ + { + "ID": "a7ce8dee16beadb767484112e6b29af3", + "Namespace": "test.coll", + "Operation": "insert", + "Query": "{\"ns\":\"test.coll\",\"op\":\"insert\",\"query\":{\"_id\":1}}\n", + "Fingerprint": "INSERT coll", + "FirstSeen": "2017-08-20T15:39:22.409Z", + "LastSeen": "2017-08-20T15:39:22.409Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 0 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/insert_3.2.16 b/src/go/tests/expect/stats_single/insert_3.2.16 new file mode 100755 index 00000000..4bf55eda --- /dev/null +++ b/src/go/tests/expect/stats_single/insert_3.2.16 @@ -0,0 +1,27 @@ +[ + { + "ID": "a7ce8dee16beadb767484112e6b29af3", + "Namespace": "test.coll", + "Operation": "insert", + "Query": "{\"ns\":\"test.coll\",\"op\":\"insert\",\"query\":{\"insert\":\"coll\",\"documents\":[{\"_id\":1}],\"ordered\":true}}\n", + "Fingerprint": "INSERT coll", + "FirstSeen": "2017-08-20T15:39:32.303Z", + "LastSeen": "2017-08-20T15:39:32.303Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 25 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/insert_3.4.7 b/src/go/tests/expect/stats_single/insert_3.4.7 new file mode 100755 index 00000000..e7fafcae --- /dev/null +++ b/src/go/tests/expect/stats_single/insert_3.4.7 @@ -0,0 +1,27 @@ +[ + { + "ID": "a7ce8dee16beadb767484112e6b29af3", + "Namespace": "test.coll", + "Operation": "insert", + "Query": "{\"ns\":\"test.coll\",\"op\":\"insert\",\"query\":{\"insert\":\"coll\",\"documents\":[{\"_id\":1}],\"ordered\":true}}\n", + "Fingerprint": "INSERT coll", + "FirstSeen": "2017-08-20T15:39:39.023Z", + "LastSeen": "2017-08-20T15:39:39.023Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 29 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/insert_3.5.11 b/src/go/tests/expect/stats_single/insert_3.5.11 new file mode 100755 index 00000000..869e234c --- /dev/null +++ b/src/go/tests/expect/stats_single/insert_3.5.11 @@ -0,0 +1,27 @@ +[ + { + "ID": "a7ce8dee16beadb767484112e6b29af3", + "Namespace": "test.coll", + "Operation": "insert", + "Query": "{\"ns\":\"test.coll\",\"op\":\"insert\",\"command\":{\"insert\":\"coll\",\"ordered\":true,\"$db\":\"test\"}}\n", + "Fingerprint": "INSERT coll", + "FirstSeen": "2017-08-20T15:39:49.44Z", + "LastSeen": "2017-08-20T15:39:49.44Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 29 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/mapreduce_2.6.12 b/src/go/tests/expect/stats_single/mapreduce_2.6.12 new file mode 100755 index 00000000..13c867a4 --- /dev/null +++ b/src/go/tests/expect/stats_single/mapreduce_2.6.12 @@ -0,0 +1,27 @@ +[ + { + "ID": "23ca094f285d0cd9538fb1b1f6ef0f4f", + "Namespace": "test.$cmd", + "Operation": "command", + "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"mapreduce\":\"coll\",\"map\":\"\",\"reduce\":\"\",\"query\":{\"a\":{\"$gte\":0}},\"out\":{\"inline\":1}}}\n", + "Fingerprint": "MAPREDUCE coll a", + "FirstSeen": "2017-08-20T15:39:16.701Z", + "LastSeen": "2017-08-20T15:39:16.701Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 33 + ], + "ResponseLength": [ + 233 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/mapreduce_3.0.15 b/src/go/tests/expect/stats_single/mapreduce_3.0.15 new file mode 100755 index 00000000..8b81c024 --- /dev/null +++ b/src/go/tests/expect/stats_single/mapreduce_3.0.15 @@ -0,0 +1,27 @@ +[ + { + "ID": "23ca094f285d0cd9538fb1b1f6ef0f4f", + "Namespace": "test.$cmd", + "Operation": "command", + "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"mapreduce\":\"coll\",\"map\":\"\",\"reduce\":\"\",\"query\":{\"a\":{\"$gte\":0}},\"out\":{\"inline\":1}}}\n", + "Fingerprint": "MAPREDUCE coll a", + "FirstSeen": "2017-08-20T15:39:22.582Z", + "LastSeen": "2017-08-20T15:39:22.582Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 26 + ], + "ResponseLength": [ + 233 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/mapreduce_3.2.16 b/src/go/tests/expect/stats_single/mapreduce_3.2.16 new file mode 100755 index 00000000..c61f9205 --- /dev/null +++ b/src/go/tests/expect/stats_single/mapreduce_3.2.16 @@ -0,0 +1,27 @@ +[ + { + "ID": "130827f5b7afe1369f619ccd5cd61ec4", + "Namespace": "test.coll", + "Operation": "command", + "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"mapreduce\":\"coll\",\"map\":\"\",\"reduce\":\"\",\"query\":{\"a\":{\"$gte\":0}},\"out\":{\"inline\":1}}}\n", + "Fingerprint": "MAPREDUCE coll a", + "FirstSeen": "2017-08-20T15:39:32.572Z", + "LastSeen": "2017-08-20T15:39:32.572Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 31 + ], + "ResponseLength": [ + 218 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/mapreduce_3.4.7 b/src/go/tests/expect/stats_single/mapreduce_3.4.7 new file mode 100755 index 00000000..15ca2d6c --- /dev/null +++ b/src/go/tests/expect/stats_single/mapreduce_3.4.7 @@ -0,0 +1,27 @@ +[ + { + "ID": "130827f5b7afe1369f619ccd5cd61ec4", + "Namespace": "test.coll", + "Operation": "command", + "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"mapreduce\":\"coll\",\"map\":{\"code\":\"function () {\\n emit(this.a, this.b);\\n}\"},\"reduce\":{\"code\":\"function (a, b) {\\n return Array.sum(b);\\n}\"},\"query\":{\"a\":{\"$gte\":0}},\"out\":{\"inline\":1}}}\n", + "Fingerprint": "MAPREDUCE coll a", + "FirstSeen": "2017-08-20T15:39:39.249Z", + "LastSeen": "2017-08-20T15:39:39.249Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 3 + ], + "QueryTime": [ + 43 + ], + "ResponseLength": [ + 218 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/mapreduce_3.5.11 b/src/go/tests/expect/stats_single/mapreduce_3.5.11 new file mode 100755 index 00000000..5c88a2d6 --- /dev/null +++ b/src/go/tests/expect/stats_single/mapreduce_3.5.11 @@ -0,0 +1,27 @@ +[ + { + "ID": "130827f5b7afe1369f619ccd5cd61ec4", + "Namespace": "test.coll", + "Operation": "command", + "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"mapreduce\":\"coll\",\"map\":{\"code\":\"function () {\\n emit(this.a, this.b);\\n}\"},\"reduce\":{\"code\":\"function (a, b) {\\n return Array.sum(b);\\n}\"},\"query\":{\"a\":{\"$gte\":0}},\"out\":{\"inline\":1},\"$db\":\"test\"}}\n", + "Fingerprint": "MAPREDUCE coll a", + "FirstSeen": "2017-08-20T15:39:49.68Z", + "LastSeen": "2017-08-20T15:39:49.68Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 3 + ], + "QueryTime": [ + 35 + ], + "ResponseLength": [ + 218 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/update_2.6.12 b/src/go/tests/expect/stats_single/update_2.6.12 new file mode 100755 index 00000000..f5a0258b --- /dev/null +++ b/src/go/tests/expect/stats_single/update_2.6.12 @@ -0,0 +1,27 @@ +[ + { + "ID": "27cb39e62745b1ff4121b4bf6f21fb12", + "Namespace": "test.coll", + "Operation": "update", + "Query": "{\"ns\":\"test.coll\",\"op\":\"update\",\"query\":{\"a\":{\"$gte\":2}},\"updateobj\":{\"$set\":{\"c\":1},\"$inc\":{\"a\":-10}}}\n", + "Fingerprint": "UPDATE coll a", + "FirstSeen": "2017-08-20T15:39:16.921Z", + "LastSeen": "2017-08-20T15:39:16.921Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 0 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/update_3.0.15 b/src/go/tests/expect/stats_single/update_3.0.15 new file mode 100755 index 00000000..1c17a420 --- /dev/null +++ b/src/go/tests/expect/stats_single/update_3.0.15 @@ -0,0 +1,27 @@ +[ + { + "ID": "27cb39e62745b1ff4121b4bf6f21fb12", + "Namespace": "test.coll", + "Operation": "update", + "Query": "{\"ns\":\"test.coll\",\"op\":\"update\",\"query\":{\"a\":{\"$gte\":2}},\"updateobj\":{\"$set\":{\"c\":1},\"$inc\":{\"a\":-10}}}\n", + "Fingerprint": "UPDATE coll a", + "FirstSeen": "2017-08-20T15:39:22.788Z", + "LastSeen": "2017-08-20T15:39:22.788Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 0 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/update_3.2.16 b/src/go/tests/expect/stats_single/update_3.2.16 new file mode 100755 index 00000000..dd8c4e4b --- /dev/null +++ b/src/go/tests/expect/stats_single/update_3.2.16 @@ -0,0 +1,27 @@ +[ + { + "ID": "27cb39e62745b1ff4121b4bf6f21fb12", + "Namespace": "test.coll", + "Operation": "update", + "Query": "{\"ns\":\"test.coll\",\"op\":\"update\",\"query\":{\"a\":{\"$gte\":2}},\"updateobj\":{\"$set\":{\"c\":1},\"$inc\":{\"a\":-10}}}\n", + "Fingerprint": "UPDATE coll a", + "FirstSeen": "2017-08-20T15:39:32.737Z", + "LastSeen": "2017-08-20T15:39:32.737Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 1 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 0 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/update_3.4.7 b/src/go/tests/expect/stats_single/update_3.4.7 new file mode 100755 index 00000000..cd7a0257 --- /dev/null +++ b/src/go/tests/expect/stats_single/update_3.4.7 @@ -0,0 +1,27 @@ +[ + { + "ID": "27cb39e62745b1ff4121b4bf6f21fb12", + "Namespace": "test.coll", + "Operation": "update", + "Query": "{\"ns\":\"test.coll\",\"op\":\"update\",\"query\":{\"a\":{\"$gte\":2}},\"updateobj\":{\"$set\":{\"c\":1},\"$inc\":{\"a\":-10}}}\n", + "Fingerprint": "UPDATE coll a", + "FirstSeen": "2017-08-20T15:39:39.434Z", + "LastSeen": "2017-08-20T15:39:39.434Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 1 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 0 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/update_3.5.11 b/src/go/tests/expect/stats_single/update_3.5.11 new file mode 100755 index 00000000..e389f127 --- /dev/null +++ b/src/go/tests/expect/stats_single/update_3.5.11 @@ -0,0 +1,27 @@ +[ + { + "ID": "27cb39e62745b1ff4121b4bf6f21fb12", + "Namespace": "test.coll", + "Operation": "update", + "Query": "{\"ns\":\"test.coll\",\"op\":\"update\",\"command\":{\"q\":{\"a\":{\"$gte\":2}},\"u\":{\"$set\":{\"c\":1},\"$inc\":{\"a\":-10}},\"multi\":false,\"upsert\":false}}\n", + "Fingerprint": "UPDATE coll a", + "FirstSeen": "2017-08-20T15:39:49.855Z", + "LastSeen": "2017-08-20T15:39:49.855Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 1 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 0 + ] + } +] \ No newline at end of file From 65b99c905d93aafb1e394565dd3dc0b0c37c067d Mon Sep 17 00:00:00 2001 From: Kamil Dziedzic Date: Thu, 14 Sep 2017 22:18:39 +0200 Subject: [PATCH 073/104] fix tests --- src/go/mongolib/proto/system.profile.go | 1 + src/go/mongolib/stats/stats.go | 1 + src/go/tests/expect/stats_all/sum.json | 22 +++++++++---------- .../tests/expect/stats_single/explain_2.6.12 | 2 +- src/go/tests/expect/stats_single/find_2.6.12 | 2 +- src/go/tests/expect/stats_single/find_3.0.15 | 2 +- .../expect/stats_single/find_andrii_2.6.12 | 2 +- .../expect/stats_single/find_andrii_3.0.15 | 2 +- .../expect/stats_single/find_empty_2.6.12 | 2 +- .../expect/stats_single/find_empty_3.0.15 | 2 +- .../expect/stats_single/findandmodify_2.6.12 | 2 +- .../expect/stats_single/findandmodify_3.0.15 | 2 +- .../tests/expect/stats_single/update_2.6.12 | 2 +- .../tests/expect/stats_single/update_3.0.15 | 2 +- 14 files changed, 24 insertions(+), 22 deletions(-) diff --git a/src/go/mongolib/proto/system.profile.go b/src/go/mongolib/proto/system.profile.go index 8c39f8e0..73a1426d 100644 --- a/src/go/mongolib/proto/system.profile.go +++ b/src/go/mongolib/proto/system.profile.go @@ -8,6 +8,7 @@ import ( ) // docsExamined is renamed from nscannedObjects in 3.2.0 +// https://docs.mongodb.com/manual/reference/database-profiler/#system.profile.docsExamined type SystemProfile struct { AllUsers []interface{} `bson:"allUsers"` Client string `bson:"client"` diff --git a/src/go/mongolib/stats/stats.go b/src/go/mongolib/stats/stats.go index 024144d2..0e4864b4 100644 --- a/src/go/mongolib/stats/stats.go +++ b/src/go/mongolib/stats/stats.go @@ -91,6 +91,7 @@ func (s *Stats) Add(doc proto.SystemProfile) error { } qiac.Count++ // docsExamined is renamed from nscannedObjects in 3.2.0. + // https://docs.mongodb.com/manual/reference/database-profiler/#system.profile.docsExamined if doc.NscannedObjects > 0 { qiac.NScanned = append(qiac.NScanned, float64(doc.NscannedObjects)) } else { diff --git a/src/go/tests/expect/stats_all/sum.json b/src/go/tests/expect/stats_all/sum.json index 3280a0d1..7f868657 100755 --- a/src/go/tests/expect/stats_all/sum.json +++ b/src/go/tests/expect/stats_all/sum.json @@ -186,8 +186,8 @@ 0 ], "NScanned": [ - 0, - 0 + 1, + 1 ], "QueryTime": [ 0, @@ -672,7 +672,7 @@ 1 ], "NScanned": [ - 0 + 44 ], "QueryTime": [ 0 @@ -701,8 +701,8 @@ 49 ], "NScanned": [ - 0, - 0, + 49, + 49, 49, 49, 49 @@ -742,8 +742,8 @@ 6 ], "NScanned": [ - 0, - 0, + 6, + 6, 6, 6, 6 @@ -783,8 +783,8 @@ 0 ], "NScanned": [ - 0, - 0, + 98, + 98, 49, 49, 49 @@ -885,8 +885,8 @@ 0 ], "NScanned": [ - 0, - 0, + 1, + 1, 1, 1, 1 diff --git a/src/go/tests/expect/stats_single/explain_2.6.12 b/src/go/tests/expect/stats_single/explain_2.6.12 index 66510eb5..686e271f 100755 --- a/src/go/tests/expect/stats_single/explain_2.6.12 +++ b/src/go/tests/expect/stats_single/explain_2.6.12 @@ -15,7 +15,7 @@ 1 ], "NScanned": [ - 0 + 44 ], "QueryTime": [ 0 diff --git a/src/go/tests/expect/stats_single/find_2.6.12 b/src/go/tests/expect/stats_single/find_2.6.12 index 5bebe3e4..f63b1227 100755 --- a/src/go/tests/expect/stats_single/find_2.6.12 +++ b/src/go/tests/expect/stats_single/find_2.6.12 @@ -15,7 +15,7 @@ 6 ], "NScanned": [ - 0 + 6 ], "QueryTime": [ 0 diff --git a/src/go/tests/expect/stats_single/find_3.0.15 b/src/go/tests/expect/stats_single/find_3.0.15 index 51c0e9c7..62d756e8 100755 --- a/src/go/tests/expect/stats_single/find_3.0.15 +++ b/src/go/tests/expect/stats_single/find_3.0.15 @@ -15,7 +15,7 @@ 6 ], "NScanned": [ - 0 + 6 ], "QueryTime": [ 0 diff --git a/src/go/tests/expect/stats_single/find_andrii_2.6.12 b/src/go/tests/expect/stats_single/find_andrii_2.6.12 index 772cac77..9d485ae3 100755 --- a/src/go/tests/expect/stats_single/find_andrii_2.6.12 +++ b/src/go/tests/expect/stats_single/find_andrii_2.6.12 @@ -15,7 +15,7 @@ 0 ], "NScanned": [ - 0 + 98 ], "QueryTime": [ 0 diff --git a/src/go/tests/expect/stats_single/find_andrii_3.0.15 b/src/go/tests/expect/stats_single/find_andrii_3.0.15 index 51158b39..8746f1b2 100755 --- a/src/go/tests/expect/stats_single/find_andrii_3.0.15 +++ b/src/go/tests/expect/stats_single/find_andrii_3.0.15 @@ -15,7 +15,7 @@ 0 ], "NScanned": [ - 0 + 98 ], "QueryTime": [ 0 diff --git a/src/go/tests/expect/stats_single/find_empty_2.6.12 b/src/go/tests/expect/stats_single/find_empty_2.6.12 index 7a222871..4ce7d8aa 100755 --- a/src/go/tests/expect/stats_single/find_empty_2.6.12 +++ b/src/go/tests/expect/stats_single/find_empty_2.6.12 @@ -15,7 +15,7 @@ 49 ], "NScanned": [ - 0 + 49 ], "QueryTime": [ 0 diff --git a/src/go/tests/expect/stats_single/find_empty_3.0.15 b/src/go/tests/expect/stats_single/find_empty_3.0.15 index 7a699886..f4860b5c 100755 --- a/src/go/tests/expect/stats_single/find_empty_3.0.15 +++ b/src/go/tests/expect/stats_single/find_empty_3.0.15 @@ -15,7 +15,7 @@ 49 ], "NScanned": [ - 0 + 49 ], "QueryTime": [ 0 diff --git a/src/go/tests/expect/stats_single/findandmodify_2.6.12 b/src/go/tests/expect/stats_single/findandmodify_2.6.12 index ad3022c9..287b7faf 100755 --- a/src/go/tests/expect/stats_single/findandmodify_2.6.12 +++ b/src/go/tests/expect/stats_single/findandmodify_2.6.12 @@ -15,7 +15,7 @@ 0 ], "NScanned": [ - 0 + 1 ], "QueryTime": [ 0 diff --git a/src/go/tests/expect/stats_single/findandmodify_3.0.15 b/src/go/tests/expect/stats_single/findandmodify_3.0.15 index 527cada3..1c40b8fc 100755 --- a/src/go/tests/expect/stats_single/findandmodify_3.0.15 +++ b/src/go/tests/expect/stats_single/findandmodify_3.0.15 @@ -15,7 +15,7 @@ 0 ], "NScanned": [ - 0 + 1 ], "QueryTime": [ 0 diff --git a/src/go/tests/expect/stats_single/update_2.6.12 b/src/go/tests/expect/stats_single/update_2.6.12 index f5a0258b..479a30dd 100755 --- a/src/go/tests/expect/stats_single/update_2.6.12 +++ b/src/go/tests/expect/stats_single/update_2.6.12 @@ -15,7 +15,7 @@ 0 ], "NScanned": [ - 0 + 1 ], "QueryTime": [ 0 diff --git a/src/go/tests/expect/stats_single/update_3.0.15 b/src/go/tests/expect/stats_single/update_3.0.15 index 1c17a420..e55186a7 100755 --- a/src/go/tests/expect/stats_single/update_3.0.15 +++ b/src/go/tests/expect/stats_single/update_3.0.15 @@ -15,7 +15,7 @@ 0 ], "NScanned": [ - 0 + 1 ], "QueryTime": [ 0 From 794999154c22e9a4ebdfd77e7f111c701f1cf358 Mon Sep 17 00:00:00 2001 From: Carlos Salguero Date: Tue, 19 Sep 2017 14:58:26 -0300 Subject: [PATCH 074/104] PT-187 Updated documentation for pt-table-checksum Added info & links regarding the use of CRC32 as the checksum algorithm. --- bin/pt-table-checksum | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/bin/pt-table-checksum b/bin/pt-table-checksum index c9dfbb08..02a32f42 100755 --- a/bin/pt-table-checksum +++ b/bin/pt-table-checksum @@ -11845,6 +11845,15 @@ can try something like the following: SET boundaries = COALESCE(CONCAT('id BETWEEN ', lower_boundary, ' AND ', upper_boundary), '1=1'); +Take into consideration that by default, pt-table-checksum use C checksums. +C is not a cryptographic algorithm and for that reason it is prone to have +collisions. On the other hand, C algorithm is faster and less CPU-intensive +than C and C. + +Related reading material: +Percona Toolkit UDFs: L +How to avoid hash collisions when using MySQL’s CRC32 function: L + =head1 LIMITATIONS =over From 89e700c3c38a1e02d9d818c7dc0b7b191ac9e330 Mon Sep 17 00:00:00 2001 From: Carlos Salguero Date: Thu, 21 Sep 2017 11:31:36 -0300 Subject: [PATCH 075/104] Revert "Turn off statement based binlog checks" --- bin/pt-table-checksum | 57 +++++++++++++++++++++---------------------- 1 file changed, 28 insertions(+), 29 deletions(-) diff --git a/bin/pt-table-checksum b/bin/pt-table-checksum index 02a32f42..32d084bf 100755 --- a/bin/pt-table-checksum +++ b/bin/pt-table-checksum @@ -9331,36 +9331,35 @@ sub main { die "Error setting SQL_MODE" . ": $EVAL_ERROR"; } + - if ( $o->get('check-binlog-format') ) { - # https://bugs.launchpad.net/percona-toolkit/+bug/919352 - # The tool shouldn't blindly attempt to change binlog_format; - # instead, it should check if it's already set to STATEMENT. - # This is becase starting with MySQL 5.1.29, changing the format - # requires a SUPER user. - if ( VersionParser->new($dbh) >= '5.1.5' ) { - $sql = 'SELECT @@binlog_format'; - PTDEBUG && _d($dbh, $sql); - my ($original_binlog_format) = $dbh->selectrow_array($sql); - PTDEBUG && _d('Original binlog_format:', $original_binlog_format); - if ( $original_binlog_format !~ /STATEMENT/i ) { - $sql = q{/*!50108 SET @@binlog_format := 'STATEMENT'*/}; - eval { - PTDEBUG && _d($dbh, $sql); - $dbh->do($sql); - }; - if ( $EVAL_ERROR ) { - die "Failed to $sql: $EVAL_ERROR\n" - . "This tool requires binlog_format=STATEMENT, " - . "but the current binlog_format is set to " - ."$original_binlog_format and an error occurred while " - . "attempting to change it. If running MySQL 5.1.29 or newer, " - . "setting binlog_format requires the SUPER privilege. " - . "You will need to manually set binlog_format to 'STATEMENT' " - . "before running this tool.\n"; - } - } - } + # https://bugs.launchpad.net/percona-toolkit/+bug/919352 + # The tool shouldn't blindly attempt to change binlog_format; + # instead, it should check if it's already set to STATEMENT. + # This is becase starting with MySQL 5.1.29, changing the format + # requires a SUPER user. + if ( VersionParser->new($dbh) >= '5.1.5' ) { + $sql = 'SELECT @@binlog_format'; + PTDEBUG && _d($dbh, $sql); + my ($original_binlog_format) = $dbh->selectrow_array($sql); + PTDEBUG && _d('Original binlog_format:', $original_binlog_format); + if ( $original_binlog_format !~ /STATEMENT/i ) { + $sql = q{/*!50108 SET @@binlog_format := 'STATEMENT'*/}; + eval { + PTDEBUG && _d($dbh, $sql); + $dbh->do($sql); + }; + if ( $EVAL_ERROR ) { + die "Failed to $sql: $EVAL_ERROR\n" + . "This tool requires binlog_format=STATEMENT, " + . "but the current binlog_format is set to " + ."$original_binlog_format and an error occurred while " + . "attempting to change it. If running MySQL 5.1.29 or newer, " + . "setting binlog_format requires the SUPER privilege. " + . "You will need to manually set binlog_format to 'STATEMENT' " + . "before running this tool.\n"; + } + } } # Set transaction isolation level. We set binlog_format to STATEMENT, From 4c15a3978476ab612143be4d1cc0c7506b6d9a66 Mon Sep 17 00:00:00 2001 From: Carlos Salguero Date: Mon, 25 Sep 2017 15:16:14 -0300 Subject: [PATCH 076/104] PT-200 Index with keyword 'unique' --- bin/pt-online-schema-change | 2 +- t/pt-online-schema-change/pt-196.t | 4 +- t/pt-online-schema-change/pt-200.t | 72 ++++++++++++++++++++++++++++++ 3 files changed, 74 insertions(+), 4 deletions(-) create mode 100644 t/pt-online-schema-change/pt-200.t diff --git a/bin/pt-online-schema-change b/bin/pt-online-schema-change index 47436bc8..be367429 100755 --- a/bin/pt-online-schema-change +++ b/bin/pt-online-schema-change @@ -10111,7 +10111,7 @@ sub get_unique_index_fields { $clean .= $suffix; my $fields = []; - my $fields_re = qr/(?:PRIMARY|UNIQUE)\s*(?:INDEX|KEY|)\s*(?:.*?)\s*\((.*?)\)/i; + my $fields_re = qr/\s(?:PRIMARY|UNIQUE)\s+(?:INDEX|KEY|)\s*(?:.*?)\s*\((.*?)\)/i; while($clean =~ /$fields_re/g) { push @$fields, [ split /\s*,\s*/, $1 ]; diff --git a/t/pt-online-schema-change/pt-196.t b/t/pt-online-schema-change/pt-196.t index 973f5b2e..9e9e4172 100644 --- a/t/pt-online-schema-change/pt-196.t +++ b/t/pt-online-schema-change/pt-196.t @@ -45,9 +45,7 @@ $sb->load_file('master', "$sample/pt-196.sql"); ($output, $exit_status) = full_output( sub { pt_online_schema_change::main(@args, "$master_dsn,D=test,t=test", - '--execute', '--alter', 'DROP COLUMN test', '--max-load', - 'THREADPOOL_IDLE_THREADS=1' - ), + '--execute', '--alter', 'DROP COLUMN test', ), }, ); diff --git a/t/pt-online-schema-change/pt-200.t b/t/pt-online-schema-change/pt-200.t new file mode 100644 index 00000000..5670146f --- /dev/null +++ b/t/pt-online-schema-change/pt-200.t @@ -0,0 +1,72 @@ +#!/usr/bin/env perl + +BEGIN { + die "The PERCONA_TOOLKIT_BRANCH environment variable is not set.\n" + unless $ENV{PERCONA_TOOLKIT_BRANCH} && -d $ENV{PERCONA_TOOLKIT_BRANCH}; + unshift @INC, "$ENV{PERCONA_TOOLKIT_BRANCH}/lib"; +}; + +use strict; +use warnings FATAL => 'all'; +use threads; + +use English qw(-no_match_vars); +use Test::More; + +use Data::Dumper; +use PerconaTest; +use Sandbox; +use SqlModes; +use File::Temp qw/ tempdir /; + +plan tests => 3; + +require "$trunk/bin/pt-online-schema-change"; + +my $dp = new DSNParser(opts=>$dsn_opts); +my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp); +my $master_dbh = $sb->get_dbh_for('master'); +my $master_dsn = 'h=127.1,P=12345,u=msandbox,p=msandbox'; + +if ( !$master_dbh ) { + plan skip_all => 'Cannot connect to sandbox master'; +} + +# The sandbox servers run with lock_wait_timeout=3 and it's not dynamic +# so we need to specify --set-vars innodb_lock_wait_timeout=3 else the +# tool will die. +my @args = (qw(--set-vars innodb_lock_wait_timeout=3)); +my $output; +my $exit_status; +my $sample = "t/pt-online-schema-change/samples/"; + +$sb->load_file('master', "$sample/pt-153.sql"); + +($output, $exit_status) = full_output( + sub { pt_online_schema_change::main(@args, "$master_dsn,D=test,t=t1", + '--execute', + '--alter', "ADD COLUMN unique_id BIGINT UNSIGNED NOT NULL DEFAULT 0, ADD INDEX(unique_id)", + ), + }, +); + +is( + $exit_status, + 0, + "PT-200 Adding a column named unique_xxx is not detected as an unique index", +); + +like( + $output, + qr/Successfully altered `test`.`t1`/s, + "PT-200 Adding field having 'unique' in the name", +); + +$master_dbh->do("DROP DATABASE IF EXISTS test"); + +# ############################################################################# +# Done. +# ############################################################################# +$sb->wipe_clean($master_dbh); +ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox"); +done_testing; From b51d09d811b5a7cfee36e0498aebcff487f8d009 Mon Sep 17 00:00:00 2001 From: Carlos Salguero Date: Thu, 5 Oct 2017 15:19:57 -0300 Subject: [PATCH 077/104] PT-202 pt-online-schema-change fails with virtual columns Modified TableParser to ignore GENERATED columns from the columns list used to construct SELECTs/INSERTs --- bin/pt-archiver | 49 ++- bin/pt-duplicate-key-checker | 49 ++- bin/pt-find | 49 ++- bin/pt-heartbeat | 49 ++- bin/pt-index-usage | 49 ++- bin/pt-kill | 49 ++- bin/pt-online-schema-change | 56 ++- bin/pt-query-digest | 49 ++- bin/pt-table-checksum | 49 ++- bin/pt-table-sync | 49 ++- bin/pt-table-usage | 49 ++- lib/TableParser.pm | 49 ++- t/lib/TableParser.t | 398 +++++++++++++------ t/lib/samples/generated_cols.sql | 6 + t/pt-online-schema-change/pt-202.t | 76 ++++ t/pt-online-schema-change/samples/pt-202.sql | 9 + 16 files changed, 761 insertions(+), 323 deletions(-) create mode 100644 t/lib/samples/generated_cols.sql create mode 100644 t/pt-online-schema-change/pt-202.t create mode 100644 t/pt-online-schema-change/samples/pt-202.sql diff --git a/bin/pt-archiver b/bin/pt-archiver index 768af530..6f90ca17 100755 --- a/bin/pt-archiver +++ b/bin/pt-archiver @@ -1965,8 +1965,8 @@ sub parse { my %def_for; @def_for{@cols} = @defs; - my (@nums, @null); - my (%type_for, %is_nullable, %is_numeric, %is_autoinc); + my (@nums, @null, @non_generated); + my (%type_for, %is_nullable, %is_numeric, %is_autoinc, %is_generated); foreach my $col ( @cols ) { my $def = $def_for{$col}; @@ -1983,6 +1983,11 @@ sub parse { push @null, $col; $is_nullable{$col} = 1; } + if ( remove_quoted_text($def) =~ m/\WGENERATED\W/i ) { + $is_generated{$col} = 1; + } else { + push @non_generated, $col; + } $is_autoinc{$col} = $def =~ m/AUTO_INCREMENT/i ? 1 : 0; } @@ -1991,24 +1996,34 @@ sub parse { my ($charset) = $ddl =~ m/DEFAULT CHARSET=(\w+)/; return { - name => $name, - cols => \@cols, - col_posn => { map { $cols[$_] => $_ } 0..$#cols }, - is_col => { map { $_ => 1 } @cols }, - null_cols => \@null, - is_nullable => \%is_nullable, - is_autoinc => \%is_autoinc, - clustered_key => $clustered_key, - keys => $keys, - defs => \%def_for, - numeric_cols => \@nums, - is_numeric => \%is_numeric, - engine => $engine, - type_for => \%type_for, - charset => $charset, + name => $name, + cols => \@cols, + col_posn => { map { $cols[$_] => $_ } 0..$#cols }, + is_col => { map { $_ => 1 } @non_generated }, + null_cols => \@null, + is_nullable => \%is_nullable, + non_generated_cols => \@non_generated, + is_autoinc => \%is_autoinc, + is_generated => \%is_generated, + clustered_key => $clustered_key, + keys => $keys, + defs => \%def_for, + numeric_cols => \@nums, + is_numeric => \%is_numeric, + engine => $engine, + type_for => \%type_for, + charset => $charset, }; } +sub remove_quoted_text { + my ($string) = @_; + $string =~ s/[^\\]`[^`]*[^\\]`//g; + $string =~ s/[^\\]"[^"]*[^\\]"//g; + $string =~ s/[^\\]"[^"]*[^\\]"//g; + return $string; +} + sub sort_indexes { my ( $self, $tbl ) = @_; diff --git a/bin/pt-duplicate-key-checker b/bin/pt-duplicate-key-checker index f288a596..d82c75bc 100755 --- a/bin/pt-duplicate-key-checker +++ b/bin/pt-duplicate-key-checker @@ -352,8 +352,8 @@ sub parse { my %def_for; @def_for{@cols} = @defs; - my (@nums, @null); - my (%type_for, %is_nullable, %is_numeric, %is_autoinc); + my (@nums, @null, @non_generated); + my (%type_for, %is_nullable, %is_numeric, %is_autoinc, %is_generated); foreach my $col ( @cols ) { my $def = $def_for{$col}; @@ -370,6 +370,11 @@ sub parse { push @null, $col; $is_nullable{$col} = 1; } + if ( remove_quoted_text($def) =~ m/\WGENERATED\W/i ) { + $is_generated{$col} = 1; + } else { + push @non_generated, $col; + } $is_autoinc{$col} = $def =~ m/AUTO_INCREMENT/i ? 1 : 0; } @@ -378,24 +383,34 @@ sub parse { my ($charset) = $ddl =~ m/DEFAULT CHARSET=(\w+)/; return { - name => $name, - cols => \@cols, - col_posn => { map { $cols[$_] => $_ } 0..$#cols }, - is_col => { map { $_ => 1 } @cols }, - null_cols => \@null, - is_nullable => \%is_nullable, - is_autoinc => \%is_autoinc, - clustered_key => $clustered_key, - keys => $keys, - defs => \%def_for, - numeric_cols => \@nums, - is_numeric => \%is_numeric, - engine => $engine, - type_for => \%type_for, - charset => $charset, + name => $name, + cols => \@cols, + col_posn => { map { $cols[$_] => $_ } 0..$#cols }, + is_col => { map { $_ => 1 } @non_generated }, + null_cols => \@null, + is_nullable => \%is_nullable, + non_generated_cols => \@non_generated, + is_autoinc => \%is_autoinc, + is_generated => \%is_generated, + clustered_key => $clustered_key, + keys => $keys, + defs => \%def_for, + numeric_cols => \@nums, + is_numeric => \%is_numeric, + engine => $engine, + type_for => \%type_for, + charset => $charset, }; } +sub remove_quoted_text { + my ($string) = @_; + $string =~ s/[^\\]`[^`]*[^\\]`//g; + $string =~ s/[^\\]"[^"]*[^\\]"//g; + $string =~ s/[^\\]"[^"]*[^\\]"//g; + return $string; +} + sub sort_indexes { my ( $self, $tbl ) = @_; diff --git a/bin/pt-find b/bin/pt-find index 4f9c7bf4..fc02d69e 100755 --- a/bin/pt-find +++ b/bin/pt-find @@ -1880,8 +1880,8 @@ sub parse { my %def_for; @def_for{@cols} = @defs; - my (@nums, @null); - my (%type_for, %is_nullable, %is_numeric, %is_autoinc); + my (@nums, @null, @non_generated); + my (%type_for, %is_nullable, %is_numeric, %is_autoinc, %is_generated); foreach my $col ( @cols ) { my $def = $def_for{$col}; @@ -1898,6 +1898,11 @@ sub parse { push @null, $col; $is_nullable{$col} = 1; } + if ( remove_quoted_text($def) =~ m/\WGENERATED\W/i ) { + $is_generated{$col} = 1; + } else { + push @non_generated, $col; + } $is_autoinc{$col} = $def =~ m/AUTO_INCREMENT/i ? 1 : 0; } @@ -1906,24 +1911,34 @@ sub parse { my ($charset) = $ddl =~ m/DEFAULT CHARSET=(\w+)/; return { - name => $name, - cols => \@cols, - col_posn => { map { $cols[$_] => $_ } 0..$#cols }, - is_col => { map { $_ => 1 } @cols }, - null_cols => \@null, - is_nullable => \%is_nullable, - is_autoinc => \%is_autoinc, - clustered_key => $clustered_key, - keys => $keys, - defs => \%def_for, - numeric_cols => \@nums, - is_numeric => \%is_numeric, - engine => $engine, - type_for => \%type_for, - charset => $charset, + name => $name, + cols => \@cols, + col_posn => { map { $cols[$_] => $_ } 0..$#cols }, + is_col => { map { $_ => 1 } @non_generated }, + null_cols => \@null, + is_nullable => \%is_nullable, + non_generated_cols => \@non_generated, + is_autoinc => \%is_autoinc, + is_generated => \%is_generated, + clustered_key => $clustered_key, + keys => $keys, + defs => \%def_for, + numeric_cols => \@nums, + is_numeric => \%is_numeric, + engine => $engine, + type_for => \%type_for, + charset => $charset, }; } +sub remove_quoted_text { + my ($string) = @_; + $string =~ s/[^\\]`[^`]*[^\\]`//g; + $string =~ s/[^\\]"[^"]*[^\\]"//g; + $string =~ s/[^\\]"[^"]*[^\\]"//g; + return $string; +} + sub sort_indexes { my ( $self, $tbl ) = @_; diff --git a/bin/pt-heartbeat b/bin/pt-heartbeat index 667b037a..5b1ade9b 100755 --- a/bin/pt-heartbeat +++ b/bin/pt-heartbeat @@ -3499,8 +3499,8 @@ sub parse { my %def_for; @def_for{@cols} = @defs; - my (@nums, @null); - my (%type_for, %is_nullable, %is_numeric, %is_autoinc); + my (@nums, @null, @non_generated); + my (%type_for, %is_nullable, %is_numeric, %is_autoinc, %is_generated); foreach my $col ( @cols ) { my $def = $def_for{$col}; @@ -3517,6 +3517,11 @@ sub parse { push @null, $col; $is_nullable{$col} = 1; } + if ( remove_quoted_text($def) =~ m/\WGENERATED\W/i ) { + $is_generated{$col} = 1; + } else { + push @non_generated, $col; + } $is_autoinc{$col} = $def =~ m/AUTO_INCREMENT/i ? 1 : 0; } @@ -3525,24 +3530,34 @@ sub parse { my ($charset) = $ddl =~ m/DEFAULT CHARSET=(\w+)/; return { - name => $name, - cols => \@cols, - col_posn => { map { $cols[$_] => $_ } 0..$#cols }, - is_col => { map { $_ => 1 } @cols }, - null_cols => \@null, - is_nullable => \%is_nullable, - is_autoinc => \%is_autoinc, - clustered_key => $clustered_key, - keys => $keys, - defs => \%def_for, - numeric_cols => \@nums, - is_numeric => \%is_numeric, - engine => $engine, - type_for => \%type_for, - charset => $charset, + name => $name, + cols => \@cols, + col_posn => { map { $cols[$_] => $_ } 0..$#cols }, + is_col => { map { $_ => 1 } @non_generated }, + null_cols => \@null, + is_nullable => \%is_nullable, + non_generated_cols => \@non_generated, + is_autoinc => \%is_autoinc, + is_generated => \%is_generated, + clustered_key => $clustered_key, + keys => $keys, + defs => \%def_for, + numeric_cols => \@nums, + is_numeric => \%is_numeric, + engine => $engine, + type_for => \%type_for, + charset => $charset, }; } +sub remove_quoted_text { + my ($string) = @_; + $string =~ s/[^\\]`[^`]*[^\\]`//g; + $string =~ s/[^\\]"[^"]*[^\\]"//g; + $string =~ s/[^\\]"[^"]*[^\\]"//g; + return $string; +} + sub sort_indexes { my ( $self, $tbl ) = @_; diff --git a/bin/pt-index-usage b/bin/pt-index-usage index c58cacaa..72b4b55c 100755 --- a/bin/pt-index-usage +++ b/bin/pt-index-usage @@ -3119,8 +3119,8 @@ sub parse { my %def_for; @def_for{@cols} = @defs; - my (@nums, @null); - my (%type_for, %is_nullable, %is_numeric, %is_autoinc); + my (@nums, @null, @non_generated); + my (%type_for, %is_nullable, %is_numeric, %is_autoinc, %is_generated); foreach my $col ( @cols ) { my $def = $def_for{$col}; @@ -3137,6 +3137,11 @@ sub parse { push @null, $col; $is_nullable{$col} = 1; } + if ( remove_quoted_text($def) =~ m/\WGENERATED\W/i ) { + $is_generated{$col} = 1; + } else { + push @non_generated, $col; + } $is_autoinc{$col} = $def =~ m/AUTO_INCREMENT/i ? 1 : 0; } @@ -3145,24 +3150,34 @@ sub parse { my ($charset) = $ddl =~ m/DEFAULT CHARSET=(\w+)/; return { - name => $name, - cols => \@cols, - col_posn => { map { $cols[$_] => $_ } 0..$#cols }, - is_col => { map { $_ => 1 } @cols }, - null_cols => \@null, - is_nullable => \%is_nullable, - is_autoinc => \%is_autoinc, - clustered_key => $clustered_key, - keys => $keys, - defs => \%def_for, - numeric_cols => \@nums, - is_numeric => \%is_numeric, - engine => $engine, - type_for => \%type_for, - charset => $charset, + name => $name, + cols => \@cols, + col_posn => { map { $cols[$_] => $_ } 0..$#cols }, + is_col => { map { $_ => 1 } @non_generated }, + null_cols => \@null, + is_nullable => \%is_nullable, + non_generated_cols => \@non_generated, + is_autoinc => \%is_autoinc, + is_generated => \%is_generated, + clustered_key => $clustered_key, + keys => $keys, + defs => \%def_for, + numeric_cols => \@nums, + is_numeric => \%is_numeric, + engine => $engine, + type_for => \%type_for, + charset => $charset, }; } +sub remove_quoted_text { + my ($string) = @_; + $string =~ s/[^\\]`[^`]*[^\\]`//g; + $string =~ s/[^\\]"[^"]*[^\\]"//g; + $string =~ s/[^\\]"[^"]*[^\\]"//g; + return $string; +} + sub sort_indexes { my ( $self, $tbl ) = @_; diff --git a/bin/pt-kill b/bin/pt-kill index 11663760..ba95733b 100755 --- a/bin/pt-kill +++ b/bin/pt-kill @@ -2945,8 +2945,8 @@ sub parse { my %def_for; @def_for{@cols} = @defs; - my (@nums, @null); - my (%type_for, %is_nullable, %is_numeric, %is_autoinc); + my (@nums, @null, @non_generated); + my (%type_for, %is_nullable, %is_numeric, %is_autoinc, %is_generated); foreach my $col ( @cols ) { my $def = $def_for{$col}; @@ -2963,6 +2963,11 @@ sub parse { push @null, $col; $is_nullable{$col} = 1; } + if ( remove_quoted_text($def) =~ m/\WGENERATED\W/i ) { + $is_generated{$col} = 1; + } else { + push @non_generated, $col; + } $is_autoinc{$col} = $def =~ m/AUTO_INCREMENT/i ? 1 : 0; } @@ -2971,24 +2976,34 @@ sub parse { my ($charset) = $ddl =~ m/DEFAULT CHARSET=(\w+)/; return { - name => $name, - cols => \@cols, - col_posn => { map { $cols[$_] => $_ } 0..$#cols }, - is_col => { map { $_ => 1 } @cols }, - null_cols => \@null, - is_nullable => \%is_nullable, - is_autoinc => \%is_autoinc, - clustered_key => $clustered_key, - keys => $keys, - defs => \%def_for, - numeric_cols => \@nums, - is_numeric => \%is_numeric, - engine => $engine, - type_for => \%type_for, - charset => $charset, + name => $name, + cols => \@cols, + col_posn => { map { $cols[$_] => $_ } 0..$#cols }, + is_col => { map { $_ => 1 } @non_generated }, + null_cols => \@null, + is_nullable => \%is_nullable, + non_generated_cols => \@non_generated, + is_autoinc => \%is_autoinc, + is_generated => \%is_generated, + clustered_key => $clustered_key, + keys => $keys, + defs => \%def_for, + numeric_cols => \@nums, + is_numeric => \%is_numeric, + engine => $engine, + type_for => \%type_for, + charset => $charset, }; } +sub remove_quoted_text { + my ($string) = @_; + $string =~ s/[^\\]`[^`]*[^\\]`//g; + $string =~ s/[^\\]"[^"]*[^\\]"//g; + $string =~ s/[^\\]"[^"]*[^\\]"//g; + return $string; +} + sub sort_indexes { my ( $self, $tbl ) = @_; diff --git a/bin/pt-online-schema-change b/bin/pt-online-schema-change index be367429..bf4fcaa8 100755 --- a/bin/pt-online-schema-change +++ b/bin/pt-online-schema-change @@ -56,7 +56,7 @@ BEGIN { { package Percona::Toolkit; -our $VERSION = '3.0.4'; +our $VERSION = '3.0.5'; use strict; use warnings FATAL => 'all'; @@ -3309,8 +3309,8 @@ sub parse { my %def_for; @def_for{@cols} = @defs; - my (@nums, @null); - my (%type_for, %is_nullable, %is_numeric, %is_autoinc); + my (@nums, @null, @non_generated); + my (%type_for, %is_nullable, %is_numeric, %is_autoinc, %is_generated); foreach my $col ( @cols ) { my $def = $def_for{$col}; @@ -3327,6 +3327,11 @@ sub parse { push @null, $col; $is_nullable{$col} = 1; } + if ( remove_quoted_text($def) =~ m/\WGENERATED\W/i ) { + $is_generated{$col} = 1; + } else { + push @non_generated, $col; + } $is_autoinc{$col} = $def =~ m/AUTO_INCREMENT/i ? 1 : 0; } @@ -3335,24 +3340,34 @@ sub parse { my ($charset) = $ddl =~ m/DEFAULT CHARSET=(\w+)/; return { - name => $name, - cols => \@cols, - col_posn => { map { $cols[$_] => $_ } 0..$#cols }, - is_col => { map { $_ => 1 } @cols }, - null_cols => \@null, - is_nullable => \%is_nullable, - is_autoinc => \%is_autoinc, - clustered_key => $clustered_key, - keys => $keys, - defs => \%def_for, - numeric_cols => \@nums, - is_numeric => \%is_numeric, - engine => $engine, - type_for => \%type_for, - charset => $charset, + name => $name, + cols => \@cols, + col_posn => { map { $cols[$_] => $_ } 0..$#cols }, + is_col => { map { $_ => 1 } @non_generated }, + null_cols => \@null, + is_nullable => \%is_nullable, + non_generated_cols => \@non_generated, + is_autoinc => \%is_autoinc, + is_generated => \%is_generated, + clustered_key => $clustered_key, + keys => $keys, + defs => \%def_for, + numeric_cols => \@nums, + is_numeric => \%is_numeric, + engine => $engine, + type_for => \%type_for, + charset => $charset, }; } +sub remove_quoted_text { + my ($string) = @_; + $string =~ s/[^\\]`[^`]*[^\\]`//g; + $string =~ s/[^\\]"[^"]*[^\\]"//g; + $string =~ s/[^\\]"[^"]*[^\\]"//g; + return $string; +} + sub sort_indexes { my ( $self, $tbl ) = @_; @@ -11582,6 +11597,11 @@ The tool exits with an error if the host is a cluster node and the table is MyISAM or is being converted to MyISAM (C), or if C is not C. There is no way to disable these checks. +=head1 MySQL 5.7+ Generated columns + +The tools ignores MySQL 5.7+ C columns since the value for those columns +is generated according to the expresion used to compute column values. + =head1 OUTPUT The tool prints information about its activities to STDOUT so that you can see diff --git a/bin/pt-query-digest b/bin/pt-query-digest index f01767a5..1e504c8e 100755 --- a/bin/pt-query-digest +++ b/bin/pt-query-digest @@ -8857,8 +8857,8 @@ sub parse { my %def_for; @def_for{@cols} = @defs; - my (@nums, @null); - my (%type_for, %is_nullable, %is_numeric, %is_autoinc); + my (@nums, @null, @non_generated); + my (%type_for, %is_nullable, %is_numeric, %is_autoinc, %is_generated); foreach my $col ( @cols ) { my $def = $def_for{$col}; @@ -8875,6 +8875,11 @@ sub parse { push @null, $col; $is_nullable{$col} = 1; } + if ( remove_quoted_text($def) =~ m/\WGENERATED\W/i ) { + $is_generated{$col} = 1; + } else { + push @non_generated, $col; + } $is_autoinc{$col} = $def =~ m/AUTO_INCREMENT/i ? 1 : 0; } @@ -8883,24 +8888,34 @@ sub parse { my ($charset) = $ddl =~ m/DEFAULT CHARSET=(\w+)/; return { - name => $name, - cols => \@cols, - col_posn => { map { $cols[$_] => $_ } 0..$#cols }, - is_col => { map { $_ => 1 } @cols }, - null_cols => \@null, - is_nullable => \%is_nullable, - is_autoinc => \%is_autoinc, - clustered_key => $clustered_key, - keys => $keys, - defs => \%def_for, - numeric_cols => \@nums, - is_numeric => \%is_numeric, - engine => $engine, - type_for => \%type_for, - charset => $charset, + name => $name, + cols => \@cols, + col_posn => { map { $cols[$_] => $_ } 0..$#cols }, + is_col => { map { $_ => 1 } @non_generated }, + null_cols => \@null, + is_nullable => \%is_nullable, + non_generated_cols => \@non_generated, + is_autoinc => \%is_autoinc, + is_generated => \%is_generated, + clustered_key => $clustered_key, + keys => $keys, + defs => \%def_for, + numeric_cols => \@nums, + is_numeric => \%is_numeric, + engine => $engine, + type_for => \%type_for, + charset => $charset, }; } +sub remove_quoted_text { + my ($string) = @_; + $string =~ s/[^\\]`[^`]*[^\\]`//g; + $string =~ s/[^\\]"[^"]*[^\\]"//g; + $string =~ s/[^\\]"[^"]*[^\\]"//g; + return $string; +} + sub sort_indexes { my ( $self, $tbl ) = @_; diff --git a/bin/pt-table-checksum b/bin/pt-table-checksum index 32d084bf..be89bb12 100755 --- a/bin/pt-table-checksum +++ b/bin/pt-table-checksum @@ -4446,8 +4446,8 @@ sub parse { my %def_for; @def_for{@cols} = @defs; - my (@nums, @null); - my (%type_for, %is_nullable, %is_numeric, %is_autoinc); + my (@nums, @null, @non_generated); + my (%type_for, %is_nullable, %is_numeric, %is_autoinc, %is_generated); foreach my $col ( @cols ) { my $def = $def_for{$col}; @@ -4464,6 +4464,11 @@ sub parse { push @null, $col; $is_nullable{$col} = 1; } + if ( remove_quoted_text($def) =~ m/\WGENERATED\W/i ) { + $is_generated{$col} = 1; + } else { + push @non_generated, $col; + } $is_autoinc{$col} = $def =~ m/AUTO_INCREMENT/i ? 1 : 0; } @@ -4472,24 +4477,34 @@ sub parse { my ($charset) = $ddl =~ m/DEFAULT CHARSET=(\w+)/; return { - name => $name, - cols => \@cols, - col_posn => { map { $cols[$_] => $_ } 0..$#cols }, - is_col => { map { $_ => 1 } @cols }, - null_cols => \@null, - is_nullable => \%is_nullable, - is_autoinc => \%is_autoinc, - clustered_key => $clustered_key, - keys => $keys, - defs => \%def_for, - numeric_cols => \@nums, - is_numeric => \%is_numeric, - engine => $engine, - type_for => \%type_for, - charset => $charset, + name => $name, + cols => \@cols, + col_posn => { map { $cols[$_] => $_ } 0..$#cols }, + is_col => { map { $_ => 1 } @non_generated }, + null_cols => \@null, + is_nullable => \%is_nullable, + non_generated_cols => \@non_generated, + is_autoinc => \%is_autoinc, + is_generated => \%is_generated, + clustered_key => $clustered_key, + keys => $keys, + defs => \%def_for, + numeric_cols => \@nums, + is_numeric => \%is_numeric, + engine => $engine, + type_for => \%type_for, + charset => $charset, }; } +sub remove_quoted_text { + my ($string) = @_; + $string =~ s/[^\\]`[^`]*[^\\]`//g; + $string =~ s/[^\\]"[^"]*[^\\]"//g; + $string =~ s/[^\\]"[^"]*[^\\]"//g; + return $string; +} + sub sort_indexes { my ( $self, $tbl ) = @_; diff --git a/bin/pt-table-sync b/bin/pt-table-sync index 0f2bdd05..30fff765 100755 --- a/bin/pt-table-sync +++ b/bin/pt-table-sync @@ -2864,8 +2864,8 @@ sub parse { my %def_for; @def_for{@cols} = @defs; - my (@nums, @null); - my (%type_for, %is_nullable, %is_numeric, %is_autoinc); + my (@nums, @null, @non_generated); + my (%type_for, %is_nullable, %is_numeric, %is_autoinc, %is_generated); foreach my $col ( @cols ) { my $def = $def_for{$col}; @@ -2882,6 +2882,11 @@ sub parse { push @null, $col; $is_nullable{$col} = 1; } + if ( remove_quoted_text($def) =~ m/\WGENERATED\W/i ) { + $is_generated{$col} = 1; + } else { + push @non_generated, $col; + } $is_autoinc{$col} = $def =~ m/AUTO_INCREMENT/i ? 1 : 0; } @@ -2890,24 +2895,34 @@ sub parse { my ($charset) = $ddl =~ m/DEFAULT CHARSET=(\w+)/; return { - name => $name, - cols => \@cols, - col_posn => { map { $cols[$_] => $_ } 0..$#cols }, - is_col => { map { $_ => 1 } @cols }, - null_cols => \@null, - is_nullable => \%is_nullable, - is_autoinc => \%is_autoinc, - clustered_key => $clustered_key, - keys => $keys, - defs => \%def_for, - numeric_cols => \@nums, - is_numeric => \%is_numeric, - engine => $engine, - type_for => \%type_for, - charset => $charset, + name => $name, + cols => \@cols, + col_posn => { map { $cols[$_] => $_ } 0..$#cols }, + is_col => { map { $_ => 1 } @non_generated }, + null_cols => \@null, + is_nullable => \%is_nullable, + non_generated_cols => \@non_generated, + is_autoinc => \%is_autoinc, + is_generated => \%is_generated, + clustered_key => $clustered_key, + keys => $keys, + defs => \%def_for, + numeric_cols => \@nums, + is_numeric => \%is_numeric, + engine => $engine, + type_for => \%type_for, + charset => $charset, }; } +sub remove_quoted_text { + my ($string) = @_; + $string =~ s/[^\\]`[^`]*[^\\]`//g; + $string =~ s/[^\\]"[^"]*[^\\]"//g; + $string =~ s/[^\\]"[^"]*[^\\]"//g; + return $string; +} + sub sort_indexes { my ( $self, $tbl ) = @_; diff --git a/bin/pt-table-usage b/bin/pt-table-usage index 5dcdd8e9..829d0912 100755 --- a/bin/pt-table-usage +++ b/bin/pt-table-usage @@ -6795,8 +6795,8 @@ sub parse { my %def_for; @def_for{@cols} = @defs; - my (@nums, @null); - my (%type_for, %is_nullable, %is_numeric, %is_autoinc); + my (@nums, @null, @non_generated); + my (%type_for, %is_nullable, %is_numeric, %is_autoinc, %is_generated); foreach my $col ( @cols ) { my $def = $def_for{$col}; @@ -6813,6 +6813,11 @@ sub parse { push @null, $col; $is_nullable{$col} = 1; } + if ( remove_quoted_text($def) =~ m/\WGENERATED\W/i ) { + $is_generated{$col} = 1; + } else { + push @non_generated, $col; + } $is_autoinc{$col} = $def =~ m/AUTO_INCREMENT/i ? 1 : 0; } @@ -6821,24 +6826,34 @@ sub parse { my ($charset) = $ddl =~ m/DEFAULT CHARSET=(\w+)/; return { - name => $name, - cols => \@cols, - col_posn => { map { $cols[$_] => $_ } 0..$#cols }, - is_col => { map { $_ => 1 } @cols }, - null_cols => \@null, - is_nullable => \%is_nullable, - is_autoinc => \%is_autoinc, - clustered_key => $clustered_key, - keys => $keys, - defs => \%def_for, - numeric_cols => \@nums, - is_numeric => \%is_numeric, - engine => $engine, - type_for => \%type_for, - charset => $charset, + name => $name, + cols => \@cols, + col_posn => { map { $cols[$_] => $_ } 0..$#cols }, + is_col => { map { $_ => 1 } @non_generated }, + null_cols => \@null, + is_nullable => \%is_nullable, + non_generated_cols => \@non_generated, + is_autoinc => \%is_autoinc, + is_generated => \%is_generated, + clustered_key => $clustered_key, + keys => $keys, + defs => \%def_for, + numeric_cols => \@nums, + is_numeric => \%is_numeric, + engine => $engine, + type_for => \%type_for, + charset => $charset, }; } +sub remove_quoted_text { + my ($string) = @_; + $string =~ s/[^\\]`[^`]*[^\\]`//g; + $string =~ s/[^\\]"[^"]*[^\\]"//g; + $string =~ s/[^\\]"[^"]*[^\\]"//g; + return $string; +} + sub sort_indexes { my ( $self, $tbl ) = @_; diff --git a/lib/TableParser.pm b/lib/TableParser.pm index 4b5904bb..511c5c67 100644 --- a/lib/TableParser.pm +++ b/lib/TableParser.pm @@ -159,8 +159,8 @@ sub parse { # Find column types, whether numeric, whether nullable, whether # auto-increment. - my (@nums, @null); - my (%type_for, %is_nullable, %is_numeric, %is_autoinc); + my (@nums, @null, @non_generated); + my (%type_for, %is_nullable, %is_numeric, %is_autoinc, %is_generated); foreach my $col ( @cols ) { my $def = $def_for{$col}; @@ -180,6 +180,11 @@ sub parse { push @null, $col; $is_nullable{$col} = 1; } + if ( remove_quoted_text($def) =~ m/\WGENERATED\W/i ) { + $is_generated{$col} = 1; + } else { + push @non_generated, $col; + } $is_autoinc{$col} = $def =~ m/AUTO_INCREMENT/i ? 1 : 0; } @@ -191,24 +196,34 @@ sub parse { my ($charset) = $ddl =~ m/DEFAULT CHARSET=(\w+)/; return { - name => $name, - cols => \@cols, - col_posn => { map { $cols[$_] => $_ } 0..$#cols }, - is_col => { map { $_ => 1 } @cols }, - null_cols => \@null, - is_nullable => \%is_nullable, - is_autoinc => \%is_autoinc, - clustered_key => $clustered_key, - keys => $keys, - defs => \%def_for, - numeric_cols => \@nums, - is_numeric => \%is_numeric, - engine => $engine, - type_for => \%type_for, - charset => $charset, + name => $name, + cols => \@cols, + col_posn => { map { $cols[$_] => $_ } 0..$#cols }, + is_col => { map { $_ => 1 } @non_generated }, + null_cols => \@null, + is_nullable => \%is_nullable, + non_generated_cols => \@non_generated, + is_autoinc => \%is_autoinc, + is_generated => \%is_generated, + clustered_key => $clustered_key, + keys => $keys, + defs => \%def_for, + numeric_cols => \@nums, + is_numeric => \%is_numeric, + engine => $engine, + type_for => \%type_for, + charset => $charset, }; } +sub remove_quoted_text { + my ($string) = @_; + $string =~ s/[^\\]`[^`]*[^\\]`//g; + $string =~ s/[^\\]"[^"]*[^\\]"//g; + $string =~ s/[^\\]"[^"]*[^\\]"//g; + return $string; +} + # Sorts indexes in this order: PRIMARY, unique, non-nullable, any (shortest # first, alphabetical). Only BTREE indexes are considered. # TODO: consider length as # of bytes instead of # of columns. diff --git a/t/lib/TableParser.t b/t/lib/TableParser.t index 8a063ee6..91137219 100644 --- a/t/lib/TableParser.t +++ b/t/lib/TableParser.t @@ -11,6 +11,7 @@ use warnings FATAL => 'all'; use English qw(-no_match_vars); use Test::More; +use Text::Diff; use TableParser; use Quoter; use DSNParser; @@ -71,21 +72,23 @@ like($EVAL_ERROR, qr/quoting/, 'No quoting'); $tbl = $tp->parse( load_file('t/lib/samples/t1.sql') ); is_deeply( $tbl, - { cols => [qw(a)], - col_posn => { a => 0 }, - is_col => { a => 1 }, - is_autoinc => { a => 0 }, - null_cols => [qw(a)], - is_nullable => { a => 1 }, - clustered_key => undef, - keys => {}, - defs => { a => ' `a` int(11) default NULL' }, - numeric_cols => [qw(a)], - is_numeric => { a => 1 }, - engine => 'MyISAM', - type_for => { a => 'int' }, - name => 't1', - charset => 'latin1', + { cols => [qw(a)], + col_posn => { a => 0 }, + is_col => { a => 1 }, + is_autoinc => { a => 0 }, + null_cols => [qw(a)], + is_generated => {}, + non_generated_cols => [ 'a' ], + is_nullable => { a => 1 }, + clustered_key => undef, + keys => {}, + defs => { a => ' `a` int(11) default NULL' }, + numeric_cols => [qw(a)], + is_numeric => { a => 1 }, + engine => 'MyISAM', + type_for => { a => 'int' }, + name => 't1', + charset => 'latin1', }, 'Basic table is OK', ); @@ -94,11 +97,13 @@ $tbl = $tp->parse( load_file('t/lib/samples/TableParser-prefix_idx.sql') ); is_deeply( $tbl, { - name => 't1', - cols => [ 'a', 'b' ], - col_posn => { a => 0, b => 1 }, - is_col => { a => 1, b => 1 }, - is_autoinc => { 'a' => 0, 'b' => 0 }, + name => 't1', + cols => [ 'a', 'b' ], + non_generated_cols => [ 'a', 'b' ], + col_posn => { a => 0, b => 1 }, + is_col => { a => 1, b => 1 }, + is_autoinc => { 'a' => 0, 'b' => 0 }, + is_generated => {}, null_cols => [ 'a', 'b' ], is_nullable => { 'a' => 1, 'b' => 1 }, clustered_key => undef, @@ -169,6 +174,12 @@ is_deeply( length replacement_cost rating special_features last_update) ], + non_generated_cols => [ + qw(film_id title description release_year language_id + original_language_id rental_duration rental_rate + length replacement_cost rating special_features + last_update) + ], col_posn => { film_id => 0, title => 1, @@ -214,6 +225,7 @@ is_deeply( special_features => 1, last_update => 1, }, + is_generated => {}, null_cols => [qw(description release_year original_language_id length rating special_features )], is_nullable => { description => 1, @@ -342,25 +354,109 @@ throws_ok ( $tbl = $tp->parse( load_file('t/lib/samples/temporary_table.sql') ); is_deeply( $tbl, - { cols => [qw(a)], - col_posn => { a => 0 }, - is_col => { a => 1 }, - is_autoinc => { a => 0 }, - null_cols => [qw(a)], - is_nullable => { a => 1 }, - clustered_key => undef, - keys => {}, - defs => { a => ' `a` int(11) default NULL' }, - numeric_cols => [qw(a)], - is_numeric => { a => 1 }, - engine => 'MyISAM', - type_for => { a => 'int' }, - name => 't', - charset => 'latin1', + { cols => [qw(a)], + non_generated_cols => [qw(a)], + col_posn => { a => 0 }, + is_col => { a => 1 }, + is_autoinc => { a => 0 }, + is_generated => {}, + null_cols => [qw(a)], + is_nullable => { a => 1 }, + clustered_key => undef, + keys => {}, + defs => { a => ' `a` int(11) default NULL' }, + numeric_cols => [qw(a)], + is_numeric => { a => 1 }, + engine => 'MyISAM', + type_for => { a => 'int' }, + name => 't', + charset => 'latin1', }, 'Temporary table', ); +my $want = { 'is_autoinc' => { + 'sort_order' => 0, + 'pfk-source_instrument_id' => 0, + 'pfk-related_instrument_id' => 0 + }, + 'null_cols' => [], + 'numeric_cols' => [ + 'pfk-source_instrument_id', 'pfk-related_instrument_id', + 'sort_order' + ], + 'cols' => [ + 'pfk-source_instrument_id', 'pfk-related_instrument_id', + 'sort_order' + ], + 'non_generated_cols' => [ + 'pfk-source_instrument_id', 'pfk-related_instrument_id', + 'sort_order' + ], + is_autogenerated => {}, + 'col_posn' => { + 'sort_order' => 2, + 'pfk-source_instrument_id' => 0, + 'pfk-related_instrument_id' => 1 + }, + clustered_key => 'PRIMARY', + 'keys' => { + 'sort_order' => { + 'is_unique' => 0, + 'is_col' => { 'sort_order' => 1 }, + 'name' => 'sort_order', + 'type' => 'BTREE', + 'col_prefixes' => [ undef ], + 'is_nullable' => 0, + 'colnames' => '`sort_order`', + 'cols' => [ 'sort_order' ], + ddl => 'KEY `sort_order` (`sort_order`)', + }, + 'PRIMARY' => { + 'is_unique' => 1, + 'is_col' => { + 'pfk-source_instrument_id' => 1, + 'pfk-related_instrument_id' => 1 + }, + 'name' => 'PRIMARY', + 'type' => 'BTREE', + 'col_prefixes' => [ undef, undef ], + 'is_nullable' => 0, + 'colnames' => + '`pfk-source_instrument_id`,`pfk-related_instrument_id`', + 'cols' => + [ 'pfk-source_instrument_id', 'pfk-related_instrument_id' ], + ddl => 'PRIMARY KEY (`pfk-source_instrument_id`,`pfk-related_instrument_id`),', + } + }, + 'defs' => { + 'sort_order' => ' `sort_order` int(11) NOT NULL', + 'pfk-source_instrument_id' => + ' `pfk-source_instrument_id` int(10) unsigned NOT NULL', + 'pfk-related_instrument_id' => + ' `pfk-related_instrument_id` int(10) unsigned NOT NULL' + }, + 'engine' => 'InnoDB', + 'is_col' => { + 'sort_order' => 1, + 'pfk-source_instrument_id' => 1, + 'pfk-related_instrument_id' => 1 + }, + 'is_numeric' => { + 'sort_order' => 1, + 'pfk-source_instrument_id' => 1, + 'pfk-related_instrument_id' => 1 + }, + 'type_for' => { + 'sort_order' => 'int', + 'pfk-source_instrument_id' => 'int', + 'pfk-related_instrument_id' => 'int' + }, + 'is_nullable' => {}, + name => 'instrument_relation', + charset => 'latin1', + }; + $tbl = $tp->parse( load_file('t/lib/samples/hyphentest.sql') ); is_deeply( $tbl, @@ -378,6 +474,11 @@ is_deeply( 'pfk-source_instrument_id', 'pfk-related_instrument_id', 'sort_order' ], + 'non_generated_cols' => [ + 'pfk-source_instrument_id', 'pfk-related_instrument_id', + 'sort_order' + ], + is_generated => {}, 'col_posn' => { 'sort_order' => 2, 'pfk-source_instrument_id' => 0, @@ -446,13 +547,14 @@ is_deeply( $tbl = $tp->parse( load_file('t/lib/samples/ndb_table.sql') ); is_deeply( $tbl, - { cols => [qw(id)], - col_posn => { id => 0 }, - is_col => { id => 1 }, - is_autoinc => { id => 1 }, - null_cols => [], - is_nullable => {}, - clustered_key => undef, + { cols => [qw(id)], + non_generated_cols => [qw(id)], + col_posn => { id => 0 }, + is_col => { id => 1 }, + is_autoinc => { id => 1 }, + null_cols => [], + is_nullable => {}, + clustered_key => undef, keys => { PRIMARY => { cols => [qw(id)], @@ -473,6 +575,7 @@ is_deeply( type_for => { id => 'bigint' }, name => 'pipo', charset => 'latin1', + is_generated => {}, }, 'NDB table', ); @@ -481,9 +584,11 @@ $tbl = $tp->parse( load_file('t/lib/samples/mixed-case.sql') ); is_deeply( $tbl, { cols => [qw(a b mixedcol)], + non_generated_cols => [qw(a b mixedcol)], col_posn => { a => 0, b => 1, mixedcol => 2 }, is_col => { a => 1, b => 1, mixedcol => 1 }, is_autoinc => { a => 0, b => 0, mixedcol => 0 }, + is_generated => {}, null_cols => [qw(a b mixedcol)], is_nullable => { a => 1, b => 1, mixedcol => 1 }, clustered_key => undef, @@ -518,14 +623,15 @@ is_deeply( $tbl = $tp->parse( load_file('t/lib/samples/one_key.sql') ); is_deeply( $tbl, - { cols => [qw(a b)], - col_posn => { a => 0, b => 1 }, - is_col => { a => 1, b => 1 }, - is_autoinc => { a => 0, b => 0 }, - null_cols => [qw(b)], - is_nullable => { b => 1 }, - clustered_key => undef, - keys => { + { cols => [qw(a b)], + non_generated_cols => [qw(a b)], + col_posn => { a => 0, b => 1 }, + is_col => { a => 1, b => 1 }, + is_autoinc => { a => 0, b => 0 }, + null_cols => [qw(b)], + is_nullable => { b => 1 }, + clustered_key => undef, + keys => { PRIMARY => { colnames => '`a`', cols => [qw(a)], @@ -538,16 +644,17 @@ is_deeply( ddl => 'PRIMARY KEY (`a`)', }, }, - defs => { + defs => { a => ' `a` int(11) NOT NULL', b => ' `b` char(50) default NULL', }, - numeric_cols => [qw(a)], - is_numeric => { a => 1 }, - engine => 'MyISAM', - type_for => { a => 'int', b => 'char' }, - name => 't2', - charset => 'latin1', + numeric_cols => [qw(a)], + is_numeric => { a => 1 }, + is_generated => {}, + engine => 'MyISAM', + type_for => { a => 'int', b => 'char' }, + name => 't2', + charset => 'latin1', }, 'No clustered key on MyISAM table' ); @@ -751,21 +858,23 @@ cmp_ddls('v5.0 vs. v5.1', 't/lib/samples/issue_109-01-v50.sql', 't/lib/samples/i $tbl = $tp->parse( load_file('t/lib/samples/issue_132.sql') ); is_deeply( $tbl, - { cols => [qw(country)], - col_posn => { country => 0 }, - is_col => { country => 1 }, - is_autoinc => { country => 0 }, - null_cols => [qw(country)], - is_nullable => { country => 1 }, - clustered_key => undef, - keys => {}, - defs => { country => " `country` enum('','Cote D`ivoire') default NULL"}, - numeric_cols => [], - is_numeric => {}, - engine => 'MyISAM', - type_for => { country => 'enum' }, - name => 'issue_132', - charset => 'latin1', + { cols => [qw(country)], + non_generated_cols => [qw(country)], + col_posn => { country => 0 }, + is_col => { country => 1 }, + is_autoinc => { country => 0 }, + is_generated => {}, + null_cols => [qw(country)], + is_nullable => { country => 1 }, + clustered_key => undef, + keys => {}, + defs => { country => " `country` enum('','Cote D`ivoire') default NULL"}, + numeric_cols => [], + is_numeric => {}, + engine => 'MyISAM', + type_for => { country => 'enum' }, + name => 'issue_132', + charset => 'latin1', }, 'ENUM col with backtick in value (issue 132)' ); @@ -787,21 +896,23 @@ is( $tbl = $tp->parse( load_file('t/lib/samples/issue_330_backtick_pair_in_col_comments.sql') ); is_deeply( $tbl, - { cols => [qw(a)], - col_posn => { a => 0 }, - is_col => { a => 1 }, - is_autoinc => { a => 0 }, - null_cols => [qw(a)], - is_nullable => { a => 1 }, - clustered_key => undef, - keys => {}, - defs => { a => " `a` int(11) DEFAULT NULL COMMENT 'issue_330 `alex`'" }, - numeric_cols => [qw(a)], - is_numeric => { a => 1 }, - engine => 'MyISAM', - type_for => { a => 'int' }, - name => 'issue_330', - charset => 'latin1', + { cols => [qw(a)], + non_generated_cols => [qw(a)], + col_posn => { a => 0 }, + is_col => { a => 1 }, + is_generated => {}, + is_autoinc => { a => 0 }, + null_cols => [qw(a)], + is_nullable => { a => 1 }, + clustered_key => undef, + keys => {}, + defs => { a => " `a` int(11) DEFAULT NULL COMMENT 'issue_330 `alex`'" }, + numeric_cols => [qw(a)], + is_numeric => { a => 1 }, + engine => 'MyISAM', + type_for => { a => 'int' }, + name => 'issue_330', + charset => 'latin1', }, 'issue with pairing backticks in column comments (issue 330)' ); @@ -810,24 +921,26 @@ is_deeply( $tbl = $tp->parse( load_file('t/lib/samples/issue_pt-193_backtick_in_col_comments.sql') ); is_deeply( $tbl, - { cols => [qw(id f22abcde f23abc)], - col_posn => { id => 0, f22abcde => 1, f23abc => 2 }, - is_col => { id => 1, f22abcde => 1, f23abc => 1 }, - is_autoinc => { id => 1, f22abcde => 0, f23abc => 0 }, - null_cols => [qw(f22abcde)], - is_nullable => { f22abcde => 1}, - clustered_key => undef, - keys => {}, - defs => { id => " `id` int(11) NOT NULL AUTO_INCREMENT", - "f22abcde" => " `f22abcde` int(10) unsigned DEFAULT NULL COMMENT 'xxx`XXx'", - "f23abc" => " `f23abc` int(10) unsigned NOT NULL DEFAULT '255' COMMENT \"`yyy\"" - }, - numeric_cols => [qw(id f22abcde f23abc)], - is_numeric => { id => 1, f22abcde => 1, f23abc => 1 }, - engine => 'InnoDB', - type_for => { id => 'int', f22abcde => 'int', f23abc => 'int' }, - name => 't3', - charset => 'latin1', + { cols => [qw(id f22abcde f23abc)], + non_generated_cols => [qw(id f22abcde f23abc)], + col_posn => { id => 0, f22abcde => 1, f23abc => 2 }, + is_col => { id => 1, f22abcde => 1, f23abc => 1 }, + is_autoinc => { id => 1, f22abcde => 0, f23abc => 0 }, + is_generated => {}, + null_cols => [qw(f22abcde)], + is_nullable => { f22abcde => 1}, + clustered_key => undef, + keys => {}, + defs => { id => " `id` int(11) NOT NULL AUTO_INCREMENT", + "f22abcde" => " `f22abcde` int(10) unsigned DEFAULT NULL COMMENT 'xxx`XXx'", + "f23abc" => " `f23abc` int(10) unsigned NOT NULL DEFAULT '255' COMMENT \"`yyy\"" + }, + numeric_cols => [qw(id f22abcde f23abc)], + is_numeric => { id => 1, f22abcde => 1, f23abc => 1 }, + engine => 'InnoDB', + type_for => { id => 'int', f22abcde => 'int', f23abc => 'int' }, + name => 't3', + charset => 'latin1', }, 'issue with pairing backticks in column comments (issue 330)' ); @@ -874,12 +987,14 @@ is_deeply( clustered_key => undef, col_posn => { 'first, last' => 1, id => 0 }, cols => [ 'id', 'first, last' ], + non_generated_cols => [ 'id', 'first, last' ], defs => { 'first, last' => ' `first, last` varchar(32) default NULL', id => ' `id` int(11) NOT NULL auto_increment', }, engine => 'MyISAM', is_autoinc => { 'first, last' => 0, id => 1 }, + is_generated => {}, is_col => { 'first, last' => 1, id => 1 }, is_nullable => { 'first, last' => 1 }, is_numeric => { id => 1 }, @@ -1000,22 +1115,24 @@ $tbl = $tp->parse(load_file('t/lib/samples/triple-quoted-col.sql')); is_deeply( $tbl, { - clustered_key => undef, - col_posn => { 'foo' => 0, bar => 1 }, - cols => [ 'foo', 'bar' ], - defs => { + clustered_key => undef, + col_posn => { 'foo' => 0, bar => 1 }, + is_generated => {}, + cols => [ 'foo', 'bar' ], + non_generated_cols => [ 'foo', 'bar' ], + defs => { 'foo' => ' `foo` int(11) DEFAULT NULL', 'bar' => ' ```bar``` int(11) DEFAULT NULL', }, - engine => 'InnoDB', - is_autoinc => { foo => 0, bar => 0 }, - is_col => { foo => 1, bar => 1 }, - is_nullable => { foo => 1, bar => 1 }, - is_numeric => { foo => 1, bar => 1 }, - name => 't', - null_cols => [ 'foo', 'bar' ], - numeric_cols => [ 'foo', 'bar' ], - type_for => { + engine => 'InnoDB', + is_autoinc => { foo => 0, bar => 0 }, + is_col => { foo => 1, bar => 1 }, + is_nullable => { foo => 1, bar => 1 }, + is_numeric => { foo => 1, bar => 1 }, + name => 't', + null_cols => [ 'foo', 'bar' ], + numeric_cols => [ 'foo', 'bar' ], + type_for => { foo => 'int', bar => 'int', }, @@ -1025,6 +1142,51 @@ is_deeply( 'Literal backticks (bug 1462904)' ); +SKIP: { + skip "generated column tests require MySQL 5.7+", 1 + if $sandbox_version lt '5.7'; + $tbl = $tp->parse( load_file('t/lib/samples/generated_cols.sql') ); + is_deeply( + $tbl, + { + charset => 'utf8mb4', + clustered_key => 'PRIMARY', + col_posn => { column2 => 1, column3 => 2, id => 0 }, + cols => [ 'id', 'column2', 'column3' ], + non_generated_cols => [ 'id', 'column2' ], + defs => { + column2 => ' `column2` int(11) DEFAULT NULL', + column3 => ' `column3` int(11) GENERATED ALWAYS AS ((`column2` + 1)) STORED', + id => ' `id` int(11) NOT NULL' + }, + engine => 'InnoDB', + is_autoinc => { column2 => 0, column3 => 0, id => 0 }, + is_col => { column2 => 1, column3 => 1, id => 1 }, + is_generated => { column3 => 1 }, + is_nullable => { column2 => 1, column3 => 1 }, + is_numeric => { column2 => 1, column3 => 1, id => 1 }, + keys => { + PRIMARY => { + col_prefixes => [ undef ], + colnames => '`id`', + cols => [ 'id' ], + ddl => 'PRIMARY KEY (`id`)', + is_col => { id => 1 }, + is_nullable => 0, + is_unique => 1, + name => 'PRIMARY', + type => 'BTREE' + } + }, + name => 't1', + null_cols => [ 'column2', 'column3' ], + numeric_cols => [ 'id', 'column2', 'column3' ], + type_for => { column2 => 'int', column3 => 'int', id => 'int' } + }, + 'Generated columns is OK', + ) or die Data::Dumper::Dumper($tbl); +} + # ############################################################################# # Done. # ############################################################################# diff --git a/t/lib/samples/generated_cols.sql b/t/lib/samples/generated_cols.sql new file mode 100644 index 00000000..d51e964b --- /dev/null +++ b/t/lib/samples/generated_cols.sql @@ -0,0 +1,6 @@ +CREATE TABLE `t1` ( + `ID` int(11) NOT NULL, + `Column2` int(11) DEFAULT NULL, + `Column3` int(11) GENERATED ALWAYS AS ((`Column2` + 1)) STORED, + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci diff --git a/t/pt-online-schema-change/pt-202.t b/t/pt-online-schema-change/pt-202.t new file mode 100644 index 00000000..d02643fd --- /dev/null +++ b/t/pt-online-schema-change/pt-202.t @@ -0,0 +1,76 @@ +#!/usr/bin/env perl + +BEGIN { + die "The PERCONA_TOOLKIT_BRANCH environment variable is not set.\n" + unless $ENV{PERCONA_TOOLKIT_BRANCH} && -d $ENV{PERCONA_TOOLKIT_BRANCH}; + unshift @INC, "$ENV{PERCONA_TOOLKIT_BRANCH}/lib"; +}; + +use strict; +use warnings FATAL => 'all'; +use threads; + +use English qw(-no_match_vars); +use Test::More; + +use Data::Dumper; +use PerconaTest; +use Sandbox; +use SqlModes; +use File::Temp qw/ tempdir /; + +require "$trunk/bin/pt-online-schema-change"; + +my $dp = new DSNParser(opts=>$dsn_opts); +my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp); +my $master_dbh = $sb->get_dbh_for('master'); +my $master_dsn = 'h=127.1,P=12345,u=msandbox,p=msandbox'; + +if ( !$master_dbh ) { + plan skip_all => 'Cannot connect to sandbox master'; +} + +if ($sandbox_version lt '5.7') { + plan skip_all => "generated column tests require MySQL 5.7+"; +} + +plan tests => 3; + +# The sandbox servers run with lock_wait_timeout=3 and it's not dynamic +# so we need to specify --set-vars innodb_lock_wait_timeout=3 else the +# tool will die. +my @args = (qw(--set-vars innodb_lock_wait_timeout=3)); +my $output; +my $exit_status; +my $sample = "t/pt-online-schema-change/samples/"; + +$sb->load_file('master', "$sample/pt-202.sql"); + +($output, $exit_status) = full_output( + sub { pt_online_schema_change::main(@args, "$master_dsn,D=test,t=t1", + '--execute', + '--alter', "ADD COLUMN `Column4` VARCHAR(45) NULL AFTER `Column3`", + ), + }, +); + +is( + $exit_status, + 0, + "PT-202 Altering table having generated columns exit status 0", +); + +like( + $output, + qr/Successfully altered `test`.`t1`/s, + "PT-202 Altering table having generated columns success", +); + +$master_dbh->do("DROP DATABASE IF EXISTS test"); + +# ############################################################################# +# Done. +# ############################################################################# +$sb->wipe_clean($master_dbh); +ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox"); +done_testing; diff --git a/t/pt-online-schema-change/samples/pt-202.sql b/t/pt-online-schema-change/samples/pt-202.sql new file mode 100644 index 00000000..721780d2 --- /dev/null +++ b/t/pt-online-schema-change/samples/pt-202.sql @@ -0,0 +1,9 @@ +CREATE SCHEMA IF NOT EXISTS test; +USE test; +DROP TABLE IF EXISTS t1; +CREATE TABLE `test`.`t1` ( +`ID` int(11) NOT NULL, +`Column2` int(11) DEFAULT NULL, +`Column3` int(11) GENERATED ALWAYS AS ((`Column2` + 1)) STORED, +PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; From 228d87e108e76328a7571bfcfd627b1db6ff6590 Mon Sep 17 00:00:00 2001 From: Kamil Dziedzic Date: Thu, 5 Oct 2017 21:36:18 +0200 Subject: [PATCH 078/104] Fix expecting iter.Close() Adding prof.Stop() ensures iterator gets closed --- src/go/mongolib/profiler/profiler_test.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/go/mongolib/profiler/profiler_test.go b/src/go/mongolib/profiler/profiler_test.go index c3289396..2e112ae9 100644 --- a/src/go/mongolib/profiler/profiler_test.go +++ b/src/go/mongolib/profiler/profiler_test.go @@ -89,6 +89,7 @@ func TestRegularIterator(t *testing.T) { }, } prof.Start() + defer prof.Stop() select { case queries := <-prof.QueriesChan(): if !reflect.DeepEqual(queries, want) { @@ -150,6 +151,7 @@ func TestIteratorTimeout(t *testing.T) { } prof.Start() + defer prof.Stop() gotTimeout := false // Get a timeout @@ -174,8 +176,6 @@ func TestIteratorTimeout(t *testing.T) { case <-time.After(2 * time.Second): t.Error("Didn't get any query after 2 seconds") } - - prof.Stop() } func TestTailIterator(t *testing.T) { @@ -251,6 +251,7 @@ func TestTailIterator(t *testing.T) { }, } prof.Start() + defer prof.Stop() index := 0 // Since the mocked iterator has a Sleep(1500 ms) between Next methods calls, // we are going to have two ticker ticks and on every tick it will return one document. @@ -300,6 +301,7 @@ func TestCalcStats(t *testing.T) { prof := NewProfiler(iter, filters, nil, s) prof.Start() + defer prof.Stop() select { case queries := <-prof.QueriesChan(): s := queries.CalcQueriesStats(1) @@ -349,6 +351,7 @@ func TestCalcTotalStats(t *testing.T) { prof := NewProfiler(iter, filters, nil, s) prof.Start() + defer prof.Stop() select { case queries := <-prof.QueriesChan(): s := queries.CalcTotalQueriesStats(1) From 804529e3535d602680b5f14b373ec44fd2b05fb4 Mon Sep 17 00:00:00 2001 From: Kamil Dziedzic Date: Wed, 11 Oct 2017 18:04:34 +0200 Subject: [PATCH 079/104] PMM-1429: generate table of supported versions --- src/go/mongolib/stats/stats_test.go | 220 ++++++++- .../available_metrics/available_metrics | 421 ++++++++++++++++++ .../tests/expect/available_metrics/cmd_metric | 252 +++++++++++ .../expect/available_metrics/cmd_metric.md | 19 + 4 files changed, 901 insertions(+), 11 deletions(-) create mode 100755 src/go/tests/expect/available_metrics/available_metrics create mode 100755 src/go/tests/expect/available_metrics/cmd_metric create mode 100755 src/go/tests/expect/available_metrics/cmd_metric.md diff --git a/src/go/mongolib/stats/stats_test.go b/src/go/mongolib/stats/stats_test.go index 68f01c7f..6207bb04 100644 --- a/src/go/mongolib/stats/stats_test.go +++ b/src/go/mongolib/stats/stats_test.go @@ -1,13 +1,17 @@ package stats import ( + "bytes" + "fmt" + "io/ioutil" "log" "os" "reflect" + "sort" + "strings" "testing" + "text/template" "time" - "io/ioutil" - "fmt" "github.com/golang/mock/gomock" "github.com/percona/percona-toolkit/src/go/lib/tutil" @@ -232,16 +236,16 @@ func TestStatsAll(t *testing.T) { s := New(fp) for _, file := range files { - doc := proto.SystemProfile{} - err = tutil.LoadBson(dir+file.Name(), &doc) - if err != nil { - t.Fatalf("cannot load sample %s: %s", dir+file.Name(), err) - } + doc := proto.SystemProfile{} + err = tutil.LoadBson(dir+file.Name(), &doc) + if err != nil { + t.Fatalf("cannot load sample %s: %s", dir+file.Name(), err) + } - err = s.Add(doc) - if err != nil { - t.Errorf("Error processing doc: %s\n", err.Error()) - } + err = s.Add(doc) + if err != nil { + t.Errorf("Error processing doc: %s\n", err.Error()) + } } got := s.Queries() @@ -261,3 +265,197 @@ func TestStatsAll(t *testing.T) { } } +func TestAvailableMetrics(t *testing.T) { + t.Parallel() + + var err error + dirExpect := vars.RootPath + samples + "/expect/available_metrics/" + dir := vars.RootPath + samples + "/doc/out/" + + versions := []string{ + "2.6.12", + "3.0.15", + "3.2.16", + "3.4.7", + "3.5.11", + } + + samples := []string{ + "aggregate", + "count", + "count_with_query", + "delete", + "delete_all", + "distinct", + "find", + "find_andrii", + "find_empty", + "findandmodify", + "geonear", + "group", + "insert", + "mapreduce", + "update", + "explain", + "eval", + } + + type sp struct { + DocsExamined *int `bson:"docsExamined" json:",omitempty"` + NscannedObjects *int `bson:"nscannedObjects" json:",omitempty"` + Millis *int `bson:"millis" json:",omitempty"` + Nreturned *int `bson:"nreturned" json:",omitempty"` + ResponseLength *int `bson:"responseLength" json:",omitempty"` + } + + data := map[string]map[string]sp{} + + for _, sample := range samples { + for _, v := range versions { + f := sample + "_" + v + s := sp{} + err = tutil.LoadBson(dir+f, &s) + if err != nil { + t.Fatalf("cannot load sample %s: %s", dir+f, err) + } + + if data[sample] == nil { + data[sample] = map[string]sp{} + } + data[sample][v] = s + } + } + + t.Run("available_metrics", func(t *testing.T) { + got := data + fExpect := dirExpect + "available_metrics" + if tutil.ShouldUpdateSamples() { + err := tutil.WriteJson(fExpect, got) + if err != nil { + fmt.Printf("cannot update samples: %s", err.Error()) + } + } + + expect := map[string]map[string]sp{} + err = tutil.LoadJson(fExpect, &expect) + if err != nil { + t.Fatalf("cannot load expected data %s: %s", fExpect, err) + } + + if !reflect.DeepEqual(got, expect) { + t.Errorf("s.Queries() = %s, want %s", got, expect) + } + + }) + + t.Run("cmd_metric", func(t *testing.T) { + got := map[string]map[string][]string{} + for s := range data { + for v := range data[s] { + if got[s] == nil { + got[s] = map[string][]string{} + } + if data[s][v].Millis != nil { + got[s]["Query Time"] = append(got[s]["Query Time"], v) + } + if data[s][v].DocsExamined != nil || data[s][v].NscannedObjects != nil { + got[s]["Docs Scanned"] = append(got[s]["Docs Scanned"], v) + } + if data[s][v].Nreturned != nil { + got[s]["Docs Returned"] = append(got[s]["Docs Returned"], v) + } + if data[s][v].ResponseLength != nil { + got[s]["Bytes Sent"] = append(got[s]["Bytes Sent"], v) + } + } + } + + metrics := []string{ + "Query Time", + "Docs Scanned", + "Docs Returned", + "Bytes Sent", + } + for cmd := range got { + for metric := range got[cmd] { + if len(got[cmd][metric]) == len(versions) { + got[cmd][metric] = []string{"yes"} + } else { + sort.Strings(got[cmd][metric]) + } + } + + for _, metric := range metrics { + if len(got[cmd][metric]) == 0 { + got[cmd][metric] = []string{"no"} + } + } + } + + fExpect := dirExpect + "cmd_metric" + if tutil.ShouldUpdateSamples() { + err := tutil.WriteJson(fExpect, got) + if err != nil { + fmt.Printf("cannot update samples: %s", err.Error()) + } + } + + expect := map[string]map[string][]string{} + err = tutil.LoadJson(fExpect, &expect) + if err != nil { + t.Fatalf("cannot load expected data %s: %s", fExpect, err) + } + + if !reflect.DeepEqual(got, expect) { + t.Errorf("s.Queries() = %s, want %s", got, expect) + } + + data := got + t.Run("md", func(t *testing.T) { + type result struct { + Metrics []string + Samples []string + Data map[string]map[string][]string + } + r := result{ + Metrics: metrics, + Samples: samples, + Data: data, + } + sort.Strings(r.Metrics) + sort.Strings(r.Samples) + + tmpl := template.New("") + tmpl = tmpl.Funcs(template.FuncMap{"join": strings.Join}) + tmpl, err := tmpl.Parse(`| | {{range .Metrics}}{{.}} | {{end}} +| - | {{range .Metrics}}- | {{end}}{{range $s := .Samples}} +| {{$s}} | {{range $m := $.Metrics}}{{join (index $.Data $s $m) ", "}} | {{end}}{{end}}`) + if err != nil { + panic(err) + } + var got bytes.Buffer + err = tmpl.Execute(&got, r) + if err != nil { + panic(err) + } + + fExpect := dirExpect + "cmd_metric.md" + if tutil.ShouldUpdateSamples() { + err = ioutil.WriteFile(fExpect, got.Bytes(), 0777) + if err != nil { + fmt.Printf("cannot update samples: %s", err.Error()) + } + } + + buf, err := ioutil.ReadFile(fExpect) + if err != nil { + t.Fatalf("cannot load expected data %s: %s", fExpect, err) + } + expect := string(buf) + + if !reflect.DeepEqual(got, expect) { + t.Errorf("s.Queries() = %s, want %s", got, expect) + } + }) + }) +} diff --git a/src/go/tests/expect/available_metrics/available_metrics b/src/go/tests/expect/available_metrics/available_metrics new file mode 100755 index 00000000..c512073d --- /dev/null +++ b/src/go/tests/expect/available_metrics/available_metrics @@ -0,0 +1,421 @@ +{ + "aggregate": { + "2.6.12": { + "Millis": 0, + "ResponseLength": 385 + }, + "3.0.15": { + "Millis": 2, + "ResponseLength": 385 + }, + "3.2.16": { + "Millis": 2, + "ResponseLength": 388 + }, + "3.4.7": { + "DocsExamined": 8, + "Millis": 0, + "Nreturned": 8, + "ResponseLength": 370 + }, + "3.5.11": { + "DocsExamined": 8, + "Millis": 2, + "Nreturned": 8, + "ResponseLength": 370 + } + }, + "count": { + "2.6.12": { + "Millis": 0, + "ResponseLength": 48 + }, + "3.0.15": { + "Millis": 0, + "ResponseLength": 44 + }, + "3.2.16": { + "Millis": 0, + "ResponseLength": 47 + }, + "3.4.7": { + "DocsExamined": 0, + "Millis": 0, + "ResponseLength": 29 + }, + "3.5.11": { + "DocsExamined": 0, + "Millis": 0, + "ResponseLength": 29 + } + }, + "count_with_query": { + "2.6.12": { + "Millis": 0, + "ResponseLength": 48 + }, + "3.0.15": { + "Millis": 0, + "ResponseLength": 44 + }, + "3.2.16": { + "Millis": 0, + "ResponseLength": 47 + }, + "3.4.7": { + "DocsExamined": 0, + "Millis": 0, + "ResponseLength": 29 + }, + "3.5.11": { + "DocsExamined": 0, + "Millis": 0, + "ResponseLength": 29 + } + }, + "delete": { + "2.6.12": { + "Millis": 0 + }, + "3.0.15": { + "Millis": 0 + }, + "3.2.16": { + "Millis": 1 + }, + "3.4.7": { + "DocsExamined": 4, + "Millis": 0 + }, + "3.5.11": { + "DocsExamined": 4, + "Millis": 0 + } + }, + "delete_all": { + "2.6.12": { + "Millis": 0 + }, + "3.0.15": { + "Millis": 1 + }, + "3.2.16": { + "Millis": 0 + }, + "3.4.7": { + "DocsExamined": 39, + "Millis": 0 + }, + "3.5.11": { + "DocsExamined": 39, + "Millis": 0 + } + }, + "distinct": { + "2.6.12": { + "Millis": 0, + "ResponseLength": 254 + }, + "3.0.15": { + "Millis": 0, + "ResponseLength": 261 + }, + "3.2.16": { + "Millis": 0, + "ResponseLength": 264 + }, + "3.4.7": { + "DocsExamined": 10, + "Millis": 0, + "ResponseLength": 145 + }, + "3.5.11": { + "DocsExamined": 10, + "Millis": 0, + "ResponseLength": 145 + } + }, + "eval": { + "2.6.12": { + "Millis": 65, + "ResponseLength": 108 + }, + "3.0.15": { + "Millis": 35, + "ResponseLength": 108 + }, + "3.2.16": { + "Millis": 88, + "ResponseLength": 93 + }, + "3.4.7": { + "Millis": 91, + "ResponseLength": 93 + }, + "3.5.11": { + "Millis": 47, + "ResponseLength": 93 + } + }, + "explain": { + "2.6.12": { + "NscannedObjects": 44, + "Millis": 0, + "Nreturned": 1, + "ResponseLength": 583 + }, + "3.0.15": { + "Millis": 0, + "ResponseLength": 379 + }, + "3.2.16": { + "Millis": 0, + "ResponseLength": 364 + }, + "3.4.7": { + "Millis": 0, + "ResponseLength": 328 + }, + "3.5.11": { + "Millis": 0, + "ResponseLength": 329 + } + }, + "find": { + "2.6.12": { + "NscannedObjects": 6, + "Millis": 0, + "Nreturned": 6, + "ResponseLength": 251 + }, + "3.0.15": { + "NscannedObjects": 6, + "Millis": 0, + "Nreturned": 6, + "ResponseLength": 251 + }, + "3.2.16": { + "DocsExamined": 6, + "Millis": 0, + "Nreturned": 6, + "ResponseLength": 349 + }, + "3.4.7": { + "DocsExamined": 6, + "Millis": 0, + "Nreturned": 6, + "ResponseLength": 331 + }, + "3.5.11": { + "DocsExamined": 6, + "Millis": 1, + "Nreturned": 6, + "ResponseLength": 331 + } + }, + "find_andrii": { + "2.6.12": { + "NscannedObjects": 98, + "Millis": 0, + "Nreturned": 0, + "ResponseLength": 20 + }, + "3.0.15": { + "NscannedObjects": 98, + "Millis": 0, + "Nreturned": 0, + "ResponseLength": 20 + }, + "3.2.16": { + "DocsExamined": 49, + "Millis": 0, + "Nreturned": 0, + "ResponseLength": 100 + }, + "3.4.7": { + "DocsExamined": 49, + "Millis": 0, + "Nreturned": 0, + "ResponseLength": 82 + }, + "3.5.11": { + "DocsExamined": 49, + "Millis": 0, + "Nreturned": 0, + "ResponseLength": 82 + } + }, + "find_empty": { + "2.6.12": { + "NscannedObjects": 49, + "Millis": 0, + "Nreturned": 49, + "ResponseLength": 1846 + }, + "3.0.15": { + "NscannedObjects": 49, + "Millis": 0, + "Nreturned": 49, + "ResponseLength": 1846 + }, + "3.2.16": { + "DocsExamined": 49, + "Millis": 0, + "Nreturned": 49, + "ResponseLength": 2112 + }, + "3.4.7": { + "DocsExamined": 49, + "Millis": 0, + "Nreturned": 49, + "ResponseLength": 2094 + }, + "3.5.11": { + "DocsExamined": 49, + "Millis": 0, + "Nreturned": 49, + "ResponseLength": 2094 + } + }, + "findandmodify": { + "2.6.12": { + "NscannedObjects": 1, + "Millis": 0, + "ResponseLength": 131 + }, + "3.0.15": { + "NscannedObjects": 1, + "Millis": 0, + "ResponseLength": 131 + }, + "3.2.16": { + "DocsExamined": 3, + "Millis": 0, + "ResponseLength": 116 + }, + "3.4.7": { + "DocsExamined": 3, + "Millis": 0, + "ResponseLength": 116 + }, + "3.5.11": { + "DocsExamined": 3, + "Millis": 0, + "ResponseLength": 116 + } + }, + "geonear": { + "2.6.12": { + "Millis": 1, + "ResponseLength": 1406 + }, + "3.0.15": { + "Millis": 3, + "ResponseLength": 1398 + }, + "3.2.16": { + "Millis": 8, + "ResponseLength": 1401 + }, + "3.4.7": { + "DocsExamined": 10, + "Millis": 11, + "ResponseLength": 1383 + }, + "3.5.11": { + "DocsExamined": 10, + "Millis": 7, + "ResponseLength": 1383 + } + }, + "group": { + "2.6.12": { + "Millis": 77, + "ResponseLength": 135 + }, + "3.0.15": { + "Millis": 54, + "ResponseLength": 139 + }, + "3.2.16": { + "Millis": 74, + "ResponseLength": 142 + }, + "3.4.7": { + "DocsExamined": 2, + "Millis": 77, + "ResponseLength": 124 + }, + "3.5.11": { + "DocsExamined": 2, + "Millis": 68, + "ResponseLength": 124 + } + }, + "insert": { + "2.6.12": { + "Millis": 0 + }, + "3.0.15": { + "Millis": 0 + }, + "3.2.16": { + "Millis": 0, + "ResponseLength": 25 + }, + "3.4.7": { + "Millis": 0, + "ResponseLength": 29 + }, + "3.5.11": { + "Millis": 0, + "ResponseLength": 29 + } + }, + "mapreduce": { + "2.6.12": { + "Millis": 33, + "ResponseLength": 233 + }, + "3.0.15": { + "Millis": 26, + "ResponseLength": 233 + }, + "3.2.16": { + "Millis": 31, + "ResponseLength": 218 + }, + "3.4.7": { + "DocsExamined": 3, + "Millis": 43, + "ResponseLength": 218 + }, + "3.5.11": { + "DocsExamined": 3, + "Millis": 35, + "ResponseLength": 218 + } + }, + "update": { + "2.6.12": { + "NscannedObjects": 1, + "Millis": 0 + }, + "3.0.15": { + "NscannedObjects": 1, + "Millis": 0 + }, + "3.2.16": { + "DocsExamined": 1, + "Millis": 0 + }, + "3.4.7": { + "DocsExamined": 1, + "Millis": 0 + }, + "3.5.11": { + "DocsExamined": 1, + "Millis": 0 + } + } +} \ No newline at end of file diff --git a/src/go/tests/expect/available_metrics/cmd_metric b/src/go/tests/expect/available_metrics/cmd_metric new file mode 100755 index 00000000..31ee3e8a --- /dev/null +++ b/src/go/tests/expect/available_metrics/cmd_metric @@ -0,0 +1,252 @@ +{ + "aggregate": { + "Bytes Sent": [ + "yes" + ], + "Docs Returned": [ + "3.4.7", + "3.5.11" + ], + "Docs Scanned": [ + "3.4.7", + "3.5.11" + ], + "Query Time": [ + "yes" + ] + }, + "count": { + "Bytes Sent": [ + "yes" + ], + "Docs Returned": [ + "no" + ], + "Docs Scanned": [ + "3.4.7", + "3.5.11" + ], + "Query Time": [ + "yes" + ] + }, + "count_with_query": { + "Bytes Sent": [ + "yes" + ], + "Docs Returned": [ + "no" + ], + "Docs Scanned": [ + "3.4.7", + "3.5.11" + ], + "Query Time": [ + "yes" + ] + }, + "delete": { + "Bytes Sent": [ + "no" + ], + "Docs Returned": [ + "no" + ], + "Docs Scanned": [ + "3.4.7", + "3.5.11" + ], + "Query Time": [ + "yes" + ] + }, + "delete_all": { + "Bytes Sent": [ + "no" + ], + "Docs Returned": [ + "no" + ], + "Docs Scanned": [ + "3.4.7", + "3.5.11" + ], + "Query Time": [ + "yes" + ] + }, + "distinct": { + "Bytes Sent": [ + "yes" + ], + "Docs Returned": [ + "no" + ], + "Docs Scanned": [ + "3.4.7", + "3.5.11" + ], + "Query Time": [ + "yes" + ] + }, + "eval": { + "Bytes Sent": [ + "yes" + ], + "Docs Returned": [ + "no" + ], + "Docs Scanned": [ + "no" + ], + "Query Time": [ + "yes" + ] + }, + "explain": { + "Bytes Sent": [ + "yes" + ], + "Docs Returned": [ + "2.6.12" + ], + "Docs Scanned": [ + "2.6.12" + ], + "Query Time": [ + "yes" + ] + }, + "find": { + "Bytes Sent": [ + "yes" + ], + "Docs Returned": [ + "yes" + ], + "Docs Scanned": [ + "yes" + ], + "Query Time": [ + "yes" + ] + }, + "find_andrii": { + "Bytes Sent": [ + "yes" + ], + "Docs Returned": [ + "yes" + ], + "Docs Scanned": [ + "yes" + ], + "Query Time": [ + "yes" + ] + }, + "find_empty": { + "Bytes Sent": [ + "yes" + ], + "Docs Returned": [ + "yes" + ], + "Docs Scanned": [ + "yes" + ], + "Query Time": [ + "yes" + ] + }, + "findandmodify": { + "Bytes Sent": [ + "yes" + ], + "Docs Returned": [ + "no" + ], + "Docs Scanned": [ + "yes" + ], + "Query Time": [ + "yes" + ] + }, + "geonear": { + "Bytes Sent": [ + "yes" + ], + "Docs Returned": [ + "no" + ], + "Docs Scanned": [ + "3.4.7", + "3.5.11" + ], + "Query Time": [ + "yes" + ] + }, + "group": { + "Bytes Sent": [ + "yes" + ], + "Docs Returned": [ + "no" + ], + "Docs Scanned": [ + "3.4.7", + "3.5.11" + ], + "Query Time": [ + "yes" + ] + }, + "insert": { + "Bytes Sent": [ + "3.2.16", + "3.4.7", + "3.5.11" + ], + "Docs Returned": [ + "no" + ], + "Docs Scanned": [ + "no" + ], + "Query Time": [ + "yes" + ] + }, + "mapreduce": { + "Bytes Sent": [ + "yes" + ], + "Docs Returned": [ + "no" + ], + "Docs Scanned": [ + "3.4.7", + "3.5.11" + ], + "Query Time": [ + "yes" + ] + }, + "update": { + "Bytes Sent": [ + "no" + ], + "Docs Returned": [ + "no" + ], + "Docs Scanned": [ + "yes" + ], + "Query Time": [ + "yes" + ] + } +} \ No newline at end of file diff --git a/src/go/tests/expect/available_metrics/cmd_metric.md b/src/go/tests/expect/available_metrics/cmd_metric.md new file mode 100755 index 00000000..034dc818 --- /dev/null +++ b/src/go/tests/expect/available_metrics/cmd_metric.md @@ -0,0 +1,19 @@ +| | Bytes Sent | Docs Returned | Docs Scanned | Query Time | +| - | - | - | - | - | +| aggregate | yes | >=3.4 | >=3.4 | yes | +| count | yes | no | >=3.4 | yes | +| count_with_query | yes | no | >=3.4 | yes | +| delete | no | no | >=3.4 | yes | +| delete_all | no | no | >=3.4 | yes | +| distinct | yes | no | >=3.4 | yes | +| eval | yes | no | no | yes | +| explain | yes | no | no | yes | +| find | yes | yes | yes | yes | +| find_andrii | yes | yes | yes | yes | +| find_empty | yes | yes | yes | yes | +| findandmodify | yes | no | yes | yes | +| geonear | yes | no | >=3.4 | yes | +| group | yes | no | >=3.4 | yes | +| insert | >=3.2 | no | no | yes | +| mapreduce | yes | no | >=3.4 | yes | +| update | no | no | yes | yes | \ No newline at end of file From 4cfbe403a31f4faed7754a6801a13144b3b0fc97 Mon Sep 17 00:00:00 2001 From: Kamil Dziedzic Date: Wed, 11 Oct 2017 18:45:25 +0200 Subject: [PATCH 080/104] for now without range sum --- .../expect/available_metrics/cmd_metric.md | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/go/tests/expect/available_metrics/cmd_metric.md b/src/go/tests/expect/available_metrics/cmd_metric.md index 034dc818..ec6edeef 100755 --- a/src/go/tests/expect/available_metrics/cmd_metric.md +++ b/src/go/tests/expect/available_metrics/cmd_metric.md @@ -1,19 +1,19 @@ | | Bytes Sent | Docs Returned | Docs Scanned | Query Time | | - | - | - | - | - | -| aggregate | yes | >=3.4 | >=3.4 | yes | -| count | yes | no | >=3.4 | yes | -| count_with_query | yes | no | >=3.4 | yes | -| delete | no | no | >=3.4 | yes | -| delete_all | no | no | >=3.4 | yes | -| distinct | yes | no | >=3.4 | yes | +| aggregate | yes | 3.4.7, 3.5.11 | 3.4.7, 3.5.11 | yes | +| count | yes | no | 3.4.7, 3.5.11 | yes | +| count_with_query | yes | no | 3.4.7, 3.5.11 | yes | +| delete | no | no | 3.4.7, 3.5.11 | yes | +| delete_all | no | no | 3.4.7, 3.5.11 | yes | +| distinct | yes | no | 3.4.7, 3.5.11 | yes | | eval | yes | no | no | yes | -| explain | yes | no | no | yes | +| explain | yes | 2.6.12 | 2.6.12 | yes | | find | yes | yes | yes | yes | | find_andrii | yes | yes | yes | yes | | find_empty | yes | yes | yes | yes | | findandmodify | yes | no | yes | yes | -| geonear | yes | no | >=3.4 | yes | -| group | yes | no | >=3.4 | yes | -| insert | >=3.2 | no | no | yes | -| mapreduce | yes | no | >=3.4 | yes | +| geonear | yes | no | 3.4.7, 3.5.11 | yes | +| group | yes | no | 3.4.7, 3.5.11 | yes | +| insert | 3.2.16, 3.4.7, 3.5.11 | no | no | yes | +| mapreduce | yes | no | 3.4.7, 3.5.11 | yes | | update | no | no | yes | yes | \ No newline at end of file From edb358ee049a6a712bc1e23fd516e2cdd230ac07 Mon Sep 17 00:00:00 2001 From: Kamil Dziedzic Date: Wed, 11 Oct 2017 18:57:27 +0200 Subject: [PATCH 081/104] trim spaces --- src/go/mongolib/stats/stats_test.go | 6 +-- .../expect/available_metrics/cmd_metric.md | 38 +++++++++---------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/go/mongolib/stats/stats_test.go b/src/go/mongolib/stats/stats_test.go index 6207bb04..33b76050 100644 --- a/src/go/mongolib/stats/stats_test.go +++ b/src/go/mongolib/stats/stats_test.go @@ -427,9 +427,9 @@ func TestAvailableMetrics(t *testing.T) { tmpl := template.New("") tmpl = tmpl.Funcs(template.FuncMap{"join": strings.Join}) - tmpl, err := tmpl.Parse(`| | {{range .Metrics}}{{.}} | {{end}} -| - | {{range .Metrics}}- | {{end}}{{range $s := .Samples}} -| {{$s}} | {{range $m := $.Metrics}}{{join (index $.Data $s $m) ", "}} | {{end}}{{end}}`) + tmpl, err := tmpl.Parse(`| |{{range .Metrics}} {{.}} |{{end}} +| - |{{range .Metrics}} - |{{end}}{{range $s := .Samples}} +| {{$s}} |{{range $m := $.Metrics}} {{join (index $.Data $s $m) ", "}} |{{end}}{{end}}`) if err != nil { panic(err) } diff --git a/src/go/tests/expect/available_metrics/cmd_metric.md b/src/go/tests/expect/available_metrics/cmd_metric.md index ec6edeef..ab6f000b 100755 --- a/src/go/tests/expect/available_metrics/cmd_metric.md +++ b/src/go/tests/expect/available_metrics/cmd_metric.md @@ -1,19 +1,19 @@ -| | Bytes Sent | Docs Returned | Docs Scanned | Query Time | -| - | - | - | - | - | -| aggregate | yes | 3.4.7, 3.5.11 | 3.4.7, 3.5.11 | yes | -| count | yes | no | 3.4.7, 3.5.11 | yes | -| count_with_query | yes | no | 3.4.7, 3.5.11 | yes | -| delete | no | no | 3.4.7, 3.5.11 | yes | -| delete_all | no | no | 3.4.7, 3.5.11 | yes | -| distinct | yes | no | 3.4.7, 3.5.11 | yes | -| eval | yes | no | no | yes | -| explain | yes | 2.6.12 | 2.6.12 | yes | -| find | yes | yes | yes | yes | -| find_andrii | yes | yes | yes | yes | -| find_empty | yes | yes | yes | yes | -| findandmodify | yes | no | yes | yes | -| geonear | yes | no | 3.4.7, 3.5.11 | yes | -| group | yes | no | 3.4.7, 3.5.11 | yes | -| insert | 3.2.16, 3.4.7, 3.5.11 | no | no | yes | -| mapreduce | yes | no | 3.4.7, 3.5.11 | yes | -| update | no | no | yes | yes | \ No newline at end of file +| | Bytes Sent | Docs Returned | Docs Scanned | Query Time | +| - | - | - | - | - | +| aggregate | yes | 3.4.7, 3.5.11 | 3.4.7, 3.5.11 | yes | +| count | yes | no | 3.4.7, 3.5.11 | yes | +| count_with_query | yes | no | 3.4.7, 3.5.11 | yes | +| delete | no | no | 3.4.7, 3.5.11 | yes | +| delete_all | no | no | 3.4.7, 3.5.11 | yes | +| distinct | yes | no | 3.4.7, 3.5.11 | yes | +| eval | yes | no | no | yes | +| explain | yes | 2.6.12 | 2.6.12 | yes | +| find | yes | yes | yes | yes | +| find_andrii | yes | yes | yes | yes | +| find_empty | yes | yes | yes | yes | +| findandmodify | yes | no | yes | yes | +| geonear | yes | no | 3.4.7, 3.5.11 | yes | +| group | yes | no | 3.4.7, 3.5.11 | yes | +| insert | 3.2.16, 3.4.7, 3.5.11 | no | no | yes | +| mapreduce | yes | no | 3.4.7, 3.5.11 | yes | +| update | no | no | yes | yes | \ No newline at end of file From 0b85979b526e1d40369bc2a05313e845ffc9ef2c Mon Sep 17 00:00:00 2001 From: Kamil Dziedzic Date: Wed, 11 Oct 2017 19:14:30 +0200 Subject: [PATCH 082/104] fix comparing string to bytes --- src/go/mongolib/stats/stats_test.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/go/mongolib/stats/stats_test.go b/src/go/mongolib/stats/stats_test.go index 33b76050..501322d1 100644 --- a/src/go/mongolib/stats/stats_test.go +++ b/src/go/mongolib/stats/stats_test.go @@ -433,15 +433,16 @@ func TestAvailableMetrics(t *testing.T) { if err != nil { panic(err) } - var got bytes.Buffer - err = tmpl.Execute(&got, r) + var bufGot bytes.Buffer + err = tmpl.Execute(&bufGot, r) if err != nil { panic(err) } + got := bufGot.String() fExpect := dirExpect + "cmd_metric.md" if tutil.ShouldUpdateSamples() { - err = ioutil.WriteFile(fExpect, got.Bytes(), 0777) + err = ioutil.WriteFile(fExpect, bufGot.Bytes(), 0777) if err != nil { fmt.Printf("cannot update samples: %s", err.Error()) } @@ -454,7 +455,7 @@ func TestAvailableMetrics(t *testing.T) { expect := string(buf) if !reflect.DeepEqual(got, expect) { - t.Errorf("s.Queries() = %s, want %s", got, expect) + t.Errorf("got %s, want %s", got, expect) } }) }) From 6a2be6e68468dae59d7331165e69f53968a144c3 Mon Sep 17 00:00:00 2001 From: Kamil Dziedzic Date: Sat, 14 Oct 2017 15:21:22 +0200 Subject: [PATCH 083/104] test pt-mongodb-query-digest output --- src/go/lib/profiling/profiling.go | 94 ++++++ src/go/pt-mongodb-query-digest/main_test.go | 313 +++++++++++++++++++- 2 files changed, 406 insertions(+), 1 deletion(-) create mode 100644 src/go/lib/profiling/profiling.go diff --git a/src/go/lib/profiling/profiling.go b/src/go/lib/profiling/profiling.go new file mode 100644 index 00000000..40ef4cb3 --- /dev/null +++ b/src/go/lib/profiling/profiling.go @@ -0,0 +1,94 @@ +/* + Copyright (c) 2017, Percona LLC and/or its affiliates. All rights reserved. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see +*/ + +package profiling + +import ( + "github.com/percona/pmgo" + "gopkg.in/mgo.v2" + "gopkg.in/mgo.v2/bson" +) + +func Enable(url string) error { + session, err := createSession(url) + if err != nil { + return err + } + defer session.Close() + + err = profile(session.DB(""), 2) + if err != nil { + return err + } + + return nil +} + +func Disable(url string) error { + session, err := createSession(url) + if err != nil { + return err + } + defer session.Close() + + err = profile(session.DB(""), 0) + if err != nil { + return err + } + + return nil +} + +func Drop(url string) error { + session, err := createSession(url) + if err != nil { + return err + } + defer session.Close() + + return session.DB("").C("system.profile").DropCollection() +} + +func profile(db pmgo.DatabaseManager, v int) error { + result := struct { + Was int + Slowms int + Ratelimit int + }{} + return db.Run( + bson.M{ + "profile": v, + }, + &result, + ) +} + +func createSession(url string) (pmgo.SessionManager, error) { + dialInfo, err := pmgo.ParseURL(url) + if err != nil { + return nil, err + } + dialer := pmgo.NewDialer() + + session, err := dialer.DialWithInfo(dialInfo) + if err != nil { + return nil, err + } + + session.SetMode(mgo.Eventual, true) + return session, nil +} diff --git a/src/go/pt-mongodb-query-digest/main_test.go b/src/go/pt-mongodb-query-digest/main_test.go index 8260b180..ed91924a 100644 --- a/src/go/pt-mongodb-query-digest/main_test.go +++ b/src/go/pt-mongodb-query-digest/main_test.go @@ -1,21 +1,46 @@ package main import ( + "bufio" + "context" + "fmt" "io/ioutil" + "log" "os" + "os/exec" "reflect" + "regexp" + "runtime" "strings" "testing" + "time" "github.com/pborman/getopt/v2" + "github.com/percona/percona-toolkit/src/go/lib/profiling" + "github.com/percona/percona-toolkit/src/go/lib/tutil" "github.com/percona/pmgo" - "gopkg.in/mgo.v2/dbtest" ) +const ( + samples = "/src/go/tests/" +) + +type testVars struct { + RootPath string +} + +var vars testVars var Server dbtest.DBServer func TestMain(m *testing.M) { + var err error + if vars.RootPath, err = tutil.RootPath(); err != nil { + log.Printf("cannot get root path: %s", err.Error()) + os.Exit(1) + } + os.Exit(m.Run()) + // The tempdir is created so MongoDB has a location to store its files. // Contents are wiped once the server stops os.Setenv("CHECK_SESSIONS", "0") @@ -98,3 +123,289 @@ func TestParseArgs(t *testing.T) { } } + +type Data struct { + bin string + url string +} + +func TestPTMongoDBQueryDigest(t *testing.T) { + var err error + + binDir, err := ioutil.TempDir("/tmp", "pmm-client-test-bindir-") + if err != nil { + t.Error(err) + } + defer func() { + err := os.RemoveAll(binDir) + if err != nil { + t.Error(err) + } + }() + + bin := binDir + "/pt-mongodb-query-digest" + xVariables := map[string]string{ + "main.Build": "", + "main.Version": "", + "main.GoVersion": "", + } + var ldflags []string + for x, value := range xVariables { + ldflags = append(ldflags, fmt.Sprintf("-X %s=%s", x, value)) + } + cmd := exec.Command( + "go", + "build", + "-o", + bin, + "-ldflags", + strings.Join(ldflags, " "), + ) + cmd.Stdout = os.Stdout + cmd.Stderr = os.Stderr + err = cmd.Run() + if err != nil { + t.Error(err) + } + + data := Data{ + bin: bin, + } + tests := []func(*testing.T, Data){ + testVersion, + testEmptySystemProfile, + testAllOperationsTemplate, + } + t.Run("pmm-admin", func(t *testing.T) { + for _, f := range tests { + f := f // capture range variable + fName := runtime.FuncForPC(reflect.ValueOf(f).Pointer()).Name() + t.Run(fName, func(t *testing.T) { + // Clean up system.profile + var err error + data.url = "127.0.0.1/test" + err = profiling.Drop(data.url) + if err != nil { + t.Error(err) + } + err = profiling.Enable(data.url) + if err != nil { + t.Error(err) + } + defer profiling.Disable(data.url) + + // t.Parallel() + f(t, data) + }) + } + }) + +} + +func testVersion(t *testing.T, data Data) { + cmd := exec.Command( + data.bin, + "--version", + ) + output, err := cmd.CombinedOutput() + if err != nil { + t.Error(err) + } + expected := `pt-mongodb-query-digest +Version +Build: using ` + + assertRegexpLines(t, expected, string(output)) +} + +func testEmptySystemProfile(t *testing.T, data Data) { + cmd := exec.Command( + data.bin, + data.url, + ) + output, err := cmd.CombinedOutput() + if err != nil { + t.Error(err) + } + + expected := `pt-mongodb-query-digest .+ +Host: ` + data.url + ` +Skipping profiled queries on these collections: \[system\.profile\] + + +# Totals +# Ratio 0.00 \(docs scanned/returned\) +# Attribute pct total min max avg 95% stddev median +# ================== === ======== ======== ======== ======== ======== ======= ======== +# Count \(docs\) 0\s +# Exec Time ms 0 NaN NaN NaN NaN NaN NaN NaN\s +# Docs Scanned 0 NaN NaN NaN NaN NaN NaN NaN\s +# Docs Returned 0 NaN NaN NaN NaN NaN NaN NaN\s +# Bytes recv 0 NaN NaN NaN NaN NaN NaN NaN\s +#\s + +` + + assertRegexpLines(t, expected, string(output)) +} + +func testAllOperationsTemplate(t *testing.T, data Data) { + dir := vars.RootPath + samples + "/doc/script/profile/" + files, err := ioutil.ReadDir(dir) + if err != nil { + t.Fatalf("cannot list samples: %s", err) + } + + for _, file := range files { + err := run(dir + file.Name()) + if err != nil { + t.Fatalf("cannot execute query '%s': %s", dir+file.Name(), err) + } + + } + cmd := exec.Command( + data.bin, + data.url, + ) + + output, err := cmd.CombinedOutput() + if err != nil { + t.Error(err) + } + + expected := `pt-mongodb-query-digest .+ +Host: ` + data.url + ` +Skipping profiled queries on these collections: \[system\.profile\] + + +# Totals +# Ratio 0.00 \(docs scanned/returned\) +# Attribute pct total min max avg 95% stddev median +# ================== === ======== ======== ======== ======== ======== ======= ======== +# Count \(docs\) 111\s +# Exec Time ms (\s*[0-9]+){8}\s +# Docs Scanned 100 53.00 0.00 47.00 0.48 0.00 4.46 0.00\s +# Docs Returned 0 0.00 0.00 0.00 0.00 0.00 0.00 0.00\s +# Bytes recv 100 3.12K 0.00 29.00 28.14 29.00 4.77 29.00\s +#\s + +# Query 1: 0.00 QPS, ID a7ce8dee16beadb767484112e6b29af3 +# Ratio 0.00 \(docs scanned/returned\) +# Time range: .* to .* +# Attribute pct total min max avg 95% stddev median +# ================== === ======== ======== ======== ======== ======== ======= ======== +# Count \(docs\) 107\s +# Exec Time ms (\s*[0-9]+){8}\s +# Docs Scanned 0 0.00 0.00 0.00 0.00 0.00 0.00 0.00\s +# Docs Returned 0 0.00 0.00 0.00 0.00 0.00 0.00 0.00\s +# Bytes recv 99 3.10K 29.00 29.00 29.00 29.00 0.00 29.00\s +# String: +# Namespaces test.coll +# Operation insert +# Fingerprint INSERT coll +# Query {"ns":"test.coll","op":"insert","query":{"insert":"coll","documents":\[{"_id":{"\$oid":".+"},"a":9}\],"ordered":true}} + + +# Query 2: 0.00 QPS, ID bab52c8aa977c96ecd148c015ae07c42 +# Ratio 0.00 \(docs scanned/returned\) +# Time range: .* to .* +# Attribute pct total min max avg 95% stddev median +# ================== === ======== ======== ======== ======== ======== ======= ======== +# Count \(docs\) 2\s +# Exec Time ms (\s*[0-9]+){8}\s +# Docs Scanned 98 52.00 5.00 47.00 26.00 47.00 21.00 26.00\s +# Docs Returned 0 0.00 0.00 0.00 0.00 0.00 0.00 0.00\s +# Bytes recv 0 0.00 0.00 0.00 0.00 0.00 0.00 0.00\s +# String: +# Namespaces test.coll +# Operation remove +# Fingerprint REMOVE coll a,b +# Query {"ns":"test.coll","op":"remove","query":{"a":{"\$gte":2},"b":{"\$gte":2}}} + + +# Query 3: 0.00 QPS, ID ffd83008fd6affc7c07053f583dea3e0 +# Ratio 0.00 \(docs scanned/returned\) +# Time range: .* to .* +# Attribute pct total min max avg 95% stddev median +# ================== === ======== ======== ======== ======== ======== ======= ======== +# Count \(docs\) 1\s +# Exec Time ms (\s*[0-9]+){8}\s +# Docs Scanned 0 0.00 0.00 0.00 0.00 0.00 0.00 0.00\s +# Docs Returned 0 0.00 0.00 0.00 0.00 0.00 0.00 0.00\s +# Bytes recv 1 20.00 20.00 20.00 20.00 20.00 0.00 20.00\s +# String: +# Namespaces test.system.js +# Operation query +# Fingerprint FIND system.js find +# Query {"ns":"test.system.js","op":"query","query":{"find":"system.js"}} + + +# Query 4: 0.00 QPS, ID 27cb39e62745b1ff4121b4bf6f21fb12 +# Ratio 0.00 \(docs scanned/returned\) +# Time range: .* to .* +# Attribute pct total min max avg 95% stddev median +# ================== === ======== ======== ======== ======== ======== ======= ======== +# Count \(docs\) 1\s +# Exec Time ms (\s*[0-9]+){8}\s +# Docs Scanned 2 1.00 1.00 1.00 1.00 1.00 0.00 1.00\s +# Docs Returned 0 0.00 0.00 0.00 0.00 0.00 0.00 0.00\s +# Bytes recv 0 0.00 0.00 0.00 0.00 0.00 0.00 0.00\s +# String: +# Namespaces test.coll +# Operation update +# Fingerprint UPDATE coll a +# Query {"ns":"test.coll","op":"update","query":{"a":{"\$gte":2}},"updateobj":{"\$set":{"c":1},"\$inc":{"a":-10}}} + +` + + assertRegexpLines(t, expected, string(output)) +} + +// assertRegexpLines matches regexp line by line to corresponding line of text +func assertRegexpLines(t *testing.T, rx string, str string, msgAndArgs ...interface{}) bool { + expectedScanner := bufio.NewScanner(strings.NewReader(rx)) + defer func() { + if err := expectedScanner.Err(); err != nil { + t.Fatal(err) + } + }() + + actualScanner := bufio.NewScanner(strings.NewReader(str)) + defer func() { + if err := actualScanner.Err(); err != nil { + t.Fatal(err) + } + }() + + ok := true + for { + asOk := actualScanner.Scan() + esOk := expectedScanner.Scan() + + switch { + case asOk && esOk: + ok, err := regexp.MatchString("^"+expectedScanner.Text()+"$", actualScanner.Text()) + if err != nil { + t.Error(err) + } + if !ok { + t.Errorf("regexp '%s' doesn't match '%s'", expectedScanner.Text(), actualScanner.Text()) + } + case asOk: + t.Errorf("didn't expect more lines but got: %s", actualScanner.Text()) + ok = false + case esOk: + t.Errorf("didn't got line but expected it to match against: %s", expectedScanner.Text()) + ok = false + default: + return ok + } + } +} + +func run(filename string) error { + ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) + defer cancel() + return exec.CommandContext(ctx, "mongo", filename).Run() + +} From 7106e78796970f08f01c099f2ded463ac2a2a18a Mon Sep 17 00:00:00 2001 From: Kamil Dziedzic Date: Sat, 14 Oct 2017 15:45:12 +0200 Subject: [PATCH 084/104] abstract more values --- src/go/pt-mongodb-query-digest/main_test.go | 30 ++++++++++----------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/go/pt-mongodb-query-digest/main_test.go b/src/go/pt-mongodb-query-digest/main_test.go index ed91924a..206ba102 100644 --- a/src/go/pt-mongodb-query-digest/main_test.go +++ b/src/go/pt-mongodb-query-digest/main_test.go @@ -284,9 +284,9 @@ Skipping profiled queries on these collections: \[system\.profile\] # ================== === ======== ======== ======== ======== ======== ======= ======== # Count \(docs\) 111\s # Exec Time ms (\s*[0-9]+){8}\s -# Docs Scanned 100 53.00 0.00 47.00 0.48 0.00 4.46 0.00\s -# Docs Returned 0 0.00 0.00 0.00 0.00 0.00 0.00 0.00\s -# Bytes recv 100 3.12K 0.00 29.00 28.14 29.00 4.77 29.00\s +# Docs Scanned (\s*[0-9\.]+){8}\s +# Docs Returned (\s*[0-9\.]+){8}\s +# Bytes recv (\s*[0-9\.K]+){8}\s #\s # Query 1: 0.00 QPS, ID a7ce8dee16beadb767484112e6b29af3 @@ -296,9 +296,9 @@ Skipping profiled queries on these collections: \[system\.profile\] # ================== === ======== ======== ======== ======== ======== ======= ======== # Count \(docs\) 107\s # Exec Time ms (\s*[0-9]+){8}\s -# Docs Scanned 0 0.00 0.00 0.00 0.00 0.00 0.00 0.00\s -# Docs Returned 0 0.00 0.00 0.00 0.00 0.00 0.00 0.00\s -# Bytes recv 99 3.10K 29.00 29.00 29.00 29.00 0.00 29.00\s +# Docs Scanned (\s*[0-9\.]+){8}\s +# Docs Returned (\s*[0-9\.]+){8}\s +# Bytes recv (\s*[0-9\.K]+){8}\s # String: # Namespaces test.coll # Operation insert @@ -313,9 +313,9 @@ Skipping profiled queries on these collections: \[system\.profile\] # ================== === ======== ======== ======== ======== ======== ======= ======== # Count \(docs\) 2\s # Exec Time ms (\s*[0-9]+){8}\s -# Docs Scanned 98 52.00 5.00 47.00 26.00 47.00 21.00 26.00\s -# Docs Returned 0 0.00 0.00 0.00 0.00 0.00 0.00 0.00\s -# Bytes recv 0 0.00 0.00 0.00 0.00 0.00 0.00 0.00\s +# Docs Scanned (\s*[0-9\.]+){8}\s +# Docs Returned (\s*[0-9\.]+){8}\s +# Bytes recv (\s*[0-9\.K]+){8}\s # String: # Namespaces test.coll # Operation remove @@ -330,9 +330,9 @@ Skipping profiled queries on these collections: \[system\.profile\] # ================== === ======== ======== ======== ======== ======== ======= ======== # Count \(docs\) 1\s # Exec Time ms (\s*[0-9]+){8}\s -# Docs Scanned 0 0.00 0.00 0.00 0.00 0.00 0.00 0.00\s -# Docs Returned 0 0.00 0.00 0.00 0.00 0.00 0.00 0.00\s -# Bytes recv 1 20.00 20.00 20.00 20.00 20.00 0.00 20.00\s +# Docs Scanned (\s*[0-9\.]+){8}\s +# Docs Returned (\s*[0-9\.]+){8}\s +# Bytes recv (\s*[0-9\.K]+){8}\s # String: # Namespaces test.system.js # Operation query @@ -347,9 +347,9 @@ Skipping profiled queries on these collections: \[system\.profile\] # ================== === ======== ======== ======== ======== ======== ======= ======== # Count \(docs\) 1\s # Exec Time ms (\s*[0-9]+){8}\s -# Docs Scanned 2 1.00 1.00 1.00 1.00 1.00 0.00 1.00\s -# Docs Returned 0 0.00 0.00 0.00 0.00 0.00 0.00 0.00\s -# Bytes recv 0 0.00 0.00 0.00 0.00 0.00 0.00 0.00\s +# Docs Scanned (\s*[0-9\.]+){8}\s +# Docs Returned (\s*[0-9\.]+){8}\s +# Bytes recv (\s*[0-9\.K]+){8}\s # String: # Namespaces test.coll # Operation update From 6cbfd363f3c0c9346ff40a50c502b0452333c55c Mon Sep 17 00:00:00 2001 From: Kamil Dziedzic Date: Sat, 14 Oct 2017 18:25:08 +0200 Subject: [PATCH 085/104] s/Bytes recv/Bytes sent/; allow all queries to be fingerprinted --- src/go/mongolib/profiler/profiler.go | 26 +-- src/go/pt-mongodb-query-digest/main.go | 10 +- src/go/pt-mongodb-query-digest/main_test.go | 212 ++++++++++++++------ 3 files changed, 164 insertions(+), 84 deletions(-) diff --git a/src/go/mongolib/profiler/profiler.go b/src/go/mongolib/profiler/profiler.go index 44f85c21..320aeb99 100644 --- a/src/go/mongolib/profiler/profiler.go +++ b/src/go/mongolib/profiler/profiler.go @@ -18,7 +18,7 @@ var ( type Profiler interface { GetLastError() error QueriesChan() chan stats.Queries - TimeoutsChan() <-chan time.Time + FlushQueries() Start() Stop() } @@ -93,13 +93,6 @@ func (p *Profile) Stop() { } } -func (p *Profile) TimeoutsChan() <-chan time.Time { - if p.timeoutsChan == nil { - p.timeoutsChan = make(chan time.Time) - } - return p.timeoutsChan -} - func (p *Profile) getData() { go p.getDocs() p.stopWaitGroup.Add(1) @@ -108,8 +101,7 @@ MAIN_GETDATA_LOOP: for { select { case <-p.ticker: - p.queriesChan <- p.stats.Queries() - p.stats.Reset() + p.FlushQueries() case <-p.stopChan: // Close the iterator to break the loop on getDocs p.iterator.Close() @@ -120,6 +112,9 @@ MAIN_GETDATA_LOOP: } func (p *Profile) getDocs() { + defer p.Stop() + defer p.FlushQueries() + var doc proto.SystemProfile for p.iterator.Next(&doc) || p.iterator.Timeout() { @@ -139,10 +134,11 @@ func (p *Profile) getDocs() { if !valid { continue } - if doc.Query.Len() > 0 { - p.stats.Add(doc) - } + p.stats.Add(doc) } - p.queriesChan <- p.stats.Queries() - p.Stop() +} + +func (p *Profile) FlushQueries() { + p.queriesChan <- p.stats.Queries() + p.stats.Reset() } diff --git a/src/go/pt-mongodb-query-digest/main.go b/src/go/pt-mongodb-query-digest/main.go index 2acd0cb0..625a640e 100644 --- a/src/go/pt-mongodb-query-digest/main.go +++ b/src/go/pt-mongodb-query-digest/main.go @@ -62,7 +62,7 @@ func main() { opts, err := getOptions() if err != nil { - log.Errorf("error processing commad line arguments: %s", err) + log.Errorf("error processing command line arguments: %s", err) os.Exit(1) } if opts == nil && err == nil { @@ -136,7 +136,7 @@ func main() { filters = append(filters, filter.NewFilterByCollection(opts.SkipCollections)) } - query := bson.M{"op": bson.M{"$nin": []string{"getmore", "delete"}}} + query := bson.M{"op": bson.M{"$nin": []string{"getmore"}}} i := session.DB(di.Database).C("system.profile").Find(query).Sort("-$natural").Iter() fp := fingerprinter.NewFingerprinter(fingerprinter.DEFAULT_KEY_FILTERS) @@ -327,9 +327,9 @@ func getQueryTemplate() string { # Exec Time ms {{printf "% 4.0f" .QueryTime.Pct}} {{printf "% 7.0f " .QueryTime.Total}} {{printf "% 7.0f " .QueryTime.Min}} {{printf "% 7.0f " .QueryTime.Max}} {{printf "% 7.0f " .QueryTime.Avg}} {{printf "% 7.0f " .QueryTime.Pct95}} {{printf "% 7.0f " .QueryTime.StdDev}} {{printf "% 7.0f " .QueryTime.Median}} # Docs Scanned {{printf "% 4.0f" .Scanned.Pct}} {{Format .Scanned.Total 7.2}} {{Format .Scanned.Min 7.2}} {{Format .Scanned.Max 7.2}} {{Format .Scanned.Avg 7.2}} {{Format .Scanned.Pct95 7.2}} {{Format .Scanned.StdDev 7.2}} {{Format .Scanned.Median 7.2}} # Docs Returned {{printf "% 4.0f" .Returned.Pct}} {{Format .Returned.Total 7.2}} {{Format .Returned.Min 7.2}} {{Format .Returned.Max 7.2}} {{Format .Returned.Avg 7.2}} {{Format .Returned.Pct95 7.2}} {{Format .Returned.StdDev 7.2}} {{Format .Returned.Median 7.2}} -# Bytes recv {{printf "% 4.0f" .ResponseLength.Pct}} {{Format .ResponseLength.Total 7.2}} {{Format .ResponseLength.Min 7.2}} {{Format .ResponseLength.Max 7.2}} {{Format .ResponseLength.Avg 7.2}} {{Format .ResponseLength.Pct95 7.2}} {{Format .ResponseLength.StdDev 7.2}} {{Format .ResponseLength.Median 7.2}} +# Bytes sent {{printf "% 4.0f" .ResponseLength.Pct}} {{Format .ResponseLength.Total 7.2}} {{Format .ResponseLength.Min 7.2}} {{Format .ResponseLength.Max 7.2}} {{Format .ResponseLength.Avg 7.2}} {{Format .ResponseLength.Pct95 7.2}} {{Format .ResponseLength.StdDev 7.2}} {{Format .ResponseLength.Median 7.2}} # String: -# Namespaces {{.Namespace}} +# Namespace {{.Namespace}} # Operation {{.Operation}} # Fingerprint {{.Fingerprint}} # Query {{.Query}} @@ -347,7 +347,7 @@ func getTotalsTemplate() string { # Exec Time ms {{printf "% 4.0f" .QueryTime.Pct}} {{printf "% 7.0f " .QueryTime.Total}} {{printf "% 7.0f " .QueryTime.Min}} {{printf "% 7.0f " .QueryTime.Max}} {{printf "% 7.0f " .QueryTime.Avg}} {{printf "% 7.0f " .QueryTime.Pct95}} {{printf "% 7.0f " .QueryTime.StdDev}} {{printf "% 7.0f " .QueryTime.Median}} # Docs Scanned {{printf "% 4.0f" .Scanned.Pct}} {{Format .Scanned.Total 7.2}} {{Format .Scanned.Min 7.2}} {{Format .Scanned.Max 7.2}} {{Format .Scanned.Avg 7.2}} {{Format .Scanned.Pct95 7.2}} {{Format .Scanned.StdDev 7.2}} {{Format .Scanned.Median 7.2}} # Docs Returned {{printf "% 4.0f" .Returned.Pct}} {{Format .Returned.Total 7.2}} {{Format .Returned.Min 7.2}} {{Format .Returned.Max 7.2}} {{Format .Returned.Avg 7.2}} {{Format .Returned.Pct95 7.2}} {{Format .Returned.StdDev 7.2}} {{Format .Returned.Median 7.2}} -# Bytes recv {{printf "% 4.0f" .ResponseLength.Pct}} {{Format .ResponseLength.Total 7.2}} {{Format .ResponseLength.Min 7.2}} {{Format .ResponseLength.Max 7.2}} {{Format .ResponseLength.Avg 7.2}} {{Format .ResponseLength.Pct95 7.2}} {{Format .ResponseLength.StdDev 7.2}} {{Format .ResponseLength.Median 7.2}} +# Bytes sent {{printf "% 4.0f" .ResponseLength.Pct}} {{Format .ResponseLength.Total 7.2}} {{Format .ResponseLength.Min 7.2}} {{Format .ResponseLength.Max 7.2}} {{Format .ResponseLength.Avg 7.2}} {{Format .ResponseLength.Pct95 7.2}} {{Format .ResponseLength.StdDev 7.2}} {{Format .ResponseLength.Median 7.2}} # ` return t diff --git a/src/go/pt-mongodb-query-digest/main_test.go b/src/go/pt-mongodb-query-digest/main_test.go index 206ba102..b77cc0af 100644 --- a/src/go/pt-mongodb-query-digest/main_test.go +++ b/src/go/pt-mongodb-query-digest/main_test.go @@ -15,9 +15,13 @@ import ( "testing" "time" + "bytes" + "text/template" + "github.com/pborman/getopt/v2" "github.com/percona/percona-toolkit/src/go/lib/profiling" "github.com/percona/percona-toolkit/src/go/lib/tutil" + "github.com/percona/percona-toolkit/src/go/mongolib/stats" "github.com/percona/pmgo" "gopkg.in/mgo.v2/dbtest" ) @@ -184,6 +188,10 @@ func TestPTMongoDBQueryDigest(t *testing.T) { // Clean up system.profile var err error data.url = "127.0.0.1/test" + err = profiling.Disable(data.url) + if err != nil { + t.Error(err) + } err = profiling.Drop(data.url) if err != nil { t.Error(err) @@ -261,8 +269,12 @@ func testAllOperationsTemplate(t *testing.T, data Data) { if err != nil { t.Fatalf("cannot execute query '%s': %s", dir+file.Name(), err) } - } + + // disable profiling so pt-mongodb-query digest reads rows from `system.profile` + profiling.Disable(data.url) + + // run profiler cmd := exec.Command( data.bin, data.url, @@ -273,91 +285,163 @@ func testAllOperationsTemplate(t *testing.T, data Data) { t.Error(err) } - expected := `pt-mongodb-query-digest .+ + expected := `Profiler is disabled for the "test" database but there are 125 documents in the system.profile collection. +Using those documents for the stats +pt-mongodb-query-digest .+ Host: ` + data.url + ` Skipping profiled queries on these collections: \[system\.profile\] # Totals -# Ratio 0.00 \(docs scanned/returned\) +# Ratio [0-9\.]+ \(docs scanned/returned\) # Attribute pct total min max avg 95% stddev median # ================== === ======== ======== ======== ======== ======== ======= ======== -# Count \(docs\) 111\s +# Count \(docs\) 125\s # Exec Time ms (\s*[0-9]+){8}\s # Docs Scanned (\s*[0-9\.]+){8}\s # Docs Returned (\s*[0-9\.]+){8}\s -# Bytes recv (\s*[0-9\.K]+){8}\s +# Bytes sent (\s*[0-9\.K]+){8}(K|\s) #\s +` -# Query 1: 0.00 QPS, ID a7ce8dee16beadb767484112e6b29af3 -# Ratio 0.00 \(docs scanned/returned\) + queries := []stats.QueryStats{ + { + ID: "a7ce8dee16beadb767484112e6b29af3", + Namespace: "test.coll", + Operation: "insert", + Fingerprint: "INSERT coll", + Query: `{"ns":"test.coll","op":"insert","query":{"insert":"coll","documents":\[{"_id":{"\$oid":".*"},"a":9}\],"ordered":true}}`, + }, + { + ID: "7e6e9af8a1754a065b323acdddbee4b5", + Namespace: "test.coll", + Operation: "command", + Fingerprint: "DROP coll drop", + Query: `{"ns":"test.coll","op":"command","command":{"drop":"coll"}}`, + }, + { + ID: "bab52c8aa977c96ecd148c015ae07c42", + Namespace: "test.coll", + Operation: "remove", + Fingerprint: "REMOVE coll a,b", + Query: regexp.QuoteMeta(`{"ns":"test.coll","op":"remove","query":{"a":{"$gte":2},"b":{"$gte":2}}}`), + }, + { + ID: "11e1b6f695d43b1b5a2f7e6de2ad8305", + Namespace: "test.coll", + Operation: "command", + Fingerprint: "AGGREGATE coll a", + Query: regexp.QuoteMeta(`{"ns":"test.coll","op":"command","command":{"aggregate":"coll","pipeline":[{"$match":{"a":{"$gte":2}}}],"cursor":{}}}`), + }, + { + ID: "a4be6ed97c946182af7e30cf818afdac", + Namespace: "test.coll", + Operation: "command", + Fingerprint: "DISTINCT coll a,b", + Query: regexp.QuoteMeta(`{"ns":"test.coll","op":"command","command":{"distinct":"coll","key":"a","query":{"b":{"$gte":5}}}}`), + }, + { + ID: "e2f53c6824c5cbe454e33e128b350d1e", + Namespace: "test.coll", + Operation: "command", + Fingerprint: "EXPLAIN", + Query: `{"ns":"test.coll","op":"command","command":{"explain":{"find":"coll","filter":{}},"verbosity":"queryPlanner"}}`, + }, + { + ID: "9423eaa90c222686d092c04f001fb369", + Namespace: "test.coll", + Operation: "command", + Fingerprint: "FINDANDMODIFY coll a", + Query: regexp.QuoteMeta(`{"ns":"test.coll","op":"command","command":{"findandmodify":"coll","query":{"a":2},"update":{"$inc":{"b":1}}},"updateobj":{"$inc":{"b":1}}}`), + }, + { + ID: "dd20c739baef5a3fd9352c350c7e69f1", + Namespace: "test.coll", + Operation: "command", + Fingerprint: "GEONEAR coll", + Query: regexp.QuoteMeta(`{"ns":"test.coll","op":"command","command":{"geoNear":"coll","near":{"type":"Point","coordinates":[1,1]},"spherical":true}}`), + }, + { + ID: "018a055f724d418b80e66b98bfdb25a5", + Namespace: "test.coll", + Operation: "command", + Fingerprint: "GROUP coll a,b", + Query: regexp.QuoteMeta(`{"ns":"test.coll","op":"command","command":{"group":{"key":{"a":1,"b":1},"cond":{"b":3},"initial":{},"ns":"coll","$reduce":{"Code":"function () {}","Scope":null}}}}`), + }, + { + ID: "130827f5b7afe1369f619ccd5cd61ec4", + Namespace: "test.coll", + Operation: "command", + Fingerprint: "MAPREDUCE coll a", + Query: regexp.QuoteMeta(`{"ns":"test.coll","op":"command","command":{"mapreduce":"coll","map":{"Code":"function () {\n emit(this.a, this.b);\n}","Scope":null},"reduce":{"Code":"function (a, b) {\n return Array.sum(b);\n}","Scope":null},"query":{"a":{"$gte":0}},"out":{"inline":1}}}`), + }, + { + ID: "71b3d6aa44d34aaa02cd65bad3e25f49", + Namespace: "test", + Operation: "command", + Fingerprint: "EVAL", + Query: regexp.QuoteMeta(`{"ns":"test","op":"command","command":{"$eval":"db"}}`), + }, + { + ID: "2300d7f2d372205544f249b010e9b8ad", + Namespace: "test.coll", + Operation: "command", + Fingerprint: "COUNT coll a", + Query: regexp.QuoteMeta(`{"ns":"test.coll","op":"command","command":{"count":"coll","query":{"a":{"$gt":5}},"fields":{}}}`), + }, + { + ID: "ffd83008fd6affc7c07053f583dea3e0", + Namespace: "test.system.js", + Operation: "query", + Fingerprint: "FIND system.js find", + Query: `{"ns":"test.system.js","op":"query","query":{"find":"system.js"}}`, + }, + { + ID: "29701e3d37e0adb35ebd70b7ef2b3f3d", + Namespace: "test.coll", + Operation: "command", + Fingerprint: "COUNT coll", + Query: `{"ns":"test.coll","op":"command","command":{"count":"coll","query":{},"fields":{}}}`, + }, + { + ID: "27cb39e62745b1ff4121b4bf6f21fb12", + Namespace: "test.coll", + Operation: "update", + Fingerprint: "UPDATE coll a", + Query: regexp.QuoteMeta(`{"ns":"test.coll","op":"update","query":{"a":{"$gte":2}},"updateobj":{"$set":{"c":1},"$inc":{"a":-10}}}`), + }, + } + + queryTpl := ` +# Query [0-9]+: 0.00 QPS, ID {{.ID}} +# Ratio [0-9\.]+ \(docs scanned/returned\) # Time range: .* to .* # Attribute pct total min max avg 95% stddev median # ================== === ======== ======== ======== ======== ======== ======= ======== -# Count \(docs\) 107\s +# Count \(docs\) (\s*[0-9]+)\s # Exec Time ms (\s*[0-9]+){8}\s # Docs Scanned (\s*[0-9\.]+){8}\s # Docs Returned (\s*[0-9\.]+){8}\s -# Bytes recv (\s*[0-9\.K]+){8}\s +# Bytes sent (\s*[0-9\.K]+){8}(K|\s) # String: -# Namespaces test.coll -# Operation insert -# Fingerprint INSERT coll -# Query {"ns":"test.coll","op":"insert","query":{"insert":"coll","documents":\[{"_id":{"\$oid":".+"},"a":9}\],"ordered":true}} - - -# Query 2: 0.00 QPS, ID bab52c8aa977c96ecd148c015ae07c42 -# Ratio 0.00 \(docs scanned/returned\) -# Time range: .* to .* -# Attribute pct total min max avg 95% stddev median -# ================== === ======== ======== ======== ======== ======== ======= ======== -# Count \(docs\) 2\s -# Exec Time ms (\s*[0-9]+){8}\s -# Docs Scanned (\s*[0-9\.]+){8}\s -# Docs Returned (\s*[0-9\.]+){8}\s -# Bytes recv (\s*[0-9\.K]+){8}\s -# String: -# Namespaces test.coll -# Operation remove -# Fingerprint REMOVE coll a,b -# Query {"ns":"test.coll","op":"remove","query":{"a":{"\$gte":2},"b":{"\$gte":2}}} - - -# Query 3: 0.00 QPS, ID ffd83008fd6affc7c07053f583dea3e0 -# Ratio 0.00 \(docs scanned/returned\) -# Time range: .* to .* -# Attribute pct total min max avg 95% stddev median -# ================== === ======== ======== ======== ======== ======== ======= ======== -# Count \(docs\) 1\s -# Exec Time ms (\s*[0-9]+){8}\s -# Docs Scanned (\s*[0-9\.]+){8}\s -# Docs Returned (\s*[0-9\.]+){8}\s -# Bytes recv (\s*[0-9\.K]+){8}\s -# String: -# Namespaces test.system.js -# Operation query -# Fingerprint FIND system.js find -# Query {"ns":"test.system.js","op":"query","query":{"find":"system.js"}} - - -# Query 4: 0.00 QPS, ID 27cb39e62745b1ff4121b4bf6f21fb12 -# Ratio 0.00 \(docs scanned/returned\) -# Time range: .* to .* -# Attribute pct total min max avg 95% stddev median -# ================== === ======== ======== ======== ======== ======== ======= ======== -# Count \(docs\) 1\s -# Exec Time ms (\s*[0-9]+){8}\s -# Docs Scanned (\s*[0-9\.]+){8}\s -# Docs Returned (\s*[0-9\.]+){8}\s -# Bytes recv (\s*[0-9\.K]+){8}\s -# String: -# Namespaces test.coll -# Operation update -# Fingerprint UPDATE coll a -# Query {"ns":"test.coll","op":"update","query":{"a":{"\$gte":2}},"updateobj":{"\$set":{"c":1},"\$inc":{"a":-10}}} +# Namespace {{.Namespace}} +# Operation {{.Operation}} +# Fingerprint {{.Fingerprint}} +# Query {{.Query}} ` + tpl, _ := template.New("query").Parse(queryTpl) + for _, query := range queries { + buf := bytes.Buffer{} + err := tpl.Execute(&buf, query) + if err != nil { + t.Error(err) + } + + expected += buf.String() + } + assertRegexpLines(t, expected, string(output)) } From 1f9ec1bc123756e164009422ab0eb8e86f747790 Mon Sep 17 00:00:00 2001 From: Kamil Dziedzic Date: Sat, 14 Oct 2017 18:35:55 +0200 Subject: [PATCH 086/104] fixes --- src/go/pt-mongodb-query-digest/main_test.go | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/go/pt-mongodb-query-digest/main_test.go b/src/go/pt-mongodb-query-digest/main_test.go index b77cc0af..749500d5 100644 --- a/src/go/pt-mongodb-query-digest/main_test.go +++ b/src/go/pt-mongodb-query-digest/main_test.go @@ -2,6 +2,7 @@ package main import ( "bufio" + "bytes" "context" "fmt" "io/ioutil" @@ -13,10 +14,8 @@ import ( "runtime" "strings" "testing" - "time" - - "bytes" "text/template" + "time" "github.com/pborman/getopt/v2" "github.com/percona/percona-toolkit/src/go/lib/profiling" @@ -192,10 +191,7 @@ func TestPTMongoDBQueryDigest(t *testing.T) { if err != nil { t.Error(err) } - err = profiling.Drop(data.url) - if err != nil { - t.Error(err) - } + profiling.Drop(data.url) err = profiling.Enable(data.url) if err != nil { t.Error(err) @@ -249,7 +245,7 @@ Skipping profiled queries on these collections: \[system\.profile\] # Exec Time ms 0 NaN NaN NaN NaN NaN NaN NaN\s # Docs Scanned 0 NaN NaN NaN NaN NaN NaN NaN\s # Docs Returned 0 NaN NaN NaN NaN NaN NaN NaN\s -# Bytes recv 0 NaN NaN NaN NaN NaN NaN NaN\s +# Bytes sent 0 NaN NaN NaN NaN NaN NaN NaN\s #\s ` @@ -413,7 +409,7 @@ Skipping profiled queries on these collections: \[system\.profile\] } queryTpl := ` -# Query [0-9]+: 0.00 QPS, ID {{.ID}} +# Query [0-9]+: [0-9\.]+ QPS, ID {{.ID}} # Ratio [0-9\.]+ \(docs scanned/returned\) # Time range: .* to .* # Attribute pct total min max avg 95% stddev median From c2fd98d35b4042d03badf4a6b052858be8436bb3 Mon Sep 17 00:00:00 2001 From: Kamil Dziedzic Date: Sat, 14 Oct 2017 18:39:00 +0200 Subject: [PATCH 087/104] one line too much --- src/go/pt-mongodb-query-digest/main_test.go | 1 - 1 file changed, 1 deletion(-) diff --git a/src/go/pt-mongodb-query-digest/main_test.go b/src/go/pt-mongodb-query-digest/main_test.go index 749500d5..bc960b5a 100644 --- a/src/go/pt-mongodb-query-digest/main_test.go +++ b/src/go/pt-mongodb-query-digest/main_test.go @@ -247,7 +247,6 @@ Skipping profiled queries on these collections: \[system\.profile\] # Docs Returned 0 NaN NaN NaN NaN NaN NaN NaN\s # Bytes sent 0 NaN NaN NaN NaN NaN NaN NaN\s #\s - ` assertRegexpLines(t, expected, string(output)) From c67354443cc19e92f4bea25265147c648c4850b6 Mon Sep 17 00:00:00 2001 From: Kamil Dziedzic Date: Sat, 14 Oct 2017 18:44:46 +0200 Subject: [PATCH 088/104] restore TimeoutChan --- src/go/mongolib/profiler/profiler.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/go/mongolib/profiler/profiler.go b/src/go/mongolib/profiler/profiler.go index 320aeb99..be03d4cb 100644 --- a/src/go/mongolib/profiler/profiler.go +++ b/src/go/mongolib/profiler/profiler.go @@ -18,6 +18,7 @@ var ( type Profiler interface { GetLastError() error QueriesChan() chan stats.Queries + TimeoutsChan() <-chan time.Time FlushQueries() Start() Stop() @@ -93,6 +94,15 @@ func (p *Profile) Stop() { } } +func (p *Profile) TimeoutsChan() <-chan time.Time { + p.lock.Lock() + defer p.lock.Unlock() + if p.timeoutsChan == nil { + p.timeoutsChan = make(chan time.Time) + } + return p.timeoutsChan +} + func (p *Profile) getData() { go p.getDocs() p.stopWaitGroup.Add(1) From 32827eb4b5527c49d1b434e6477b70024a809854 Mon Sep 17 00:00:00 2001 From: Kamil Dziedzic Date: Sat, 14 Oct 2017 18:48:17 +0200 Subject: [PATCH 089/104] remove non-releated comment --- src/go/mongolib/fingerprinter/fingerprinter.go | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/src/go/mongolib/fingerprinter/fingerprinter.go b/src/go/mongolib/fingerprinter/fingerprinter.go index 7369e5fc..a5fa9b2a 100644 --- a/src/go/mongolib/fingerprinter/fingerprinter.go +++ b/src/go/mongolib/fingerprinter/fingerprinter.go @@ -31,20 +31,6 @@ func NewFingerprinter(keyFilters []string) *Fingerprint { } } -// Query is the top level map query element -// Example for MongoDB 3.2+ -// "query" : { -// "find" : "col1", -// "filter" : { -// "s2" : { -// "$lt" : "54701", -// "$gte" : "73754" -// } -// }, -// "sort" : { -// "user_id" : 1 -// } -// } func (f *Fingerprint) Fingerprint(doc proto.SystemProfile) (string, error) { realQuery, err := util.GetQueryField(doc) if err != nil { From 981faf53adc65c5a2123741f83e277305ef83d5c Mon Sep 17 00:00:00 2001 From: Kamil Dziedzic Date: Sat, 14 Oct 2017 20:10:21 +0200 Subject: [PATCH 090/104] fix operation and namespace for older MongoDB versions --- .../mongolib/fingerprinter/fingerprinter.go | 65 +- .../fingerprinter/fingerprinter_test.go | 8 +- src/go/mongolib/profiler/profiler_test.go | 16 +- src/go/mongolib/stats/fingerprinter.go | 10 + src/go/mongolib/stats/stats.go | 19 +- src/go/mongolib/stats/stats_test.go | 4 +- src/go/pt-mongodb-query-digest/main_test.go | 116 +- src/go/tests/expect/stats_all/sum.json | 997 +++++++----------- .../expect/stats_single/aggregate_2.6.12 | 6 +- .../expect/stats_single/aggregate_3.0.15 | 6 +- .../expect/stats_single/aggregate_3.2.16 | 4 +- .../tests/expect/stats_single/aggregate_3.4.7 | 4 +- .../expect/stats_single/aggregate_3.5.11 | 4 +- src/go/tests/expect/stats_single/count_2.6.12 | 6 +- src/go/tests/expect/stats_single/count_3.0.15 | 6 +- src/go/tests/expect/stats_single/count_3.2.16 | 4 +- src/go/tests/expect/stats_single/count_3.4.7 | 4 +- src/go/tests/expect/stats_single/count_3.5.11 | 4 +- .../stats_single/count_with_query_2.6.12 | 6 +- .../stats_single/count_with_query_3.0.15 | 6 +- .../stats_single/count_with_query_3.2.16 | 4 +- .../stats_single/count_with_query_3.4.7 | 4 +- .../stats_single/count_with_query_3.5.11 | 4 +- .../tests/expect/stats_single/delete_2.6.12 | 4 +- .../tests/expect/stats_single/delete_3.0.15 | 4 +- .../tests/expect/stats_single/delete_3.2.16 | 4 +- src/go/tests/expect/stats_single/delete_3.4.7 | 4 +- .../tests/expect/stats_single/delete_3.5.11 | 4 +- .../expect/stats_single/delete_all_2.6.12 | 4 +- .../expect/stats_single/delete_all_3.0.15 | 4 +- .../expect/stats_single/delete_all_3.2.16 | 4 +- .../expect/stats_single/delete_all_3.4.7 | 4 +- .../expect/stats_single/delete_all_3.5.11 | 4 +- .../tests/expect/stats_single/distinct_2.6.12 | 6 +- .../tests/expect/stats_single/distinct_3.0.15 | 6 +- .../tests/expect/stats_single/distinct_3.2.16 | 4 +- .../tests/expect/stats_single/distinct_3.4.7 | 4 +- .../tests/expect/stats_single/distinct_3.5.11 | 4 +- src/go/tests/expect/stats_single/eval_2.6.12 | 6 +- src/go/tests/expect/stats_single/eval_3.0.15 | 6 +- src/go/tests/expect/stats_single/eval_3.2.16 | 4 +- src/go/tests/expect/stats_single/eval_3.4.7 | 4 +- src/go/tests/expect/stats_single/eval_3.5.11 | 4 +- .../tests/expect/stats_single/explain_2.6.12 | 6 +- .../tests/expect/stats_single/explain_3.0.15 | 6 +- .../tests/expect/stats_single/explain_3.2.16 | 6 +- .../tests/expect/stats_single/explain_3.4.7 | 6 +- .../tests/expect/stats_single/explain_3.5.11 | 6 +- src/go/tests/expect/stats_single/find_2.6.12 | 4 +- src/go/tests/expect/stats_single/find_3.0.15 | 4 +- src/go/tests/expect/stats_single/find_3.2.16 | 4 +- src/go/tests/expect/stats_single/find_3.4.7 | 4 +- src/go/tests/expect/stats_single/find_3.5.11 | 4 +- .../expect/stats_single/find_andrii_2.6.12 | 4 +- .../expect/stats_single/find_andrii_3.0.15 | 4 +- .../expect/stats_single/find_andrii_3.2.16 | 4 +- .../expect/stats_single/find_andrii_3.4.7 | 4 +- .../expect/stats_single/find_andrii_3.5.11 | 4 +- .../expect/stats_single/find_empty_2.6.12 | 4 +- .../expect/stats_single/find_empty_3.0.15 | 4 +- .../expect/stats_single/find_empty_3.2.16 | 4 +- .../expect/stats_single/find_empty_3.4.7 | 4 +- .../expect/stats_single/find_empty_3.5.11 | 4 +- .../expect/stats_single/findandmodify_2.6.12 | 6 +- .../expect/stats_single/findandmodify_3.0.15 | 6 +- .../expect/stats_single/findandmodify_3.2.16 | 4 +- .../expect/stats_single/findandmodify_3.4.7 | 4 +- .../expect/stats_single/findandmodify_3.5.11 | 4 +- .../tests/expect/stats_single/geonear_2.6.12 | 6 +- .../tests/expect/stats_single/geonear_3.0.15 | 6 +- .../tests/expect/stats_single/geonear_3.2.16 | 4 +- .../tests/expect/stats_single/geonear_3.4.7 | 4 +- .../tests/expect/stats_single/geonear_3.5.11 | 4 +- src/go/tests/expect/stats_single/group_2.6.12 | 6 +- src/go/tests/expect/stats_single/group_3.0.15 | 6 +- src/go/tests/expect/stats_single/group_3.2.16 | 4 +- src/go/tests/expect/stats_single/group_3.4.7 | 4 +- src/go/tests/expect/stats_single/group_3.5.11 | 4 +- .../tests/expect/stats_single/insert_2.6.12 | 4 +- .../tests/expect/stats_single/insert_3.0.15 | 4 +- .../tests/expect/stats_single/insert_3.2.16 | 4 +- src/go/tests/expect/stats_single/insert_3.4.7 | 4 +- .../tests/expect/stats_single/insert_3.5.11 | 4 +- .../expect/stats_single/mapreduce_2.6.12 | 6 +- .../expect/stats_single/mapreduce_3.0.15 | 6 +- .../expect/stats_single/mapreduce_3.2.16 | 4 +- .../tests/expect/stats_single/mapreduce_3.4.7 | 4 +- .../expect/stats_single/mapreduce_3.5.11 | 4 +- .../tests/expect/stats_single/update_2.6.12 | 4 +- .../tests/expect/stats_single/update_3.0.15 | 4 +- .../tests/expect/stats_single/update_3.2.16 | 4 +- src/go/tests/expect/stats_single/update_3.4.7 | 4 +- .../tests/expect/stats_single/update_3.5.11 | 4 +- src/go/tests/profiler_docs_stats.want.json | 12 +- 94 files changed, 716 insertions(+), 917 deletions(-) create mode 100644 src/go/mongolib/stats/fingerprinter.go diff --git a/src/go/mongolib/fingerprinter/fingerprinter.go b/src/go/mongolib/fingerprinter/fingerprinter.go index a5fa9b2a..34f62105 100644 --- a/src/go/mongolib/fingerprinter/fingerprinter.go +++ b/src/go/mongolib/fingerprinter/fingerprinter.go @@ -17,29 +17,34 @@ var ( DEFAULT_KEY_FILTERS = []string{"^shardVersion$"} ) -type Fingerprinter interface { - Fingerprint(doc proto.SystemProfile) (string, error) +type Fingerprint struct { + Namespace string + Operation string + Collection string + Database string + Keys string + Fingerprint string } -type Fingerprint struct { +type Fingerprinter struct { keyFilters []string } -func NewFingerprinter(keyFilters []string) *Fingerprint { - return &Fingerprint{ +func NewFingerprinter(keyFilters []string) *Fingerprinter { + return &Fingerprinter{ keyFilters: keyFilters, } } -func (f *Fingerprint) Fingerprint(doc proto.SystemProfile) (string, error) { +func (f *Fingerprinter) Fingerprint(doc proto.SystemProfile) (Fingerprint, error) { realQuery, err := util.GetQueryField(doc) if err != nil { // Try to encode doc.Query as json for prettiness if buf, err := json.Marshal(realQuery); err == nil { - return "", fmt.Errorf("%v for query %s", err, string(buf)) + return Fingerprint{}, fmt.Errorf("%v for query %s", err, string(buf)) } // If we cannot encode as json, return just the error message without the query - return "", err + return Fingerprint{}, err } retKeys := keys(realQuery, f.keyFilters) @@ -61,22 +66,22 @@ func (f *Fingerprint) Fingerprint(doc proto.SystemProfile) (string, error) { } } - // Extract collection name and operation + // Extract operation, collection, database and namespace op := "" collection := "" + database := "" + ns := strings.SplitN(doc.Ns, ".", 2) + if len(ns) > 0 { + database = ns[0] + } + if len(ns) == 2 { + collection = ns[1] + } switch doc.Op { case "remove", "update": op = doc.Op - ns := strings.SplitN(doc.Ns, ".", 2) - if len(ns) == 2 { - collection = ns[1] - } case "insert": op = doc.Op - ns := strings.SplitN(doc.Ns, ".", 2) - if len(ns) == 2 { - collection = ns[1] - } retKeys = []string{} case "query": // EXPLAIN MongoDB 2.6: @@ -88,13 +93,11 @@ func (f *Fingerprint) Fingerprint(doc proto.SystemProfile) (string, error) { // }, if _, ok := doc.Query.Map()["$explain"]; ok { op = "explain" + database = "" + collection = "" break } op = "find" - ns := strings.SplitN(doc.Ns, ".", 2) - if len(ns) == 2 { - collection = ns[1] - } default: if query.Len() == 0 { break @@ -138,6 +141,8 @@ func (f *Fingerprint) Fingerprint(doc proto.SystemProfile) (string, error) { case "geoNear": retKeys = []string{} case "explain": + database = "" + collection = "" retKeys = []string{} case "$eval": op = "eval" @@ -162,7 +167,23 @@ func (f *Fingerprint) Fingerprint(doc proto.SystemProfile) (string, error) { parts = append(parts, keys) } - return strings.Join(parts, " "), nil + ns = []string{} + if database != "" { + ns = append(ns, database) + } + if collection != "" { + ns = append(ns, collection) + } + fp := Fingerprint{ + Operation: op, + Namespace: strings.Join(ns, "."), + Database: database, + Collection: collection, + Keys: keys, + Fingerprint: strings.Join(parts, " "), + } + + return fp, nil } func keys(query interface{}, keyFilters []string) []string { diff --git a/src/go/mongolib/fingerprinter/fingerprinter_test.go b/src/go/mongolib/fingerprinter/fingerprinter_test.go index 8225452d..9d9fb71f 100644 --- a/src/go/mongolib/fingerprinter/fingerprinter_test.go +++ b/src/go/mongolib/fingerprinter/fingerprinter_test.go @@ -44,7 +44,7 @@ func ExampleFingerprint() { if err != nil { panic(err) } - fmt.Println(got) + fmt.Println(got.Fingerprint) // Output: FIND sbtest3 c,k,pad } @@ -68,7 +68,7 @@ func TestFingerprint(t *testing.T) { t.Error("Error in fingerprint") } - if got != want { + if got.Fingerprint != want { t.Errorf("Invalid fingerprint. Got: %q, want %q", got, want) } } @@ -183,8 +183,8 @@ func TestFingerprints(t *testing.T) { t.Errorf("cannot create fingerprint: %s", err) } expect := expects[file.Name()] - if !reflect.DeepEqual(got, expect) { - t.Errorf("fp.Fingerprint(doc) = %s, want %s", got, expect) + if !reflect.DeepEqual(got.Fingerprint, expect) { + t.Errorf("fp.Fingerprint(doc) = %s, want %s", got.Fingerprint, expect) } }) } diff --git a/src/go/mongolib/profiler/profiler_test.go b/src/go/mongolib/profiler/profiler_test.go index ce971d24..670a9e5c 100644 --- a/src/go/mongolib/profiler/profiler_test.go +++ b/src/go/mongolib/profiler/profiler_test.go @@ -70,9 +70,9 @@ func TestRegularIterator(t *testing.T) { lastSeen, _ := time.Parse(time.RFC3339Nano, "2017-04-01T23:01:20.214+00:00") want := stats.Queries{ { - ID: "16196765fb4c14edb91efdbe4f5c5973", + ID: "95575e896c2830043dc333cb8ee61339", Namespace: "samples.col1", - Operation: "query", + Operation: "FIND", Query: "{\"ns\":\"samples.col1\",\"op\":\"query\",\"query\":{\"find\":\"col1\",\"shardVersion\":[0,\"000000000000000000000000\"]}}\n", Fingerprint: "FIND col1 find", FirstSeen: firstSeen, @@ -128,9 +128,9 @@ func TestIteratorTimeout(t *testing.T) { lastSeen, _ := time.Parse(time.RFC3339Nano, "2017-04-01T23:01:19.914+00:00") want := stats.Queries{ { - ID: "16196765fb4c14edb91efdbe4f5c5973", + ID: "95575e896c2830043dc333cb8ee61339", Namespace: "samples.col1", - Operation: "query", + Operation: "FIND", Query: "{\"ns\":\"samples.col1\",\"op\":\"query\",\"query\":{\"find\":\"col1\",\"shardVersion\":[0,\"000000000000000000000000\"]}}\n", Fingerprint: "FIND col1 find", FirstSeen: firstSeen, @@ -208,9 +208,9 @@ func TestTailIterator(t *testing.T) { want := stats.Queries{ { - ID: "16196765fb4c14edb91efdbe4f5c5973", + ID: "95575e896c2830043dc333cb8ee61339", Namespace: "samples.col1", - Operation: "query", + Operation: "FIND", Query: "{\"ns\":\"samples.col1\",\"op\":\"query\",\"query\":{\"find\":\"col1\",\"shardVersion\":[0,\"000000000000000000000000\"]}}\n", Fingerprint: "FIND col1 find", FirstSeen: parseDate("2017-04-01T23:01:20.214+00:00"), @@ -223,9 +223,9 @@ func TestTailIterator(t *testing.T) { ResponseLength: []float64{1.06123e+06}, }, { - ID: "16196765fb4c14edb91efdbe4f5c5973", + ID: "95575e896c2830043dc333cb8ee61339", Namespace: "samples.col1", - Operation: "query", + Operation: "FIND", Query: "{\"ns\":\"samples.col1\",\"op\":\"query\",\"query\":{\"find\":\"col1\",\"shardVersion\":[0,\"000000000000000000000000\"]}}\n", Fingerprint: "FIND col1 find", FirstSeen: parseDate("2017-04-01T23:01:19.914+00:00"), diff --git a/src/go/mongolib/stats/fingerprinter.go b/src/go/mongolib/stats/fingerprinter.go new file mode 100644 index 00000000..a47dd69f --- /dev/null +++ b/src/go/mongolib/stats/fingerprinter.go @@ -0,0 +1,10 @@ +package stats + +import ( + "github.com/percona/percona-toolkit/src/go/mongolib/fingerprinter" + "github.com/percona/percona-toolkit/src/go/mongolib/proto" +) + +type Fingerprinter interface { + Fingerprint(doc proto.SystemProfile) (fingerprinter.Fingerprint, error) +} diff --git a/src/go/mongolib/stats/stats.go b/src/go/mongolib/stats/stats.go index 0e4864b4..74a51911 100644 --- a/src/go/mongolib/stats/stats.go +++ b/src/go/mongolib/stats/stats.go @@ -8,7 +8,6 @@ import ( "time" "github.com/montanaflynn/stats" - "github.com/percona/percona-toolkit/src/go/mongolib/fingerprinter" "github.com/percona/percona-toolkit/src/go/mongolib/proto" "gopkg.in/mgo.v2/bson" ) @@ -31,8 +30,8 @@ func (e *StatsError) Parent() error { type StatsFingerprintError StatsError -// New creates new instance of stats with given fingerprinter -func New(fingerprinter fingerprinter.Fingerprinter) *Stats { +// New creates new instance of stats with given Fingerprinter +func New(fingerprinter Fingerprinter) *Stats { s := &Stats{ fingerprinter: fingerprinter, } @@ -44,7 +43,7 @@ func New(fingerprinter fingerprinter.Fingerprinter) *Stats { // Stats is a collection of MongoDB statistics type Stats struct { // dependencies - fingerprinter fingerprinter.Fingerprinter + fingerprinter Fingerprinter // internal queryInfoAndCounters map[GroupKey]*QueryInfoAndCounters @@ -69,9 +68,9 @@ func (s *Stats) Add(doc proto.SystemProfile) error { var ok bool key := GroupKey{ - Operation: doc.Op, - Fingerprint: fp, - Namespace: doc.Ns, + Operation: fp.Operation, + Fingerprint: fp.Fingerprint, + Namespace: fp.Namespace, } if qiac, ok = s.getQueryInfoAndCounters(key); !ok { query := proto.NewExampleQuery(doc) @@ -81,9 +80,9 @@ func (s *Stats) Add(doc proto.SystemProfile) error { } qiac = &QueryInfoAndCounters{ ID: fmt.Sprintf("%x", md5.Sum([]byte(fmt.Sprintf("%s", key)))), - Operation: doc.Op, - Fingerprint: fp, - Namespace: doc.Ns, + Operation: fp.Operation, + Fingerprint: fp.Fingerprint, + Namespace: fp.Namespace, TableScan: false, Query: string(queryBson), } diff --git a/src/go/mongolib/stats/stats_test.go b/src/go/mongolib/stats/stats_test.go index 501322d1..98af2347 100644 --- a/src/go/mongolib/stats/stats_test.go +++ b/src/go/mongolib/stats/stats_test.go @@ -145,9 +145,9 @@ func TestStats(t *testing.T) { t.Errorf("Error processing doc: %s\n", err.Error()) } statsVal := QueryInfoAndCounters{ - ID: "4e4774ad26f934a193757002a991ebb8", + ID: "d7088d6b50551d1f2f5f34b006c0140d", Namespace: "samples.col1", - Operation: "query", + Operation: "FIND", Query: "{\"ns\":\"samples.col1\",\"op\":\"query\",\"query\":{\"find\":\"col1\",\"filter\":{\"s2\":{\"$gte\":\"41991\",\"$lt\":\"33754\"}},\"shardVersion\":[0,\"000000000000000000000000\"]}}\n", Fingerprint: "FIND col1 s2", FirstSeen: parseDate("2017-04-10T13:15:53.532-03:00"), diff --git a/src/go/pt-mongodb-query-digest/main_test.go b/src/go/pt-mongodb-query-digest/main_test.go index bc960b5a..bc186b44 100644 --- a/src/go/pt-mongodb-query-digest/main_test.go +++ b/src/go/pt-mongodb-query-digest/main_test.go @@ -301,107 +301,107 @@ Skipping profiled queries on these collections: \[system\.profile\] queries := []stats.QueryStats{ { - ID: "a7ce8dee16beadb767484112e6b29af3", + ID: "e357abe482dcc0cd03ab742741bf1c86", Namespace: "test.coll", - Operation: "insert", + Operation: "INSERT", Fingerprint: "INSERT coll", Query: `{"ns":"test.coll","op":"insert","query":{"insert":"coll","documents":\[{"_id":{"\$oid":".*"},"a":9}\],"ordered":true}}`, }, { - ID: "7e6e9af8a1754a065b323acdddbee4b5", + ID: "c9b40ce564762834d12b0390a292645c", Namespace: "test.coll", - Operation: "command", + Operation: "DROP", Fingerprint: "DROP coll drop", Query: `{"ns":"test.coll","op":"command","command":{"drop":"coll"}}`, }, { - ID: "bab52c8aa977c96ecd148c015ae07c42", + ID: "e72ad41302045bd6c2bcad76511f915a", Namespace: "test.coll", - Operation: "remove", + Operation: "REMOVE", Fingerprint: "REMOVE coll a,b", Query: regexp.QuoteMeta(`{"ns":"test.coll","op":"remove","query":{"a":{"$gte":2},"b":{"$gte":2}}}`), }, { - ID: "11e1b6f695d43b1b5a2f7e6de2ad8305", + ID: "30dbfbc89efd8cfd40774dff0266a28f", Namespace: "test.coll", - Operation: "command", + Operation: "AGGREGATE", Fingerprint: "AGGREGATE coll a", Query: regexp.QuoteMeta(`{"ns":"test.coll","op":"command","command":{"aggregate":"coll","pipeline":[{"$match":{"a":{"$gte":2}}}],"cursor":{}}}`), }, { - ID: "a4be6ed97c946182af7e30cf818afdac", + ID: "e4122a58c99ab0a4020ce7d195c5a8cb", Namespace: "test.coll", - Operation: "command", + Operation: "DISTINCT", Fingerprint: "DISTINCT coll a,b", Query: regexp.QuoteMeta(`{"ns":"test.coll","op":"command","command":{"distinct":"coll","key":"a","query":{"b":{"$gte":5}}}}`), }, { - ID: "e2f53c6824c5cbe454e33e128b350d1e", - Namespace: "test.coll", - Operation: "command", - Fingerprint: "EXPLAIN", - Query: `{"ns":"test.coll","op":"command","command":{"explain":{"find":"coll","filter":{}},"verbosity":"queryPlanner"}}`, - }, - { - ID: "9423eaa90c222686d092c04f001fb369", - Namespace: "test.coll", - Operation: "command", - Fingerprint: "FINDANDMODIFY coll a", - Query: regexp.QuoteMeta(`{"ns":"test.coll","op":"command","command":{"findandmodify":"coll","query":{"a":2},"update":{"$inc":{"b":1}}},"updateobj":{"$inc":{"b":1}}}`), - }, - { - ID: "dd20c739baef5a3fd9352c350c7e69f1", - Namespace: "test.coll", - Operation: "command", - Fingerprint: "GEONEAR coll", - Query: regexp.QuoteMeta(`{"ns":"test.coll","op":"command","command":{"geoNear":"coll","near":{"type":"Point","coordinates":[1,1]},"spherical":true}}`), - }, - { - ID: "018a055f724d418b80e66b98bfdb25a5", - Namespace: "test.coll", - Operation: "command", - Fingerprint: "GROUP coll a,b", - Query: regexp.QuoteMeta(`{"ns":"test.coll","op":"command","command":{"group":{"key":{"a":1,"b":1},"cond":{"b":3},"initial":{},"ns":"coll","$reduce":{"Code":"function () {}","Scope":null}}}}`), - }, - { - ID: "130827f5b7afe1369f619ccd5cd61ec4", - Namespace: "test.coll", - Operation: "command", - Fingerprint: "MAPREDUCE coll a", - Query: regexp.QuoteMeta(`{"ns":"test.coll","op":"command","command":{"mapreduce":"coll","map":{"Code":"function () {\n emit(this.a, this.b);\n}","Scope":null},"reduce":{"Code":"function (a, b) {\n return Array.sum(b);\n}","Scope":null},"query":{"a":{"$gte":0}},"out":{"inline":1}}}`), - }, - { - ID: "71b3d6aa44d34aaa02cd65bad3e25f49", + ID: "a6782ae38ef891d5506341a4b0ab2747", Namespace: "test", - Operation: "command", + Operation: "EVAL", Fingerprint: "EVAL", Query: regexp.QuoteMeta(`{"ns":"test","op":"command","command":{"$eval":"db"}}`), }, { - ID: "2300d7f2d372205544f249b010e9b8ad", - Namespace: "test.coll", - Operation: "command", - Fingerprint: "COUNT coll a", - Query: regexp.QuoteMeta(`{"ns":"test.coll","op":"command","command":{"count":"coll","query":{"a":{"$gt":5}},"fields":{}}}`), + ID: "76d7662df07b44135ac3e07e44a6eb39", + Namespace: "", + Operation: "EXPLAIN", + Fingerprint: "EXPLAIN", + Query: `{"ns":"test.coll","op":"command","command":{"explain":{"find":"coll","filter":{}},"verbosity":"queryPlanner"}}`, }, { - ID: "ffd83008fd6affc7c07053f583dea3e0", + ID: "e8a3f05a4bd3f0bfa7d38eb2372258b1", + Namespace: "test.coll", + Operation: "FINDANDMODIFY", + Fingerprint: "FINDANDMODIFY coll a", + Query: regexp.QuoteMeta(`{"ns":"test.coll","op":"command","command":{"findandmodify":"coll","query":{"a":2},"update":{"$inc":{"b":1}}},"updateobj":{"$inc":{"b":1}}}`), + }, + { + ID: "67c5f1bafcb8cd4b3af9f008f496f74b", Namespace: "test.system.js", - Operation: "query", + Operation: "FIND", Fingerprint: "FIND system.js find", Query: `{"ns":"test.system.js","op":"query","query":{"find":"system.js"}}`, }, { - ID: "29701e3d37e0adb35ebd70b7ef2b3f3d", + ID: "c70403cbd55ffbb07f08c0cb77a24b19", Namespace: "test.coll", - Operation: "command", + Operation: "GEONEAR", + Fingerprint: "GEONEAR coll", + Query: regexp.QuoteMeta(`{"ns":"test.coll","op":"command","command":{"geoNear":"coll","near":{"type":"Point","coordinates":[1,1]},"spherical":true}}`), + }, + { + ID: "ca8bb19386488570447f5753741fb494", + Namespace: "test.coll", + Operation: "GROUP", + Fingerprint: "GROUP coll a,b", + Query: regexp.QuoteMeta(`{"ns":"test.coll","op":"command","command":{"group":{"key":{"a":1,"b":1},"cond":{"b":3},"initial":{},"ns":"coll","$reduce":{"Code":"function () {}","Scope":null}}}}`), + }, + { + ID: "10b8f47b366fbfd1fb01f8d17d75b1a2", + Namespace: "test.coll", + Operation: "COUNT", + Fingerprint: "COUNT coll a", + Query: regexp.QuoteMeta(`{"ns":"test.coll","op":"command","command":{"count":"coll","query":{"a":{"$gt":5}},"fields":{}}}`), + }, + { + ID: "cc3cb3824eea4094eb042f5ca76bd385", + Namespace: "test.coll", + Operation: "MAPREDUCE", + Fingerprint: "MAPREDUCE coll a", + Query: regexp.QuoteMeta(`{"ns":"test.coll","op":"command","command":{"mapreduce":"coll","map":{"Code":"function () {\n emit(this.a, this.b);\n}","Scope":null},"reduce":{"Code":"function (a, b) {\n return Array.sum(b);\n}","Scope":null},"query":{"a":{"$gte":0}},"out":{"inline":1}}}`), + }, + { + ID: "cba2dff0740762c6e5769f0e300df676", + Namespace: "test.coll", + Operation: "COUNT", Fingerprint: "COUNT coll", Query: `{"ns":"test.coll","op":"command","command":{"count":"coll","query":{},"fields":{}}}`, }, { - ID: "27cb39e62745b1ff4121b4bf6f21fb12", + ID: "f74a5120ac22d02120ccbf6d478b0dbc", Namespace: "test.coll", - Operation: "update", + Operation: "UPDATE", Fingerprint: "UPDATE coll a", Query: regexp.QuoteMeta(`{"ns":"test.coll","op":"update","query":{"a":{"$gte":2}},"updateobj":{"$set":{"c":1},"$inc":{"a":-10}}}`), }, diff --git a/src/go/tests/expect/stats_all/sum.json b/src/go/tests/expect/stats_all/sum.json index 7f868657..25e060f5 100755 --- a/src/go/tests/expect/stats_all/sum.json +++ b/src/go/tests/expect/stats_all/sum.json @@ -1,629 +1,54 @@ [ { - "ID": "59899eb380b4e48c345fb6f997d06bfa", - "Namespace": "test.$cmd", - "Operation": "command", + "ID": "30dbfbc89efd8cfd40774dff0266a28f", + "Namespace": "test.coll", + "Operation": "AGGREGATE", "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"aggregate\":\"coll\",\"pipeline\":[{\"$match\":{\"a\":{\"$gte\":2}}}],\"cursor\":{}}}\n", "Fingerprint": "AGGREGATE coll a", "FirstSeen": "2017-08-20T15:39:14.658Z", - "LastSeen": "2017-08-20T15:39:20.858Z", - "TableScan": false, - "Count": 2, - "BlockedTime": null, - "LockTime": null, - "NReturned": [ - 0, - 0 - ], - "NScanned": [ - 0, - 0 - ], - "QueryTime": [ - 0, - 2 - ], - "ResponseLength": [ - 385, - 385 - ] - }, - { - "ID": "020d9f1058f3bf08e3b1afb1ef883d44", - "Namespace": "test.$cmd", - "Operation": "command", - "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"count\":\"coll\",\"query\":{},\"fields\":{}}}\n", - "Fingerprint": "COUNT coll", - "FirstSeen": "2017-08-20T15:39:14.823Z", - "LastSeen": "2017-08-20T15:39:20.982Z", - "TableScan": false, - "Count": 2, - "BlockedTime": null, - "LockTime": null, - "NReturned": [ - 0, - 0 - ], - "NScanned": [ - 0, - 0 - ], - "QueryTime": [ - 0, - 0 - ], - "ResponseLength": [ - 48, - 44 - ] - }, - { - "ID": "5eee3fe927f2234d7655f4fcc7fead0a", - "Namespace": "test.$cmd", - "Operation": "command", - "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"count\":\"coll\",\"query\":{\"a\":{\"$gt\":5}},\"fields\":{}}}\n", - "Fingerprint": "COUNT coll a", - "FirstSeen": "2017-08-20T15:39:14.971Z", - "LastSeen": "2017-08-20T15:39:21.124Z", - "TableScan": false, - "Count": 2, - "BlockedTime": null, - "LockTime": null, - "NReturned": [ - 0, - 0 - ], - "NScanned": [ - 0, - 0 - ], - "QueryTime": [ - 0, - 0 - ], - "ResponseLength": [ - 48, - 44 - ] - }, - { - "ID": "24acf4277fabf2a382f266bb4e6e8e3e", - "Namespace": "test.$cmd", - "Operation": "command", - "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"distinct\":\"coll\",\"key\":\"a\",\"query\":{\"b\":{\"$gte\":5}}}}\n", - "Fingerprint": "DISTINCT coll a,b", - "FirstSeen": "2017-08-20T15:39:15.323Z", - "LastSeen": "2017-08-20T15:39:21.392Z", - "TableScan": false, - "Count": 2, - "BlockedTime": null, - "LockTime": null, - "NReturned": [ - 0, - 0 - ], - "NScanned": [ - 0, - 0 - ], - "QueryTime": [ - 0, - 0 - ], - "ResponseLength": [ - 254, - 261 - ] - }, - { - "ID": "3335908aa111fe5eedf75479d9b1eb72", - "Namespace": "test.$cmd", - "Operation": "command", - "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"$eval\":\"db\"}}\n", - "Fingerprint": "EVAL", - "FirstSeen": "2017-09-05T19:39:24.522Z", - "LastSeen": "2017-09-05T19:39:32.054Z", - "TableScan": false, - "Count": 2, - "BlockedTime": null, - "LockTime": null, - "NReturned": [ - 0, - 0 - ], - "NScanned": [ - 0, - 0 - ], - "QueryTime": [ - 65, - 35 - ], - "ResponseLength": [ - 108, - 108 - ] - }, - { - "ID": "ada85b4f1473b9a1fb37158a8481e20e", - "Namespace": "test.$cmd", - "Operation": "command", - "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"explain\":{\"find\":\"coll\",\"filter\":{},\"options\":{}},\"verbosity\":\"queryPlanner\"}}\n", - "Fingerprint": "EXPLAIN", - "FirstSeen": "2017-09-05T19:39:32.21Z", - "LastSeen": "2017-09-05T19:39:32.21Z", - "TableScan": false, - "Count": 1, - "BlockedTime": null, - "LockTime": null, - "NReturned": [ - 0 - ], - "NScanned": [ - 0 - ], - "QueryTime": [ - 0 - ], - "ResponseLength": [ - 379 - ] - }, - { - "ID": "3d52ee232b8c4e1068dd90741632614a", - "Namespace": "test.$cmd", - "Operation": "command", - "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"findandmodify\":\"coll\",\"query\":{\"a\":2},\"update\":{\"$inc\":{\"b\":1}}},\"updateobj\":{\"$inc\":{\"b\":1}}}\n", - "Fingerprint": "FINDANDMODIFY coll a", - "FirstSeen": "2017-08-20T15:39:15.903Z", - "LastSeen": "2017-08-20T15:39:21.902Z", - "TableScan": false, - "Count": 2, - "BlockedTime": null, - "LockTime": null, - "NReturned": [ - 0, - 0 - ], - "NScanned": [ - 1, - 1 - ], - "QueryTime": [ - 0, - 0 - ], - "ResponseLength": [ - 131, - 131 - ] - }, - { - "ID": "eb3d8174e05f442cc5c3269eb50667d6", - "Namespace": "test.$cmd", - "Operation": "command", - "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"geoNear\":\"coll\",\"near\":{\"type\":\"Point\",\"coordinates\":[1,1]},\"spherical\":true}}\n", - "Fingerprint": "GEONEAR coll", - "FirstSeen": "2017-08-20T15:39:16.061Z", - "LastSeen": "2017-08-20T15:39:22.055Z", - "TableScan": false, - "Count": 2, - "BlockedTime": null, - "LockTime": null, - "NReturned": [ - 0, - 0 - ], - "NScanned": [ - 0, - 0 - ], - "QueryTime": [ - 1, - 3 - ], - "ResponseLength": [ - 1406, - 1398 - ] - }, - { - "ID": "225e5819de843c1779f1118f2f01b77e", - "Namespace": "test.$cmd", - "Operation": "command", - "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"group\":{\"key\":{\"a\":1,\"b\":1},\"cond\":{\"b\":3},\"initial\":{},\"ns\":\"coll\",\"$reduce\":\"\"}}}\n", - "Fingerprint": "GROUP coll a,b", - "FirstSeen": "2017-08-20T15:39:16.325Z", - "LastSeen": "2017-08-20T15:39:22.271Z", - "TableScan": false, - "Count": 2, - "BlockedTime": null, - "LockTime": null, - "NReturned": [ - 0, - 0 - ], - "NScanned": [ - 0, - 0 - ], - "QueryTime": [ - 77, - 54 - ], - "ResponseLength": [ - 135, - 139 - ] - }, - { - "ID": "23ca094f285d0cd9538fb1b1f6ef0f4f", - "Namespace": "test.$cmd", - "Operation": "command", - "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"mapreduce\":\"coll\",\"map\":\"\",\"reduce\":\"\",\"query\":{\"a\":{\"$gte\":0}},\"out\":{\"inline\":1}}}\n", - "Fingerprint": "MAPREDUCE coll a", - "FirstSeen": "2017-08-20T15:39:16.701Z", - "LastSeen": "2017-08-20T15:39:22.582Z", - "TableScan": false, - "Count": 2, - "BlockedTime": null, - "LockTime": null, - "NReturned": [ - 0, - 0 - ], - "NScanned": [ - 0, - 0 - ], - "QueryTime": [ - 33, - 26 - ], - "ResponseLength": [ - 233, - 233 - ] - }, - { - "ID": "11e1b6f695d43b1b5a2f7e6de2ad8305", - "Namespace": "test.coll", - "Operation": "command", - "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"aggregate\":\"coll\",\"pipeline\":[{\"$match\":{\"a\":{\"$gte\":2}}}],\"cursor\":{}}}\n", - "Fingerprint": "AGGREGATE coll a", - "FirstSeen": "2017-08-20T15:39:29.915Z", "LastSeen": "2017-08-20T15:39:47.203Z", "TableScan": false, - "Count": 3, + "Count": 5, "BlockedTime": null, "LockTime": null, "NReturned": [ + 0, + 0, 0, 8, 8 ], "NScanned": [ + 0, + 0, 0, 8, 8 ], "QueryTime": [ + 0, + 2, 2, 0, 2 ], "ResponseLength": [ + 385, + 385, 388, 370, 370 ] }, { - "ID": "29701e3d37e0adb35ebd70b7ef2b3f3d", + "ID": "cba2dff0740762c6e5769f0e300df676", "Namespace": "test.coll", - "Operation": "command", - "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"count\":\"coll\",\"query\":{},\"fields\":{}}}\n", + "Operation": "COUNT", + "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"count\":\"coll\",\"query\":{},\"fields\":{}}}\n", "Fingerprint": "COUNT coll", - "FirstSeen": "2017-08-20T15:39:30.094Z", + "FirstSeen": "2017-08-20T15:39:14.823Z", "LastSeen": "2017-08-20T15:39:47.396Z", "TableScan": false, - "Count": 3, - "BlockedTime": null, - "LockTime": null, - "NReturned": [ - 0, - 0, - 0 - ], - "NScanned": [ - 0, - 0, - 0 - ], - "QueryTime": [ - 0, - 0, - 0 - ], - "ResponseLength": [ - 47, - 29, - 29 - ] - }, - { - "ID": "2300d7f2d372205544f249b010e9b8ad", - "Namespace": "test.coll", - "Operation": "command", - "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"count\":\"coll\",\"query\":{\"a\":{\"$gt\":5}},\"fields\":{}}}\n", - "Fingerprint": "COUNT coll a", - "FirstSeen": "2017-08-20T15:39:30.251Z", - "LastSeen": "2017-08-20T15:39:47.573Z", - "TableScan": false, - "Count": 3, - "BlockedTime": null, - "LockTime": null, - "NReturned": [ - 0, - 0, - 0 - ], - "NScanned": [ - 0, - 0, - 0 - ], - "QueryTime": [ - 0, - 0, - 0 - ], - "ResponseLength": [ - 47, - 29, - 29 - ] - }, - { - "ID": "a4be6ed97c946182af7e30cf818afdac", - "Namespace": "test.coll", - "Operation": "command", - "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"distinct\":\"coll\",\"key\":\"a\",\"query\":{\"b\":{\"$gte\":5}}}}\n", - "Fingerprint": "DISTINCT coll a,b", - "FirstSeen": "2017-08-20T15:39:30.748Z", - "LastSeen": "2017-08-20T15:39:47.927Z", - "TableScan": false, - "Count": 3, - "BlockedTime": null, - "LockTime": null, - "NReturned": [ - 0, - 0, - 0 - ], - "NScanned": [ - 0, - 10, - 10 - ], - "QueryTime": [ - 0, - 0, - 0 - ], - "ResponseLength": [ - 264, - 145, - 145 - ] - }, - { - "ID": "e2f53c6824c5cbe454e33e128b350d1e", - "Namespace": "test.coll", - "Operation": "command", - "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"explain\":{\"find\":\"coll\",\"filter\":{}},\"verbosity\":\"queryPlanner\"}}\n", - "Fingerprint": "EXPLAIN", - "FirstSeen": "2017-09-05T19:39:41.753Z", - "LastSeen": "2017-09-05T19:40:00.433Z", - "TableScan": false, - "Count": 3, - "BlockedTime": null, - "LockTime": null, - "NReturned": [ - 0, - 0, - 0 - ], - "NScanned": [ - 0, - 0, - 0 - ], - "QueryTime": [ - 0, - 0, - 0 - ], - "ResponseLength": [ - 364, - 328, - 329 - ] - }, - { - "ID": "9423eaa90c222686d092c04f001fb369", - "Namespace": "test.coll", - "Operation": "command", - "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"findandmodify\":\"coll\",\"query\":{\"a\":2},\"update\":{\"$inc\":{\"b\":1}}},\"updateobj\":{\"$inc\":{\"b\":1}}}\n", - "Fingerprint": "FINDANDMODIFY coll a", - "FirstSeen": "2017-08-20T15:39:31.548Z", - "LastSeen": "2017-08-20T15:39:48.636Z", - "TableScan": false, - "Count": 3, - "BlockedTime": null, - "LockTime": null, - "NReturned": [ - 0, - 0, - 0 - ], - "NScanned": [ - 3, - 3, - 3 - ], - "QueryTime": [ - 0, - 0, - 0 - ], - "ResponseLength": [ - 116, - 116, - 116 - ] - }, - { - "ID": "dd20c739baef5a3fd9352c350c7e69f1", - "Namespace": "test.coll", - "Operation": "command", - "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"geoNear\":\"coll\",\"near\":{\"type\":\"Point\",\"coordinates\":[1,1]},\"spherical\":true}}\n", - "Fingerprint": "GEONEAR coll", - "FirstSeen": "2017-08-20T15:39:31.797Z", - "LastSeen": "2017-08-20T15:39:48.842Z", - "TableScan": false, - "Count": 3, - "BlockedTime": null, - "LockTime": null, - "NReturned": [ - 0, - 0, - 0 - ], - "NScanned": [ - 0, - 10, - 10 - ], - "QueryTime": [ - 8, - 11, - 7 - ], - "ResponseLength": [ - 1401, - 1383, - 1383 - ] - }, - { - "ID": "018a055f724d418b80e66b98bfdb25a5", - "Namespace": "test.coll", - "Operation": "command", - "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"group\":{\"key\":{\"a\":1,\"b\":1},\"cond\":{\"b\":3},\"initial\":{},\"ns\":\"coll\",\"$reduce\":\"\"}}}\n", - "Fingerprint": "GROUP coll a,b", - "FirstSeen": "2017-08-20T15:39:32.101Z", - "LastSeen": "2017-08-20T15:39:49.276Z", - "TableScan": false, - "Count": 3, - "BlockedTime": null, - "LockTime": null, - "NReturned": [ - 0, - 0, - 0 - ], - "NScanned": [ - 0, - 2, - 2 - ], - "QueryTime": [ - 74, - 77, - 68 - ], - "ResponseLength": [ - 142, - 124, - 124 - ] - }, - { - "ID": "130827f5b7afe1369f619ccd5cd61ec4", - "Namespace": "test.coll", - "Operation": "command", - "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"mapreduce\":\"coll\",\"map\":\"\",\"reduce\":\"\",\"query\":{\"a\":{\"$gte\":0}},\"out\":{\"inline\":1}}}\n", - "Fingerprint": "MAPREDUCE coll a", - "FirstSeen": "2017-08-20T15:39:32.572Z", - "LastSeen": "2017-08-20T15:39:49.68Z", - "TableScan": false, - "Count": 3, - "BlockedTime": null, - "LockTime": null, - "NReturned": [ - 0, - 0, - 0 - ], - "NScanned": [ - 0, - 3, - 3 - ], - "QueryTime": [ - 31, - 43, - 35 - ], - "ResponseLength": [ - 218, - 218, - 218 - ] - }, - { - "ID": "71b3d6aa44d34aaa02cd65bad3e25f49", - "Namespace": "test", - "Operation": "command", - "Query": "{\"ns\":\"test\",\"op\":\"command\",\"command\":{\"$eval\":\"db\"}}\n", - "Fingerprint": "EVAL", - "FirstSeen": "2017-09-05T19:39:41.581Z", - "LastSeen": "2017-09-05T19:40:00.171Z", - "TableScan": false, - "Count": 3, - "BlockedTime": null, - "LockTime": null, - "NReturned": [ - 0, - 0, - 0 - ], - "NScanned": [ - 0, - 0, - 0 - ], - "QueryTime": [ - 88, - 91, - 47 - ], - "ResponseLength": [ - 93, - 93, - 93 - ] - }, - { - "ID": "a7ce8dee16beadb767484112e6b29af3", - "Namespace": "test.coll", - "Operation": "insert", - "Query": "{\"ns\":\"test.coll\",\"op\":\"insert\",\"query\":{\"_id\":1}}\n", - "Fingerprint": "INSERT coll", - "FirstSeen": "2017-08-20T15:39:16.473Z", - "LastSeen": "2017-08-20T15:39:49.44Z", - "TableScan": false, "Count": 5, "BlockedTime": null, "LockTime": null, @@ -649,42 +74,222 @@ 0 ], "ResponseLength": [ - 0, - 0, - 25, + 48, + 44, + 47, 29, 29 ] }, { - "ID": "4c06ec043313864d76669ddc2a1be353", + "ID": "10b8f47b366fbfd1fb01f8d17d75b1a2", "Namespace": "test.coll", - "Operation": "query", - "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"query\":{\"query\":{},\"$explain\":true}}\n", - "Fingerprint": "EXPLAIN", - "FirstSeen": "2017-09-05T19:39:24.666Z", - "LastSeen": "2017-09-05T19:39:24.666Z", + "Operation": "COUNT", + "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"count\":\"coll\",\"query\":{\"a\":{\"$gt\":5}},\"fields\":{}}}\n", + "Fingerprint": "COUNT coll a", + "FirstSeen": "2017-08-20T15:39:14.971Z", + "LastSeen": "2017-08-20T15:39:47.573Z", "TableScan": false, - "Count": 1, + "Count": 5, "BlockedTime": null, "LockTime": null, "NReturned": [ - 1 + 0, + 0, + 0, + 0, + 0 ], "NScanned": [ - 44 + 0, + 0, + 0, + 0, + 0 ], "QueryTime": [ + 0, + 0, + 0, + 0, 0 ], "ResponseLength": [ - 583 + 48, + 44, + 47, + 29, + 29 ] }, { - "ID": "b9a4b74ac8b3747f44951490e6279b96", + "ID": "e4122a58c99ab0a4020ce7d195c5a8cb", "Namespace": "test.coll", - "Operation": "query", + "Operation": "DISTINCT", + "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"distinct\":\"coll\",\"key\":\"a\",\"query\":{\"b\":{\"$gte\":5}}}}\n", + "Fingerprint": "DISTINCT coll a,b", + "FirstSeen": "2017-08-20T15:39:15.323Z", + "LastSeen": "2017-08-20T15:39:47.927Z", + "TableScan": false, + "Count": 5, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0, + 0, + 0, + 0, + 0 + ], + "NScanned": [ + 0, + 0, + 0, + 10, + 10 + ], + "QueryTime": [ + 0, + 0, + 0, + 0, + 0 + ], + "ResponseLength": [ + 254, + 261, + 264, + 145, + 145 + ] + }, + { + "ID": "a6782ae38ef891d5506341a4b0ab2747", + "Namespace": "test", + "Operation": "EVAL", + "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"$eval\":\"db\"}}\n", + "Fingerprint": "EVAL", + "FirstSeen": "2017-09-05T19:39:24.522Z", + "LastSeen": "2017-09-05T19:40:00.171Z", + "TableScan": false, + "Count": 5, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0, + 0, + 0, + 0, + 0 + ], + "NScanned": [ + 0, + 0, + 0, + 0, + 0 + ], + "QueryTime": [ + 65, + 35, + 88, + 91, + 47 + ], + "ResponseLength": [ + 108, + 108, + 93, + 93, + 93 + ] + }, + { + "ID": "76d7662df07b44135ac3e07e44a6eb39", + "Namespace": "", + "Operation": "EXPLAIN", + "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"query\":{\"query\":{},\"$explain\":true}}\n", + "Fingerprint": "EXPLAIN", + "FirstSeen": "2017-09-05T19:39:24.666Z", + "LastSeen": "2017-09-05T19:40:00.433Z", + "TableScan": false, + "Count": 5, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 1, + 0, + 0, + 0, + 0 + ], + "NScanned": [ + 44, + 0, + 0, + 0, + 0 + ], + "QueryTime": [ + 0, + 0, + 0, + 0, + 0 + ], + "ResponseLength": [ + 583, + 379, + 364, + 328, + 329 + ] + }, + { + "ID": "e8a3f05a4bd3f0bfa7d38eb2372258b1", + "Namespace": "test.coll", + "Operation": "FINDANDMODIFY", + "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"findandmodify\":\"coll\",\"query\":{\"a\":2},\"update\":{\"$inc\":{\"b\":1}}},\"updateobj\":{\"$inc\":{\"b\":1}}}\n", + "Fingerprint": "FINDANDMODIFY coll a", + "FirstSeen": "2017-08-20T15:39:15.903Z", + "LastSeen": "2017-08-20T15:39:48.636Z", + "TableScan": false, + "Count": 5, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0, + 0, + 0, + 0, + 0 + ], + "NScanned": [ + 1, + 1, + 3, + 3, + 3 + ], + "QueryTime": [ + 0, + 0, + 0, + 0, + 0 + ], + "ResponseLength": [ + 131, + 131, + 116, + 116, + 116 + ] + }, + { + "ID": "2a639e77efe3e68399ef9482575b3421", + "Namespace": "test.coll", + "Operation": "FIND", "Query": "{\"ns\":\"test.coll\",\"op\":\"query\"}\n", "Fingerprint": "FIND coll", "FirstSeen": "2017-08-20T15:39:15.75Z", @@ -723,9 +328,9 @@ ] }, { - "ID": "4e9241090af6f4a49545baf7c015fb5c", + "ID": "fe0bf975a044fe47fd32b835ceba612d", "Namespace": "test.coll", - "Operation": "query", + "Operation": "FIND", "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"query\":{\"a\":1}}\n", "Fingerprint": "FIND coll a", "FirstSeen": "2017-08-20T15:39:15.457Z", @@ -764,9 +369,9 @@ ] }, { - "ID": "dddda7545e797b073966c514f9b6fe49", + "ID": "02104210d67fe680273784d833f86831", "Namespace": "test.coll", - "Operation": "query", + "Operation": "FIND", "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"query\":{\"query\":{\"$and\":[{\"k\":{\"$gt\":1}},{\"k\":{\"$lt\":2}},{\"$or\":[{\"c\":{\"$in\":[\"/^0/\",\"/^2/\",\"/^4/\",\"/^6/\"]}},{\"pad\":{\"$in\":[\"/9$/\",\"/7$/\",\"/5$/\",\"/3$/\"]}}]}]},\"orderby\":{\"k\":-1}}}\n", "Fingerprint": "FIND coll c,k,pad", "FirstSeen": "2017-08-20T15:39:15.616Z", @@ -805,9 +410,173 @@ ] }, { - "ID": "bab52c8aa977c96ecd148c015ae07c42", + "ID": "c70403cbd55ffbb07f08c0cb77a24b19", "Namespace": "test.coll", - "Operation": "remove", + "Operation": "GEONEAR", + "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"geoNear\":\"coll\",\"near\":{\"type\":\"Point\",\"coordinates\":[1,1]},\"spherical\":true}}\n", + "Fingerprint": "GEONEAR coll", + "FirstSeen": "2017-08-20T15:39:16.061Z", + "LastSeen": "2017-08-20T15:39:48.842Z", + "TableScan": false, + "Count": 5, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0, + 0, + 0, + 0, + 0 + ], + "NScanned": [ + 0, + 0, + 0, + 10, + 10 + ], + "QueryTime": [ + 1, + 3, + 8, + 11, + 7 + ], + "ResponseLength": [ + 1406, + 1398, + 1401, + 1383, + 1383 + ] + }, + { + "ID": "ca8bb19386488570447f5753741fb494", + "Namespace": "test.coll", + "Operation": "GROUP", + "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"group\":{\"key\":{\"a\":1,\"b\":1},\"cond\":{\"b\":3},\"initial\":{},\"ns\":\"coll\",\"$reduce\":\"\"}}}\n", + "Fingerprint": "GROUP coll a,b", + "FirstSeen": "2017-08-20T15:39:16.325Z", + "LastSeen": "2017-08-20T15:39:49.276Z", + "TableScan": false, + "Count": 5, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0, + 0, + 0, + 0, + 0 + ], + "NScanned": [ + 0, + 0, + 0, + 2, + 2 + ], + "QueryTime": [ + 77, + 54, + 74, + 77, + 68 + ], + "ResponseLength": [ + 135, + 139, + 142, + 124, + 124 + ] + }, + { + "ID": "e357abe482dcc0cd03ab742741bf1c86", + "Namespace": "test.coll", + "Operation": "INSERT", + "Query": "{\"ns\":\"test.coll\",\"op\":\"insert\",\"query\":{\"_id\":1}}\n", + "Fingerprint": "INSERT coll", + "FirstSeen": "2017-08-20T15:39:16.473Z", + "LastSeen": "2017-08-20T15:39:49.44Z", + "TableScan": false, + "Count": 5, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0, + 0, + 0, + 0, + 0 + ], + "NScanned": [ + 0, + 0, + 0, + 0, + 0 + ], + "QueryTime": [ + 0, + 0, + 0, + 0, + 0 + ], + "ResponseLength": [ + 0, + 0, + 25, + 29, + 29 + ] + }, + { + "ID": "cc3cb3824eea4094eb042f5ca76bd385", + "Namespace": "test.coll", + "Operation": "MAPREDUCE", + "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"mapreduce\":\"coll\",\"map\":\"\",\"reduce\":\"\",\"query\":{\"a\":{\"$gte\":0}},\"out\":{\"inline\":1}}}\n", + "Fingerprint": "MAPREDUCE coll a", + "FirstSeen": "2017-08-20T15:39:16.701Z", + "LastSeen": "2017-08-20T15:39:49.68Z", + "TableScan": false, + "Count": 5, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0, + 0, + 0, + 0, + 0 + ], + "NScanned": [ + 0, + 0, + 0, + 3, + 3 + ], + "QueryTime": [ + 33, + 26, + 31, + 43, + 35 + ], + "ResponseLength": [ + 233, + 233, + 218, + 218, + 218 + ] + }, + { + "ID": "e72ad41302045bd6c2bcad76511f915a", + "Namespace": "test.coll", + "Operation": "REMOVE", "Query": "{\"ns\":\"test.coll\",\"op\":\"remove\",\"query\":{\"a\":{\"$gte\":2},\"b\":{\"$gte\":2}}}\n", "Fingerprint": "REMOVE coll a,b", "FirstSeen": "2017-08-20T15:39:15.126Z", @@ -866,9 +635,9 @@ ] }, { - "ID": "27cb39e62745b1ff4121b4bf6f21fb12", + "ID": "f74a5120ac22d02120ccbf6d478b0dbc", "Namespace": "test.coll", - "Operation": "update", + "Operation": "UPDATE", "Query": "{\"ns\":\"test.coll\",\"op\":\"update\",\"query\":{\"a\":{\"$gte\":2}},\"updateobj\":{\"$set\":{\"c\":1},\"$inc\":{\"a\":-10}}}\n", "Fingerprint": "UPDATE coll a", "FirstSeen": "2017-08-20T15:39:16.921Z", diff --git a/src/go/tests/expect/stats_single/aggregate_2.6.12 b/src/go/tests/expect/stats_single/aggregate_2.6.12 index afc40cc0..124f954a 100755 --- a/src/go/tests/expect/stats_single/aggregate_2.6.12 +++ b/src/go/tests/expect/stats_single/aggregate_2.6.12 @@ -1,8 +1,8 @@ [ { - "ID": "59899eb380b4e48c345fb6f997d06bfa", - "Namespace": "test.$cmd", - "Operation": "command", + "ID": "30dbfbc89efd8cfd40774dff0266a28f", + "Namespace": "test.coll", + "Operation": "AGGREGATE", "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"aggregate\":\"coll\",\"pipeline\":[{\"$match\":{\"a\":{\"$gte\":2}}}],\"cursor\":{}}}\n", "Fingerprint": "AGGREGATE coll a", "FirstSeen": "2017-08-20T15:39:14.658Z", diff --git a/src/go/tests/expect/stats_single/aggregate_3.0.15 b/src/go/tests/expect/stats_single/aggregate_3.0.15 index b3b94e5d..c1cbac26 100755 --- a/src/go/tests/expect/stats_single/aggregate_3.0.15 +++ b/src/go/tests/expect/stats_single/aggregate_3.0.15 @@ -1,8 +1,8 @@ [ { - "ID": "59899eb380b4e48c345fb6f997d06bfa", - "Namespace": "test.$cmd", - "Operation": "command", + "ID": "30dbfbc89efd8cfd40774dff0266a28f", + "Namespace": "test.coll", + "Operation": "AGGREGATE", "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"aggregate\":\"coll\",\"pipeline\":[{\"$match\":{\"a\":{\"$gte\":2}}}],\"cursor\":{}}}\n", "Fingerprint": "AGGREGATE coll a", "FirstSeen": "2017-08-20T15:39:20.858Z", diff --git a/src/go/tests/expect/stats_single/aggregate_3.2.16 b/src/go/tests/expect/stats_single/aggregate_3.2.16 index f34c0dfb..363c2d50 100755 --- a/src/go/tests/expect/stats_single/aggregate_3.2.16 +++ b/src/go/tests/expect/stats_single/aggregate_3.2.16 @@ -1,8 +1,8 @@ [ { - "ID": "11e1b6f695d43b1b5a2f7e6de2ad8305", + "ID": "30dbfbc89efd8cfd40774dff0266a28f", "Namespace": "test.coll", - "Operation": "command", + "Operation": "AGGREGATE", "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"aggregate\":\"coll\",\"pipeline\":[{\"$match\":{\"a\":{\"$gte\":2}}}],\"cursor\":{}}}\n", "Fingerprint": "AGGREGATE coll a", "FirstSeen": "2017-08-20T15:39:29.915Z", diff --git a/src/go/tests/expect/stats_single/aggregate_3.4.7 b/src/go/tests/expect/stats_single/aggregate_3.4.7 index 602bdc9e..266dfdfd 100755 --- a/src/go/tests/expect/stats_single/aggregate_3.4.7 +++ b/src/go/tests/expect/stats_single/aggregate_3.4.7 @@ -1,8 +1,8 @@ [ { - "ID": "11e1b6f695d43b1b5a2f7e6de2ad8305", + "ID": "30dbfbc89efd8cfd40774dff0266a28f", "Namespace": "test.coll", - "Operation": "command", + "Operation": "AGGREGATE", "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"aggregate\":\"coll\",\"pipeline\":[{\"$match\":{\"a\":{\"$gte\":2}}}],\"cursor\":{}}}\n", "Fingerprint": "AGGREGATE coll a", "FirstSeen": "2017-08-20T15:39:36.711Z", diff --git a/src/go/tests/expect/stats_single/aggregate_3.5.11 b/src/go/tests/expect/stats_single/aggregate_3.5.11 index 72f7afcd..3f7369e7 100755 --- a/src/go/tests/expect/stats_single/aggregate_3.5.11 +++ b/src/go/tests/expect/stats_single/aggregate_3.5.11 @@ -1,8 +1,8 @@ [ { - "ID": "11e1b6f695d43b1b5a2f7e6de2ad8305", + "ID": "30dbfbc89efd8cfd40774dff0266a28f", "Namespace": "test.coll", - "Operation": "command", + "Operation": "AGGREGATE", "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"aggregate\":\"coll\",\"pipeline\":[{\"$match\":{\"a\":{\"$gte\":2}}}],\"cursor\":{},\"$db\":\"test\"}}\n", "Fingerprint": "AGGREGATE coll a", "FirstSeen": "2017-08-20T15:39:47.203Z", diff --git a/src/go/tests/expect/stats_single/count_2.6.12 b/src/go/tests/expect/stats_single/count_2.6.12 index 62fdc209..0880b743 100755 --- a/src/go/tests/expect/stats_single/count_2.6.12 +++ b/src/go/tests/expect/stats_single/count_2.6.12 @@ -1,8 +1,8 @@ [ { - "ID": "020d9f1058f3bf08e3b1afb1ef883d44", - "Namespace": "test.$cmd", - "Operation": "command", + "ID": "cba2dff0740762c6e5769f0e300df676", + "Namespace": "test.coll", + "Operation": "COUNT", "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"count\":\"coll\",\"query\":{},\"fields\":{}}}\n", "Fingerprint": "COUNT coll", "FirstSeen": "2017-08-20T15:39:14.823Z", diff --git a/src/go/tests/expect/stats_single/count_3.0.15 b/src/go/tests/expect/stats_single/count_3.0.15 index 3ef8caf6..54257535 100755 --- a/src/go/tests/expect/stats_single/count_3.0.15 +++ b/src/go/tests/expect/stats_single/count_3.0.15 @@ -1,8 +1,8 @@ [ { - "ID": "020d9f1058f3bf08e3b1afb1ef883d44", - "Namespace": "test.$cmd", - "Operation": "command", + "ID": "cba2dff0740762c6e5769f0e300df676", + "Namespace": "test.coll", + "Operation": "COUNT", "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"count\":\"coll\",\"query\":{},\"fields\":{}}}\n", "Fingerprint": "COUNT coll", "FirstSeen": "2017-08-20T15:39:20.982Z", diff --git a/src/go/tests/expect/stats_single/count_3.2.16 b/src/go/tests/expect/stats_single/count_3.2.16 index a1f347e8..1a2173f4 100755 --- a/src/go/tests/expect/stats_single/count_3.2.16 +++ b/src/go/tests/expect/stats_single/count_3.2.16 @@ -1,8 +1,8 @@ [ { - "ID": "29701e3d37e0adb35ebd70b7ef2b3f3d", + "ID": "cba2dff0740762c6e5769f0e300df676", "Namespace": "test.coll", - "Operation": "command", + "Operation": "COUNT", "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"count\":\"coll\",\"query\":{},\"fields\":{}}}\n", "Fingerprint": "COUNT coll", "FirstSeen": "2017-08-20T15:39:30.094Z", diff --git a/src/go/tests/expect/stats_single/count_3.4.7 b/src/go/tests/expect/stats_single/count_3.4.7 index 660719fa..67e5e652 100755 --- a/src/go/tests/expect/stats_single/count_3.4.7 +++ b/src/go/tests/expect/stats_single/count_3.4.7 @@ -1,8 +1,8 @@ [ { - "ID": "29701e3d37e0adb35ebd70b7ef2b3f3d", + "ID": "cba2dff0740762c6e5769f0e300df676", "Namespace": "test.coll", - "Operation": "command", + "Operation": "COUNT", "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"count\":\"coll\",\"query\":{},\"fields\":{}}}\n", "Fingerprint": "COUNT coll", "FirstSeen": "2017-08-20T15:39:36.897Z", diff --git a/src/go/tests/expect/stats_single/count_3.5.11 b/src/go/tests/expect/stats_single/count_3.5.11 index ffd0ca42..97b3b320 100755 --- a/src/go/tests/expect/stats_single/count_3.5.11 +++ b/src/go/tests/expect/stats_single/count_3.5.11 @@ -1,8 +1,8 @@ [ { - "ID": "29701e3d37e0adb35ebd70b7ef2b3f3d", + "ID": "cba2dff0740762c6e5769f0e300df676", "Namespace": "test.coll", - "Operation": "command", + "Operation": "COUNT", "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"count\":\"coll\",\"query\":{},\"fields\":{},\"$db\":\"test\"}}\n", "Fingerprint": "COUNT coll", "FirstSeen": "2017-08-20T15:39:47.396Z", diff --git a/src/go/tests/expect/stats_single/count_with_query_2.6.12 b/src/go/tests/expect/stats_single/count_with_query_2.6.12 index 27e9e3bf..e01cedac 100755 --- a/src/go/tests/expect/stats_single/count_with_query_2.6.12 +++ b/src/go/tests/expect/stats_single/count_with_query_2.6.12 @@ -1,8 +1,8 @@ [ { - "ID": "5eee3fe927f2234d7655f4fcc7fead0a", - "Namespace": "test.$cmd", - "Operation": "command", + "ID": "10b8f47b366fbfd1fb01f8d17d75b1a2", + "Namespace": "test.coll", + "Operation": "COUNT", "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"count\":\"coll\",\"query\":{\"a\":{\"$gt\":5}},\"fields\":{}}}\n", "Fingerprint": "COUNT coll a", "FirstSeen": "2017-08-20T15:39:14.971Z", diff --git a/src/go/tests/expect/stats_single/count_with_query_3.0.15 b/src/go/tests/expect/stats_single/count_with_query_3.0.15 index 8c81f114..97f6f4bb 100755 --- a/src/go/tests/expect/stats_single/count_with_query_3.0.15 +++ b/src/go/tests/expect/stats_single/count_with_query_3.0.15 @@ -1,8 +1,8 @@ [ { - "ID": "5eee3fe927f2234d7655f4fcc7fead0a", - "Namespace": "test.$cmd", - "Operation": "command", + "ID": "10b8f47b366fbfd1fb01f8d17d75b1a2", + "Namespace": "test.coll", + "Operation": "COUNT", "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"count\":\"coll\",\"query\":{\"a\":{\"$gt\":5}},\"fields\":{}}}\n", "Fingerprint": "COUNT coll a", "FirstSeen": "2017-08-20T15:39:21.124Z", diff --git a/src/go/tests/expect/stats_single/count_with_query_3.2.16 b/src/go/tests/expect/stats_single/count_with_query_3.2.16 index e46b5be7..a8509d69 100755 --- a/src/go/tests/expect/stats_single/count_with_query_3.2.16 +++ b/src/go/tests/expect/stats_single/count_with_query_3.2.16 @@ -1,8 +1,8 @@ [ { - "ID": "2300d7f2d372205544f249b010e9b8ad", + "ID": "10b8f47b366fbfd1fb01f8d17d75b1a2", "Namespace": "test.coll", - "Operation": "command", + "Operation": "COUNT", "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"count\":\"coll\",\"query\":{\"a\":{\"$gt\":5}},\"fields\":{}}}\n", "Fingerprint": "COUNT coll a", "FirstSeen": "2017-08-20T15:39:30.251Z", diff --git a/src/go/tests/expect/stats_single/count_with_query_3.4.7 b/src/go/tests/expect/stats_single/count_with_query_3.4.7 index a26da1e8..a95352d5 100755 --- a/src/go/tests/expect/stats_single/count_with_query_3.4.7 +++ b/src/go/tests/expect/stats_single/count_with_query_3.4.7 @@ -1,8 +1,8 @@ [ { - "ID": "2300d7f2d372205544f249b010e9b8ad", + "ID": "10b8f47b366fbfd1fb01f8d17d75b1a2", "Namespace": "test.coll", - "Operation": "command", + "Operation": "COUNT", "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"count\":\"coll\",\"query\":{\"a\":{\"$gt\":5}},\"fields\":{}}}\n", "Fingerprint": "COUNT coll a", "FirstSeen": "2017-08-20T15:39:37.077Z", diff --git a/src/go/tests/expect/stats_single/count_with_query_3.5.11 b/src/go/tests/expect/stats_single/count_with_query_3.5.11 index 71f31676..a91ee1fc 100755 --- a/src/go/tests/expect/stats_single/count_with_query_3.5.11 +++ b/src/go/tests/expect/stats_single/count_with_query_3.5.11 @@ -1,8 +1,8 @@ [ { - "ID": "2300d7f2d372205544f249b010e9b8ad", + "ID": "10b8f47b366fbfd1fb01f8d17d75b1a2", "Namespace": "test.coll", - "Operation": "command", + "Operation": "COUNT", "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"count\":\"coll\",\"query\":{\"a\":{\"$gt\":5}},\"fields\":{},\"$db\":\"test\"}}\n", "Fingerprint": "COUNT coll a", "FirstSeen": "2017-08-20T15:39:47.573Z", diff --git a/src/go/tests/expect/stats_single/delete_2.6.12 b/src/go/tests/expect/stats_single/delete_2.6.12 index 8eda72ed..05e3cbcf 100755 --- a/src/go/tests/expect/stats_single/delete_2.6.12 +++ b/src/go/tests/expect/stats_single/delete_2.6.12 @@ -1,8 +1,8 @@ [ { - "ID": "bab52c8aa977c96ecd148c015ae07c42", + "ID": "e72ad41302045bd6c2bcad76511f915a", "Namespace": "test.coll", - "Operation": "remove", + "Operation": "REMOVE", "Query": "{\"ns\":\"test.coll\",\"op\":\"remove\",\"query\":{\"a\":{\"$gte\":2},\"b\":{\"$gte\":2}}}\n", "Fingerprint": "REMOVE coll a,b", "FirstSeen": "2017-08-20T15:39:15.126Z", diff --git a/src/go/tests/expect/stats_single/delete_3.0.15 b/src/go/tests/expect/stats_single/delete_3.0.15 index 8186ab31..ee4236c0 100755 --- a/src/go/tests/expect/stats_single/delete_3.0.15 +++ b/src/go/tests/expect/stats_single/delete_3.0.15 @@ -1,8 +1,8 @@ [ { - "ID": "bab52c8aa977c96ecd148c015ae07c42", + "ID": "e72ad41302045bd6c2bcad76511f915a", "Namespace": "test.coll", - "Operation": "remove", + "Operation": "REMOVE", "Query": "{\"ns\":\"test.coll\",\"op\":\"remove\",\"query\":{\"a\":{\"$gte\":2},\"b\":{\"$gte\":2}}}\n", "Fingerprint": "REMOVE coll a,b", "FirstSeen": "2017-08-20T15:39:21.265Z", diff --git a/src/go/tests/expect/stats_single/delete_3.2.16 b/src/go/tests/expect/stats_single/delete_3.2.16 index 261dc6b0..b38ca7b7 100755 --- a/src/go/tests/expect/stats_single/delete_3.2.16 +++ b/src/go/tests/expect/stats_single/delete_3.2.16 @@ -1,8 +1,8 @@ [ { - "ID": "bab52c8aa977c96ecd148c015ae07c42", + "ID": "e72ad41302045bd6c2bcad76511f915a", "Namespace": "test.coll", - "Operation": "remove", + "Operation": "REMOVE", "Query": "{\"ns\":\"test.coll\",\"op\":\"remove\",\"query\":{\"a\":{\"$gte\":2},\"b\":{\"$gte\":2}}}\n", "Fingerprint": "REMOVE coll a,b", "FirstSeen": "2017-08-20T15:39:30.543Z", diff --git a/src/go/tests/expect/stats_single/delete_3.4.7 b/src/go/tests/expect/stats_single/delete_3.4.7 index 5ff3e534..ad373395 100755 --- a/src/go/tests/expect/stats_single/delete_3.4.7 +++ b/src/go/tests/expect/stats_single/delete_3.4.7 @@ -1,8 +1,8 @@ [ { - "ID": "bab52c8aa977c96ecd148c015ae07c42", + "ID": "e72ad41302045bd6c2bcad76511f915a", "Namespace": "test.coll", - "Operation": "remove", + "Operation": "REMOVE", "Query": "{\"ns\":\"test.coll\",\"op\":\"remove\",\"query\":{\"a\":{\"$gte\":2},\"b\":{\"$gte\":2}}}\n", "Fingerprint": "REMOVE coll a,b", "FirstSeen": "2017-08-20T15:39:37.279Z", diff --git a/src/go/tests/expect/stats_single/delete_3.5.11 b/src/go/tests/expect/stats_single/delete_3.5.11 index 713b8fd7..9f2b0511 100755 --- a/src/go/tests/expect/stats_single/delete_3.5.11 +++ b/src/go/tests/expect/stats_single/delete_3.5.11 @@ -1,8 +1,8 @@ [ { - "ID": "bab52c8aa977c96ecd148c015ae07c42", + "ID": "e72ad41302045bd6c2bcad76511f915a", "Namespace": "test.coll", - "Operation": "remove", + "Operation": "REMOVE", "Query": "{\"ns\":\"test.coll\",\"op\":\"remove\",\"command\":{\"q\":{\"a\":{\"$gte\":2},\"b\":{\"$gte\":2}},\"limit\":1}}\n", "Fingerprint": "REMOVE coll a,b", "FirstSeen": "2017-08-20T15:39:47.745Z", diff --git a/src/go/tests/expect/stats_single/delete_all_2.6.12 b/src/go/tests/expect/stats_single/delete_all_2.6.12 index e66c8de9..d5138f09 100755 --- a/src/go/tests/expect/stats_single/delete_all_2.6.12 +++ b/src/go/tests/expect/stats_single/delete_all_2.6.12 @@ -1,8 +1,8 @@ [ { - "ID": "bab52c8aa977c96ecd148c015ae07c42", + "ID": "e72ad41302045bd6c2bcad76511f915a", "Namespace": "test.coll", - "Operation": "remove", + "Operation": "REMOVE", "Query": "{\"ns\":\"test.coll\",\"op\":\"remove\",\"query\":{\"a\":{\"$gte\":2},\"b\":{\"$gte\":2}}}\n", "Fingerprint": "REMOVE coll a,b", "FirstSeen": "2017-08-30T10:54:45.348Z", diff --git a/src/go/tests/expect/stats_single/delete_all_3.0.15 b/src/go/tests/expect/stats_single/delete_all_3.0.15 index acde6c57..24ec050f 100755 --- a/src/go/tests/expect/stats_single/delete_all_3.0.15 +++ b/src/go/tests/expect/stats_single/delete_all_3.0.15 @@ -1,8 +1,8 @@ [ { - "ID": "bab52c8aa977c96ecd148c015ae07c42", + "ID": "e72ad41302045bd6c2bcad76511f915a", "Namespace": "test.coll", - "Operation": "remove", + "Operation": "REMOVE", "Query": "{\"ns\":\"test.coll\",\"op\":\"remove\",\"query\":{\"a\":{\"$gte\":2},\"b\":{\"$gte\":2}}}\n", "Fingerprint": "REMOVE coll a,b", "FirstSeen": "2017-08-30T10:54:52.821Z", diff --git a/src/go/tests/expect/stats_single/delete_all_3.2.16 b/src/go/tests/expect/stats_single/delete_all_3.2.16 index fb44fb95..be1f7b48 100755 --- a/src/go/tests/expect/stats_single/delete_all_3.2.16 +++ b/src/go/tests/expect/stats_single/delete_all_3.2.16 @@ -1,8 +1,8 @@ [ { - "ID": "bab52c8aa977c96ecd148c015ae07c42", + "ID": "e72ad41302045bd6c2bcad76511f915a", "Namespace": "test.coll", - "Operation": "remove", + "Operation": "REMOVE", "Query": "{\"ns\":\"test.coll\",\"op\":\"remove\",\"query\":{\"a\":{\"$gte\":2},\"b\":{\"$gte\":2}}}\n", "Fingerprint": "REMOVE coll a,b", "FirstSeen": "2017-08-30T10:55:02.238Z", diff --git a/src/go/tests/expect/stats_single/delete_all_3.4.7 b/src/go/tests/expect/stats_single/delete_all_3.4.7 index b29696f5..466971bd 100755 --- a/src/go/tests/expect/stats_single/delete_all_3.4.7 +++ b/src/go/tests/expect/stats_single/delete_all_3.4.7 @@ -1,8 +1,8 @@ [ { - "ID": "bab52c8aa977c96ecd148c015ae07c42", + "ID": "e72ad41302045bd6c2bcad76511f915a", "Namespace": "test.coll", - "Operation": "remove", + "Operation": "REMOVE", "Query": "{\"ns\":\"test.coll\",\"op\":\"remove\",\"query\":{\"a\":{\"$gte\":2},\"b\":{\"$gte\":2}}}\n", "Fingerprint": "REMOVE coll a,b", "FirstSeen": "2017-08-30T10:55:09.833Z", diff --git a/src/go/tests/expect/stats_single/delete_all_3.5.11 b/src/go/tests/expect/stats_single/delete_all_3.5.11 index 9f55141f..54be6162 100755 --- a/src/go/tests/expect/stats_single/delete_all_3.5.11 +++ b/src/go/tests/expect/stats_single/delete_all_3.5.11 @@ -1,8 +1,8 @@ [ { - "ID": "bab52c8aa977c96ecd148c015ae07c42", + "ID": "e72ad41302045bd6c2bcad76511f915a", "Namespace": "test.coll", - "Operation": "remove", + "Operation": "REMOVE", "Query": "{\"ns\":\"test.coll\",\"op\":\"remove\",\"command\":{\"q\":{\"a\":{\"$gte\":2},\"b\":{\"$gte\":2}},\"limit\":0}}\n", "Fingerprint": "REMOVE coll a,b", "FirstSeen": "2017-08-30T10:55:19.142Z", diff --git a/src/go/tests/expect/stats_single/distinct_2.6.12 b/src/go/tests/expect/stats_single/distinct_2.6.12 index ff012779..92247985 100755 --- a/src/go/tests/expect/stats_single/distinct_2.6.12 +++ b/src/go/tests/expect/stats_single/distinct_2.6.12 @@ -1,8 +1,8 @@ [ { - "ID": "24acf4277fabf2a382f266bb4e6e8e3e", - "Namespace": "test.$cmd", - "Operation": "command", + "ID": "e4122a58c99ab0a4020ce7d195c5a8cb", + "Namespace": "test.coll", + "Operation": "DISTINCT", "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"distinct\":\"coll\",\"key\":\"a\",\"query\":{\"b\":{\"$gte\":5}}}}\n", "Fingerprint": "DISTINCT coll a,b", "FirstSeen": "2017-08-20T15:39:15.323Z", diff --git a/src/go/tests/expect/stats_single/distinct_3.0.15 b/src/go/tests/expect/stats_single/distinct_3.0.15 index bce6b254..87e55c38 100755 --- a/src/go/tests/expect/stats_single/distinct_3.0.15 +++ b/src/go/tests/expect/stats_single/distinct_3.0.15 @@ -1,8 +1,8 @@ [ { - "ID": "24acf4277fabf2a382f266bb4e6e8e3e", - "Namespace": "test.$cmd", - "Operation": "command", + "ID": "e4122a58c99ab0a4020ce7d195c5a8cb", + "Namespace": "test.coll", + "Operation": "DISTINCT", "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"distinct\":\"coll\",\"key\":\"a\",\"query\":{\"b\":{\"$gte\":5}}}}\n", "Fingerprint": "DISTINCT coll a,b", "FirstSeen": "2017-08-20T15:39:21.392Z", diff --git a/src/go/tests/expect/stats_single/distinct_3.2.16 b/src/go/tests/expect/stats_single/distinct_3.2.16 index 84971238..bead6771 100755 --- a/src/go/tests/expect/stats_single/distinct_3.2.16 +++ b/src/go/tests/expect/stats_single/distinct_3.2.16 @@ -1,8 +1,8 @@ [ { - "ID": "a4be6ed97c946182af7e30cf818afdac", + "ID": "e4122a58c99ab0a4020ce7d195c5a8cb", "Namespace": "test.coll", - "Operation": "command", + "Operation": "DISTINCT", "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"distinct\":\"coll\",\"key\":\"a\",\"query\":{\"b\":{\"$gte\":5}}}}\n", "Fingerprint": "DISTINCT coll a,b", "FirstSeen": "2017-08-20T15:39:30.748Z", diff --git a/src/go/tests/expect/stats_single/distinct_3.4.7 b/src/go/tests/expect/stats_single/distinct_3.4.7 index 9de485cf..6bea585a 100755 --- a/src/go/tests/expect/stats_single/distinct_3.4.7 +++ b/src/go/tests/expect/stats_single/distinct_3.4.7 @@ -1,8 +1,8 @@ [ { - "ID": "a4be6ed97c946182af7e30cf818afdac", + "ID": "e4122a58c99ab0a4020ce7d195c5a8cb", "Namespace": "test.coll", - "Operation": "command", + "Operation": "DISTINCT", "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"distinct\":\"coll\",\"key\":\"a\",\"query\":{\"b\":{\"$gte\":5}}}}\n", "Fingerprint": "DISTINCT coll a,b", "FirstSeen": "2017-08-20T15:39:37.511Z", diff --git a/src/go/tests/expect/stats_single/distinct_3.5.11 b/src/go/tests/expect/stats_single/distinct_3.5.11 index c65bced7..77458131 100755 --- a/src/go/tests/expect/stats_single/distinct_3.5.11 +++ b/src/go/tests/expect/stats_single/distinct_3.5.11 @@ -1,8 +1,8 @@ [ { - "ID": "a4be6ed97c946182af7e30cf818afdac", + "ID": "e4122a58c99ab0a4020ce7d195c5a8cb", "Namespace": "test.coll", - "Operation": "command", + "Operation": "DISTINCT", "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"distinct\":\"coll\",\"key\":\"a\",\"query\":{\"b\":{\"$gte\":5}},\"$db\":\"test\"}}\n", "Fingerprint": "DISTINCT coll a,b", "FirstSeen": "2017-08-20T15:39:47.927Z", diff --git a/src/go/tests/expect/stats_single/eval_2.6.12 b/src/go/tests/expect/stats_single/eval_2.6.12 index 1d237078..d69d5bda 100755 --- a/src/go/tests/expect/stats_single/eval_2.6.12 +++ b/src/go/tests/expect/stats_single/eval_2.6.12 @@ -1,8 +1,8 @@ [ { - "ID": "3335908aa111fe5eedf75479d9b1eb72", - "Namespace": "test.$cmd", - "Operation": "command", + "ID": "a6782ae38ef891d5506341a4b0ab2747", + "Namespace": "test", + "Operation": "EVAL", "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"$eval\":\"db\"}}\n", "Fingerprint": "EVAL", "FirstSeen": "2017-09-05T19:39:24.522Z", diff --git a/src/go/tests/expect/stats_single/eval_3.0.15 b/src/go/tests/expect/stats_single/eval_3.0.15 index 9d23619b..b4898132 100755 --- a/src/go/tests/expect/stats_single/eval_3.0.15 +++ b/src/go/tests/expect/stats_single/eval_3.0.15 @@ -1,8 +1,8 @@ [ { - "ID": "3335908aa111fe5eedf75479d9b1eb72", - "Namespace": "test.$cmd", - "Operation": "command", + "ID": "a6782ae38ef891d5506341a4b0ab2747", + "Namespace": "test", + "Operation": "EVAL", "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"$eval\":\"db\"}}\n", "Fingerprint": "EVAL", "FirstSeen": "2017-09-05T19:39:32.054Z", diff --git a/src/go/tests/expect/stats_single/eval_3.2.16 b/src/go/tests/expect/stats_single/eval_3.2.16 index 291e6997..4f7ab133 100755 --- a/src/go/tests/expect/stats_single/eval_3.2.16 +++ b/src/go/tests/expect/stats_single/eval_3.2.16 @@ -1,8 +1,8 @@ [ { - "ID": "71b3d6aa44d34aaa02cd65bad3e25f49", + "ID": "a6782ae38ef891d5506341a4b0ab2747", "Namespace": "test", - "Operation": "command", + "Operation": "EVAL", "Query": "{\"ns\":\"test\",\"op\":\"command\",\"command\":{\"$eval\":\"db\"}}\n", "Fingerprint": "EVAL", "FirstSeen": "2017-09-05T19:39:41.581Z", diff --git a/src/go/tests/expect/stats_single/eval_3.4.7 b/src/go/tests/expect/stats_single/eval_3.4.7 index 829ccd72..9bb7311e 100755 --- a/src/go/tests/expect/stats_single/eval_3.4.7 +++ b/src/go/tests/expect/stats_single/eval_3.4.7 @@ -1,8 +1,8 @@ [ { - "ID": "71b3d6aa44d34aaa02cd65bad3e25f49", + "ID": "a6782ae38ef891d5506341a4b0ab2747", "Namespace": "test", - "Operation": "command", + "Operation": "EVAL", "Query": "{\"ns\":\"test\",\"op\":\"command\",\"command\":{\"$eval\":\"db\"}}\n", "Fingerprint": "EVAL", "FirstSeen": "2017-09-05T19:39:48.888Z", diff --git a/src/go/tests/expect/stats_single/eval_3.5.11 b/src/go/tests/expect/stats_single/eval_3.5.11 index 87ee3cba..235e1f93 100755 --- a/src/go/tests/expect/stats_single/eval_3.5.11 +++ b/src/go/tests/expect/stats_single/eval_3.5.11 @@ -1,8 +1,8 @@ [ { - "ID": "71b3d6aa44d34aaa02cd65bad3e25f49", + "ID": "a6782ae38ef891d5506341a4b0ab2747", "Namespace": "test", - "Operation": "command", + "Operation": "EVAL", "Query": "{\"ns\":\"test\",\"op\":\"command\",\"command\":{\"$eval\":\"db\",\"$db\":\"test\"}}\n", "Fingerprint": "EVAL", "FirstSeen": "2017-09-05T19:40:00.171Z", diff --git a/src/go/tests/expect/stats_single/explain_2.6.12 b/src/go/tests/expect/stats_single/explain_2.6.12 index 686e271f..2c9c05b1 100755 --- a/src/go/tests/expect/stats_single/explain_2.6.12 +++ b/src/go/tests/expect/stats_single/explain_2.6.12 @@ -1,8 +1,8 @@ [ { - "ID": "4c06ec043313864d76669ddc2a1be353", - "Namespace": "test.coll", - "Operation": "query", + "ID": "76d7662df07b44135ac3e07e44a6eb39", + "Namespace": "", + "Operation": "EXPLAIN", "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"query\":{\"query\":{},\"$explain\":true}}\n", "Fingerprint": "EXPLAIN", "FirstSeen": "2017-09-05T19:39:24.666Z", diff --git a/src/go/tests/expect/stats_single/explain_3.0.15 b/src/go/tests/expect/stats_single/explain_3.0.15 index 9f8c72e8..53767691 100755 --- a/src/go/tests/expect/stats_single/explain_3.0.15 +++ b/src/go/tests/expect/stats_single/explain_3.0.15 @@ -1,8 +1,8 @@ [ { - "ID": "ada85b4f1473b9a1fb37158a8481e20e", - "Namespace": "test.$cmd", - "Operation": "command", + "ID": "76d7662df07b44135ac3e07e44a6eb39", + "Namespace": "", + "Operation": "EXPLAIN", "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"explain\":{\"find\":\"coll\",\"filter\":{},\"options\":{}},\"verbosity\":\"queryPlanner\"}}\n", "Fingerprint": "EXPLAIN", "FirstSeen": "2017-09-05T19:39:32.21Z", diff --git a/src/go/tests/expect/stats_single/explain_3.2.16 b/src/go/tests/expect/stats_single/explain_3.2.16 index 6952422c..7a68ab4f 100755 --- a/src/go/tests/expect/stats_single/explain_3.2.16 +++ b/src/go/tests/expect/stats_single/explain_3.2.16 @@ -1,8 +1,8 @@ [ { - "ID": "e2f53c6824c5cbe454e33e128b350d1e", - "Namespace": "test.coll", - "Operation": "command", + "ID": "76d7662df07b44135ac3e07e44a6eb39", + "Namespace": "", + "Operation": "EXPLAIN", "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"explain\":{\"find\":\"coll\",\"filter\":{}},\"verbosity\":\"queryPlanner\"}}\n", "Fingerprint": "EXPLAIN", "FirstSeen": "2017-09-05T19:39:41.753Z", diff --git a/src/go/tests/expect/stats_single/explain_3.4.7 b/src/go/tests/expect/stats_single/explain_3.4.7 index a507942b..99384bf8 100755 --- a/src/go/tests/expect/stats_single/explain_3.4.7 +++ b/src/go/tests/expect/stats_single/explain_3.4.7 @@ -1,8 +1,8 @@ [ { - "ID": "e2f53c6824c5cbe454e33e128b350d1e", - "Namespace": "test.coll", - "Operation": "command", + "ID": "76d7662df07b44135ac3e07e44a6eb39", + "Namespace": "", + "Operation": "EXPLAIN", "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"explain\":{\"find\":\"coll\",\"filter\":{}},\"verbosity\":\"queryPlanner\"}}\n", "Fingerprint": "EXPLAIN", "FirstSeen": "2017-09-05T19:39:49.065Z", diff --git a/src/go/tests/expect/stats_single/explain_3.5.11 b/src/go/tests/expect/stats_single/explain_3.5.11 index af4822c3..3d211be2 100755 --- a/src/go/tests/expect/stats_single/explain_3.5.11 +++ b/src/go/tests/expect/stats_single/explain_3.5.11 @@ -1,8 +1,8 @@ [ { - "ID": "e2f53c6824c5cbe454e33e128b350d1e", - "Namespace": "test.coll", - "Operation": "command", + "ID": "76d7662df07b44135ac3e07e44a6eb39", + "Namespace": "", + "Operation": "EXPLAIN", "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"explain\":{\"find\":\"coll\",\"filter\":{}},\"verbosity\":\"queryPlanner\",\"$db\":\"test\"}}\n", "Fingerprint": "EXPLAIN", "FirstSeen": "2017-09-05T19:40:00.433Z", diff --git a/src/go/tests/expect/stats_single/find_2.6.12 b/src/go/tests/expect/stats_single/find_2.6.12 index f63b1227..993d644e 100755 --- a/src/go/tests/expect/stats_single/find_2.6.12 +++ b/src/go/tests/expect/stats_single/find_2.6.12 @@ -1,8 +1,8 @@ [ { - "ID": "4e9241090af6f4a49545baf7c015fb5c", + "ID": "fe0bf975a044fe47fd32b835ceba612d", "Namespace": "test.coll", - "Operation": "query", + "Operation": "FIND", "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"query\":{\"a\":1}}\n", "Fingerprint": "FIND coll a", "FirstSeen": "2017-08-20T15:39:15.457Z", diff --git a/src/go/tests/expect/stats_single/find_3.0.15 b/src/go/tests/expect/stats_single/find_3.0.15 index 62d756e8..ccd6a0aa 100755 --- a/src/go/tests/expect/stats_single/find_3.0.15 +++ b/src/go/tests/expect/stats_single/find_3.0.15 @@ -1,8 +1,8 @@ [ { - "ID": "4e9241090af6f4a49545baf7c015fb5c", + "ID": "fe0bf975a044fe47fd32b835ceba612d", "Namespace": "test.coll", - "Operation": "query", + "Operation": "FIND", "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"query\":{\"a\":1}}\n", "Fingerprint": "FIND coll a", "FirstSeen": "2017-08-20T15:39:21.515Z", diff --git a/src/go/tests/expect/stats_single/find_3.2.16 b/src/go/tests/expect/stats_single/find_3.2.16 index db83ddc9..102722d1 100755 --- a/src/go/tests/expect/stats_single/find_3.2.16 +++ b/src/go/tests/expect/stats_single/find_3.2.16 @@ -1,8 +1,8 @@ [ { - "ID": "4e9241090af6f4a49545baf7c015fb5c", + "ID": "fe0bf975a044fe47fd32b835ceba612d", "Namespace": "test.coll", - "Operation": "query", + "Operation": "FIND", "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"query\":{\"find\":\"coll\",\"filter\":{\"a\":1}}}\n", "Fingerprint": "FIND coll a", "FirstSeen": "2017-08-20T15:39:30.913Z", diff --git a/src/go/tests/expect/stats_single/find_3.4.7 b/src/go/tests/expect/stats_single/find_3.4.7 index 90940edf..b1d083a2 100755 --- a/src/go/tests/expect/stats_single/find_3.4.7 +++ b/src/go/tests/expect/stats_single/find_3.4.7 @@ -1,8 +1,8 @@ [ { - "ID": "4e9241090af6f4a49545baf7c015fb5c", + "ID": "fe0bf975a044fe47fd32b835ceba612d", "Namespace": "test.coll", - "Operation": "query", + "Operation": "FIND", "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"query\":{\"find\":\"coll\",\"filter\":{\"a\":1}}}\n", "Fingerprint": "FIND coll a", "FirstSeen": "2017-08-20T15:39:37.66Z", diff --git a/src/go/tests/expect/stats_single/find_3.5.11 b/src/go/tests/expect/stats_single/find_3.5.11 index dd1fe141..6445658e 100755 --- a/src/go/tests/expect/stats_single/find_3.5.11 +++ b/src/go/tests/expect/stats_single/find_3.5.11 @@ -1,8 +1,8 @@ [ { - "ID": "4e9241090af6f4a49545baf7c015fb5c", + "ID": "fe0bf975a044fe47fd32b835ceba612d", "Namespace": "test.coll", - "Operation": "query", + "Operation": "FIND", "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"command\":{\"find\":\"coll\",\"filter\":{\"a\":1},\"$db\":\"test\"}}\n", "Fingerprint": "FIND coll a", "FirstSeen": "2017-08-20T15:39:48.107Z", diff --git a/src/go/tests/expect/stats_single/find_andrii_2.6.12 b/src/go/tests/expect/stats_single/find_andrii_2.6.12 index 9d485ae3..cfd29fb4 100755 --- a/src/go/tests/expect/stats_single/find_andrii_2.6.12 +++ b/src/go/tests/expect/stats_single/find_andrii_2.6.12 @@ -1,8 +1,8 @@ [ { - "ID": "dddda7545e797b073966c514f9b6fe49", + "ID": "02104210d67fe680273784d833f86831", "Namespace": "test.coll", - "Operation": "query", + "Operation": "FIND", "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"query\":{\"query\":{\"$and\":[{\"k\":{\"$gt\":1}},{\"k\":{\"$lt\":2}},{\"$or\":[{\"c\":{\"$in\":[\"/^0/\",\"/^2/\",\"/^4/\",\"/^6/\"]}},{\"pad\":{\"$in\":[\"/9$/\",\"/7$/\",\"/5$/\",\"/3$/\"]}}]}]},\"orderby\":{\"k\":-1}}}\n", "Fingerprint": "FIND coll c,k,pad", "FirstSeen": "2017-08-20T15:39:15.616Z", diff --git a/src/go/tests/expect/stats_single/find_andrii_3.0.15 b/src/go/tests/expect/stats_single/find_andrii_3.0.15 index 8746f1b2..995e9a39 100755 --- a/src/go/tests/expect/stats_single/find_andrii_3.0.15 +++ b/src/go/tests/expect/stats_single/find_andrii_3.0.15 @@ -1,8 +1,8 @@ [ { - "ID": "dddda7545e797b073966c514f9b6fe49", + "ID": "02104210d67fe680273784d833f86831", "Namespace": "test.coll", - "Operation": "query", + "Operation": "FIND", "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"query\":{\"query\":{\"$and\":[{\"k\":{\"$gt\":1}},{\"k\":{\"$lt\":2}},{\"$or\":[{\"c\":{\"$in\":[\"/^0/\",\"/^2/\",\"/^4/\",\"/^6/\"]}},{\"pad\":{\"$in\":[\"/9$/\",\"/7$/\",\"/5$/\",\"/3$/\"]}}]}]},\"orderby\":{\"k\":-1}}}\n", "Fingerprint": "FIND coll c,k,pad", "FirstSeen": "2017-08-20T15:39:21.656Z", diff --git a/src/go/tests/expect/stats_single/find_andrii_3.2.16 b/src/go/tests/expect/stats_single/find_andrii_3.2.16 index 4d7551d0..f94b22f3 100755 --- a/src/go/tests/expect/stats_single/find_andrii_3.2.16 +++ b/src/go/tests/expect/stats_single/find_andrii_3.2.16 @@ -1,8 +1,8 @@ [ { - "ID": "dddda7545e797b073966c514f9b6fe49", + "ID": "02104210d67fe680273784d833f86831", "Namespace": "test.coll", - "Operation": "query", + "Operation": "FIND", "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"query\":{\"find\":\"coll\",\"filter\":{\"$and\":[{\"k\":{\"$gt\":1}},{\"k\":{\"$lt\":2}},{\"$or\":[{\"c\":{\"$in\":[\"/^0/\",\"/^2/\",\"/^4/\",\"/^6/\"]}},{\"pad\":{\"$in\":[\"/9$/\",\"/7$/\",\"/5$/\",\"/3$/\"]}}]}]},\"limit\":100,\"singleBatch\":false,\"sort\":{\"k\":-1}}}\n", "Fingerprint": "FIND coll c,k,pad", "FirstSeen": "2017-08-20T15:39:31.085Z", diff --git a/src/go/tests/expect/stats_single/find_andrii_3.4.7 b/src/go/tests/expect/stats_single/find_andrii_3.4.7 index 6f1d5db0..64ff6779 100755 --- a/src/go/tests/expect/stats_single/find_andrii_3.4.7 +++ b/src/go/tests/expect/stats_single/find_andrii_3.4.7 @@ -1,8 +1,8 @@ [ { - "ID": "dddda7545e797b073966c514f9b6fe49", + "ID": "02104210d67fe680273784d833f86831", "Namespace": "test.coll", - "Operation": "query", + "Operation": "FIND", "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"query\":{\"find\":\"coll\",\"filter\":{\"$and\":[{\"k\":{\"$gt\":1}},{\"k\":{\"$lt\":2}},{\"$or\":[{\"c\":{\"$in\":[\"/^0/\",\"/^2/\",\"/^4/\",\"/^6/\"]}},{\"pad\":{\"$in\":[\"/9$/\",\"/7$/\",\"/5$/\",\"/3$/\"]}}]}]},\"limit\":100,\"singleBatch\":false,\"sort\":{\"k\":-1}}}\n", "Fingerprint": "FIND coll c,k,pad", "FirstSeen": "2017-08-20T15:39:37.823Z", diff --git a/src/go/tests/expect/stats_single/find_andrii_3.5.11 b/src/go/tests/expect/stats_single/find_andrii_3.5.11 index cbcd190d..b453f124 100755 --- a/src/go/tests/expect/stats_single/find_andrii_3.5.11 +++ b/src/go/tests/expect/stats_single/find_andrii_3.5.11 @@ -1,8 +1,8 @@ [ { - "ID": "dddda7545e797b073966c514f9b6fe49", + "ID": "02104210d67fe680273784d833f86831", "Namespace": "test.coll", - "Operation": "query", + "Operation": "FIND", "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"command\":{\"find\":\"coll\",\"filter\":{\"$and\":[{\"k\":{\"$gt\":1}},{\"k\":{\"$lt\":2}},{\"$or\":[{\"c\":{\"$in\":[\"/^0/\",\"/^2/\",\"/^4/\",\"/^6/\"]}},{\"pad\":{\"$in\":[\"/9$/\",\"/7$/\",\"/5$/\",\"/3$/\"]}}]}]},\"limit\":100,\"singleBatch\":false,\"sort\":{\"k\":-1},\"$db\":\"test\"}}\n", "Fingerprint": "FIND coll c,k,pad", "FirstSeen": "2017-08-20T15:39:48.277Z", diff --git a/src/go/tests/expect/stats_single/find_empty_2.6.12 b/src/go/tests/expect/stats_single/find_empty_2.6.12 index 4ce7d8aa..991e94de 100755 --- a/src/go/tests/expect/stats_single/find_empty_2.6.12 +++ b/src/go/tests/expect/stats_single/find_empty_2.6.12 @@ -1,8 +1,8 @@ [ { - "ID": "b9a4b74ac8b3747f44951490e6279b96", + "ID": "2a639e77efe3e68399ef9482575b3421", "Namespace": "test.coll", - "Operation": "query", + "Operation": "FIND", "Query": "{\"ns\":\"test.coll\",\"op\":\"query\"}\n", "Fingerprint": "FIND coll", "FirstSeen": "2017-08-20T15:39:15.75Z", diff --git a/src/go/tests/expect/stats_single/find_empty_3.0.15 b/src/go/tests/expect/stats_single/find_empty_3.0.15 index f4860b5c..87e78532 100755 --- a/src/go/tests/expect/stats_single/find_empty_3.0.15 +++ b/src/go/tests/expect/stats_single/find_empty_3.0.15 @@ -1,8 +1,8 @@ [ { - "ID": "b9a4b74ac8b3747f44951490e6279b96", + "ID": "2a639e77efe3e68399ef9482575b3421", "Namespace": "test.coll", - "Operation": "query", + "Operation": "FIND", "Query": "{\"ns\":\"test.coll\",\"op\":\"query\"}\n", "Fingerprint": "FIND coll", "FirstSeen": "2017-08-20T15:39:21.769Z", diff --git a/src/go/tests/expect/stats_single/find_empty_3.2.16 b/src/go/tests/expect/stats_single/find_empty_3.2.16 index 8ef5e7b0..36e18e2c 100755 --- a/src/go/tests/expect/stats_single/find_empty_3.2.16 +++ b/src/go/tests/expect/stats_single/find_empty_3.2.16 @@ -1,8 +1,8 @@ [ { - "ID": "b9a4b74ac8b3747f44951490e6279b96", + "ID": "2a639e77efe3e68399ef9482575b3421", "Namespace": "test.coll", - "Operation": "query", + "Operation": "FIND", "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"query\":{\"find\":\"coll\",\"filter\":{}}}\n", "Fingerprint": "FIND coll", "FirstSeen": "2017-08-20T15:39:31.294Z", diff --git a/src/go/tests/expect/stats_single/find_empty_3.4.7 b/src/go/tests/expect/stats_single/find_empty_3.4.7 index 494082cf..c8b897fc 100755 --- a/src/go/tests/expect/stats_single/find_empty_3.4.7 +++ b/src/go/tests/expect/stats_single/find_empty_3.4.7 @@ -1,8 +1,8 @@ [ { - "ID": "b9a4b74ac8b3747f44951490e6279b96", + "ID": "2a639e77efe3e68399ef9482575b3421", "Namespace": "test.coll", - "Operation": "query", + "Operation": "FIND", "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"query\":{\"find\":\"coll\",\"filter\":{}}}\n", "Fingerprint": "FIND coll", "FirstSeen": "2017-08-20T15:39:37.964Z", diff --git a/src/go/tests/expect/stats_single/find_empty_3.5.11 b/src/go/tests/expect/stats_single/find_empty_3.5.11 index a01d4131..423b5ba9 100755 --- a/src/go/tests/expect/stats_single/find_empty_3.5.11 +++ b/src/go/tests/expect/stats_single/find_empty_3.5.11 @@ -1,8 +1,8 @@ [ { - "ID": "b9a4b74ac8b3747f44951490e6279b96", + "ID": "2a639e77efe3e68399ef9482575b3421", "Namespace": "test.coll", - "Operation": "query", + "Operation": "FIND", "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"command\":{\"find\":\"coll\",\"filter\":{},\"$db\":\"test\"}}\n", "Fingerprint": "FIND coll", "FirstSeen": "2017-08-20T15:39:48.429Z", diff --git a/src/go/tests/expect/stats_single/findandmodify_2.6.12 b/src/go/tests/expect/stats_single/findandmodify_2.6.12 index 287b7faf..62d1328d 100755 --- a/src/go/tests/expect/stats_single/findandmodify_2.6.12 +++ b/src/go/tests/expect/stats_single/findandmodify_2.6.12 @@ -1,8 +1,8 @@ [ { - "ID": "3d52ee232b8c4e1068dd90741632614a", - "Namespace": "test.$cmd", - "Operation": "command", + "ID": "e8a3f05a4bd3f0bfa7d38eb2372258b1", + "Namespace": "test.coll", + "Operation": "FINDANDMODIFY", "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"findandmodify\":\"coll\",\"query\":{\"a\":2},\"update\":{\"$inc\":{\"b\":1}}},\"updateobj\":{\"$inc\":{\"b\":1}}}\n", "Fingerprint": "FINDANDMODIFY coll a", "FirstSeen": "2017-08-20T15:39:15.903Z", diff --git a/src/go/tests/expect/stats_single/findandmodify_3.0.15 b/src/go/tests/expect/stats_single/findandmodify_3.0.15 index 1c40b8fc..3eacc879 100755 --- a/src/go/tests/expect/stats_single/findandmodify_3.0.15 +++ b/src/go/tests/expect/stats_single/findandmodify_3.0.15 @@ -1,8 +1,8 @@ [ { - "ID": "3d52ee232b8c4e1068dd90741632614a", - "Namespace": "test.$cmd", - "Operation": "command", + "ID": "e8a3f05a4bd3f0bfa7d38eb2372258b1", + "Namespace": "test.coll", + "Operation": "FINDANDMODIFY", "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"findandmodify\":\"coll\",\"query\":{\"a\":2},\"update\":{\"$inc\":{\"b\":1}}},\"updateobj\":{\"$inc\":{\"b\":1}}}\n", "Fingerprint": "FINDANDMODIFY coll a", "FirstSeen": "2017-08-20T15:39:21.902Z", diff --git a/src/go/tests/expect/stats_single/findandmodify_3.2.16 b/src/go/tests/expect/stats_single/findandmodify_3.2.16 index e6d5143e..ef71024c 100755 --- a/src/go/tests/expect/stats_single/findandmodify_3.2.16 +++ b/src/go/tests/expect/stats_single/findandmodify_3.2.16 @@ -1,8 +1,8 @@ [ { - "ID": "9423eaa90c222686d092c04f001fb369", + "ID": "e8a3f05a4bd3f0bfa7d38eb2372258b1", "Namespace": "test.coll", - "Operation": "command", + "Operation": "FINDANDMODIFY", "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"findandmodify\":\"coll\",\"query\":{\"a\":2},\"update\":{\"$inc\":{\"b\":1}}},\"updateobj\":{\"$inc\":{\"b\":1}}}\n", "Fingerprint": "FINDANDMODIFY coll a", "FirstSeen": "2017-08-20T15:39:31.548Z", diff --git a/src/go/tests/expect/stats_single/findandmodify_3.4.7 b/src/go/tests/expect/stats_single/findandmodify_3.4.7 index 76565000..f351fd0e 100755 --- a/src/go/tests/expect/stats_single/findandmodify_3.4.7 +++ b/src/go/tests/expect/stats_single/findandmodify_3.4.7 @@ -1,8 +1,8 @@ [ { - "ID": "9423eaa90c222686d092c04f001fb369", + "ID": "e8a3f05a4bd3f0bfa7d38eb2372258b1", "Namespace": "test.coll", - "Operation": "command", + "Operation": "FINDANDMODIFY", "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"findandmodify\":\"coll\",\"query\":{\"a\":2},\"update\":{\"$inc\":{\"b\":1}}},\"updateobj\":{\"$inc\":{\"b\":1}}}\n", "Fingerprint": "FINDANDMODIFY coll a", "FirstSeen": "2017-08-20T15:39:38.196Z", diff --git a/src/go/tests/expect/stats_single/findandmodify_3.5.11 b/src/go/tests/expect/stats_single/findandmodify_3.5.11 index 15d8f9b6..ea893ea5 100755 --- a/src/go/tests/expect/stats_single/findandmodify_3.5.11 +++ b/src/go/tests/expect/stats_single/findandmodify_3.5.11 @@ -1,8 +1,8 @@ [ { - "ID": "9423eaa90c222686d092c04f001fb369", + "ID": "e8a3f05a4bd3f0bfa7d38eb2372258b1", "Namespace": "test.coll", - "Operation": "command", + "Operation": "FINDANDMODIFY", "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"findandmodify\":\"coll\",\"query\":{\"a\":2},\"update\":{\"$inc\":{\"b\":1}},\"$db\":\"test\"}}\n", "Fingerprint": "FINDANDMODIFY coll a", "FirstSeen": "2017-08-20T15:39:48.636Z", diff --git a/src/go/tests/expect/stats_single/geonear_2.6.12 b/src/go/tests/expect/stats_single/geonear_2.6.12 index c8552af3..1a7524ee 100755 --- a/src/go/tests/expect/stats_single/geonear_2.6.12 +++ b/src/go/tests/expect/stats_single/geonear_2.6.12 @@ -1,8 +1,8 @@ [ { - "ID": "eb3d8174e05f442cc5c3269eb50667d6", - "Namespace": "test.$cmd", - "Operation": "command", + "ID": "c70403cbd55ffbb07f08c0cb77a24b19", + "Namespace": "test.coll", + "Operation": "GEONEAR", "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"geoNear\":\"coll\",\"near\":{\"type\":\"Point\",\"coordinates\":[1,1]},\"spherical\":true}}\n", "Fingerprint": "GEONEAR coll", "FirstSeen": "2017-08-20T15:39:16.061Z", diff --git a/src/go/tests/expect/stats_single/geonear_3.0.15 b/src/go/tests/expect/stats_single/geonear_3.0.15 index 3ebbe6e5..9ffa1ebf 100755 --- a/src/go/tests/expect/stats_single/geonear_3.0.15 +++ b/src/go/tests/expect/stats_single/geonear_3.0.15 @@ -1,8 +1,8 @@ [ { - "ID": "eb3d8174e05f442cc5c3269eb50667d6", - "Namespace": "test.$cmd", - "Operation": "command", + "ID": "c70403cbd55ffbb07f08c0cb77a24b19", + "Namespace": "test.coll", + "Operation": "GEONEAR", "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"geoNear\":\"coll\",\"near\":{\"type\":\"Point\",\"coordinates\":[1,1]},\"spherical\":true}}\n", "Fingerprint": "GEONEAR coll", "FirstSeen": "2017-08-20T15:39:22.055Z", diff --git a/src/go/tests/expect/stats_single/geonear_3.2.16 b/src/go/tests/expect/stats_single/geonear_3.2.16 index 520db8ab..71ee8e92 100755 --- a/src/go/tests/expect/stats_single/geonear_3.2.16 +++ b/src/go/tests/expect/stats_single/geonear_3.2.16 @@ -1,8 +1,8 @@ [ { - "ID": "dd20c739baef5a3fd9352c350c7e69f1", + "ID": "c70403cbd55ffbb07f08c0cb77a24b19", "Namespace": "test.coll", - "Operation": "command", + "Operation": "GEONEAR", "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"geoNear\":\"coll\",\"near\":{\"type\":\"Point\",\"coordinates\":[1,1]},\"spherical\":true}}\n", "Fingerprint": "GEONEAR coll", "FirstSeen": "2017-08-20T15:39:31.797Z", diff --git a/src/go/tests/expect/stats_single/geonear_3.4.7 b/src/go/tests/expect/stats_single/geonear_3.4.7 index 15fdaf43..31383313 100755 --- a/src/go/tests/expect/stats_single/geonear_3.4.7 +++ b/src/go/tests/expect/stats_single/geonear_3.4.7 @@ -1,8 +1,8 @@ [ { - "ID": "dd20c739baef5a3fd9352c350c7e69f1", + "ID": "c70403cbd55ffbb07f08c0cb77a24b19", "Namespace": "test.coll", - "Operation": "command", + "Operation": "GEONEAR", "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"geoNear\":\"coll\",\"near\":{\"type\":\"Point\",\"coordinates\":[1,1]},\"spherical\":true}}\n", "Fingerprint": "GEONEAR coll", "FirstSeen": "2017-08-20T15:39:38.432Z", diff --git a/src/go/tests/expect/stats_single/geonear_3.5.11 b/src/go/tests/expect/stats_single/geonear_3.5.11 index 33edc9df..2e633102 100755 --- a/src/go/tests/expect/stats_single/geonear_3.5.11 +++ b/src/go/tests/expect/stats_single/geonear_3.5.11 @@ -1,8 +1,8 @@ [ { - "ID": "dd20c739baef5a3fd9352c350c7e69f1", + "ID": "c70403cbd55ffbb07f08c0cb77a24b19", "Namespace": "test.coll", - "Operation": "command", + "Operation": "GEONEAR", "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"geoNear\":\"coll\",\"near\":{\"type\":\"Point\",\"coordinates\":[1,1]},\"spherical\":true,\"$db\":\"test\"}}\n", "Fingerprint": "GEONEAR coll", "FirstSeen": "2017-08-20T15:39:48.842Z", diff --git a/src/go/tests/expect/stats_single/group_2.6.12 b/src/go/tests/expect/stats_single/group_2.6.12 index b3b28131..8c8ebe95 100755 --- a/src/go/tests/expect/stats_single/group_2.6.12 +++ b/src/go/tests/expect/stats_single/group_2.6.12 @@ -1,8 +1,8 @@ [ { - "ID": "225e5819de843c1779f1118f2f01b77e", - "Namespace": "test.$cmd", - "Operation": "command", + "ID": "ca8bb19386488570447f5753741fb494", + "Namespace": "test.coll", + "Operation": "GROUP", "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"group\":{\"key\":{\"a\":1,\"b\":1},\"cond\":{\"b\":3},\"initial\":{},\"ns\":\"coll\",\"$reduce\":\"\"}}}\n", "Fingerprint": "GROUP coll a,b", "FirstSeen": "2017-08-20T15:39:16.325Z", diff --git a/src/go/tests/expect/stats_single/group_3.0.15 b/src/go/tests/expect/stats_single/group_3.0.15 index a1e96670..8739ac60 100755 --- a/src/go/tests/expect/stats_single/group_3.0.15 +++ b/src/go/tests/expect/stats_single/group_3.0.15 @@ -1,8 +1,8 @@ [ { - "ID": "225e5819de843c1779f1118f2f01b77e", - "Namespace": "test.$cmd", - "Operation": "command", + "ID": "ca8bb19386488570447f5753741fb494", + "Namespace": "test.coll", + "Operation": "GROUP", "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"group\":{\"key\":{\"a\":1,\"b\":1},\"cond\":{\"b\":3},\"initial\":{},\"ns\":\"coll\",\"$reduce\":\"\"}}}\n", "Fingerprint": "GROUP coll a,b", "FirstSeen": "2017-08-20T15:39:22.271Z", diff --git a/src/go/tests/expect/stats_single/group_3.2.16 b/src/go/tests/expect/stats_single/group_3.2.16 index cbf45bf4..575c0fc2 100755 --- a/src/go/tests/expect/stats_single/group_3.2.16 +++ b/src/go/tests/expect/stats_single/group_3.2.16 @@ -1,8 +1,8 @@ [ { - "ID": "018a055f724d418b80e66b98bfdb25a5", + "ID": "ca8bb19386488570447f5753741fb494", "Namespace": "test.coll", - "Operation": "command", + "Operation": "GROUP", "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"group\":{\"key\":{\"a\":1,\"b\":1},\"cond\":{\"b\":3},\"initial\":{},\"ns\":\"coll\",\"$reduce\":\"\"}}}\n", "Fingerprint": "GROUP coll a,b", "FirstSeen": "2017-08-20T15:39:32.101Z", diff --git a/src/go/tests/expect/stats_single/group_3.4.7 b/src/go/tests/expect/stats_single/group_3.4.7 index d1c8e3d8..efc8b21a 100755 --- a/src/go/tests/expect/stats_single/group_3.4.7 +++ b/src/go/tests/expect/stats_single/group_3.4.7 @@ -1,8 +1,8 @@ [ { - "ID": "018a055f724d418b80e66b98bfdb25a5", + "ID": "ca8bb19386488570447f5753741fb494", "Namespace": "test.coll", - "Operation": "command", + "Operation": "GROUP", "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"group\":{\"key\":{\"a\":1,\"b\":1},\"cond\":{\"b\":3},\"initial\":{},\"ns\":\"coll\",\"$reduce\":{\"code\":\"function () {}\"}}}}\n", "Fingerprint": "GROUP coll a,b", "FirstSeen": "2017-08-20T15:39:38.886Z", diff --git a/src/go/tests/expect/stats_single/group_3.5.11 b/src/go/tests/expect/stats_single/group_3.5.11 index 2d91c5f9..7557127d 100755 --- a/src/go/tests/expect/stats_single/group_3.5.11 +++ b/src/go/tests/expect/stats_single/group_3.5.11 @@ -1,8 +1,8 @@ [ { - "ID": "018a055f724d418b80e66b98bfdb25a5", + "ID": "ca8bb19386488570447f5753741fb494", "Namespace": "test.coll", - "Operation": "command", + "Operation": "GROUP", "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"group\":{\"key\":{\"a\":1,\"b\":1},\"cond\":{\"b\":3},\"initial\":{},\"ns\":\"coll\",\"$reduce\":{\"code\":\"function () {}\"}},\"$db\":\"test\"}}\n", "Fingerprint": "GROUP coll a,b", "FirstSeen": "2017-08-20T15:39:49.276Z", diff --git a/src/go/tests/expect/stats_single/insert_2.6.12 b/src/go/tests/expect/stats_single/insert_2.6.12 index 58dc5cbb..b22129d6 100755 --- a/src/go/tests/expect/stats_single/insert_2.6.12 +++ b/src/go/tests/expect/stats_single/insert_2.6.12 @@ -1,8 +1,8 @@ [ { - "ID": "a7ce8dee16beadb767484112e6b29af3", + "ID": "e357abe482dcc0cd03ab742741bf1c86", "Namespace": "test.coll", - "Operation": "insert", + "Operation": "INSERT", "Query": "{\"ns\":\"test.coll\",\"op\":\"insert\",\"query\":{\"_id\":1}}\n", "Fingerprint": "INSERT coll", "FirstSeen": "2017-08-20T15:39:16.473Z", diff --git a/src/go/tests/expect/stats_single/insert_3.0.15 b/src/go/tests/expect/stats_single/insert_3.0.15 index 24de4102..4bd31117 100755 --- a/src/go/tests/expect/stats_single/insert_3.0.15 +++ b/src/go/tests/expect/stats_single/insert_3.0.15 @@ -1,8 +1,8 @@ [ { - "ID": "a7ce8dee16beadb767484112e6b29af3", + "ID": "e357abe482dcc0cd03ab742741bf1c86", "Namespace": "test.coll", - "Operation": "insert", + "Operation": "INSERT", "Query": "{\"ns\":\"test.coll\",\"op\":\"insert\",\"query\":{\"_id\":1}}\n", "Fingerprint": "INSERT coll", "FirstSeen": "2017-08-20T15:39:22.409Z", diff --git a/src/go/tests/expect/stats_single/insert_3.2.16 b/src/go/tests/expect/stats_single/insert_3.2.16 index 4bf55eda..8a9c8fbd 100755 --- a/src/go/tests/expect/stats_single/insert_3.2.16 +++ b/src/go/tests/expect/stats_single/insert_3.2.16 @@ -1,8 +1,8 @@ [ { - "ID": "a7ce8dee16beadb767484112e6b29af3", + "ID": "e357abe482dcc0cd03ab742741bf1c86", "Namespace": "test.coll", - "Operation": "insert", + "Operation": "INSERT", "Query": "{\"ns\":\"test.coll\",\"op\":\"insert\",\"query\":{\"insert\":\"coll\",\"documents\":[{\"_id\":1}],\"ordered\":true}}\n", "Fingerprint": "INSERT coll", "FirstSeen": "2017-08-20T15:39:32.303Z", diff --git a/src/go/tests/expect/stats_single/insert_3.4.7 b/src/go/tests/expect/stats_single/insert_3.4.7 index e7fafcae..b9b96883 100755 --- a/src/go/tests/expect/stats_single/insert_3.4.7 +++ b/src/go/tests/expect/stats_single/insert_3.4.7 @@ -1,8 +1,8 @@ [ { - "ID": "a7ce8dee16beadb767484112e6b29af3", + "ID": "e357abe482dcc0cd03ab742741bf1c86", "Namespace": "test.coll", - "Operation": "insert", + "Operation": "INSERT", "Query": "{\"ns\":\"test.coll\",\"op\":\"insert\",\"query\":{\"insert\":\"coll\",\"documents\":[{\"_id\":1}],\"ordered\":true}}\n", "Fingerprint": "INSERT coll", "FirstSeen": "2017-08-20T15:39:39.023Z", diff --git a/src/go/tests/expect/stats_single/insert_3.5.11 b/src/go/tests/expect/stats_single/insert_3.5.11 index 869e234c..883aab28 100755 --- a/src/go/tests/expect/stats_single/insert_3.5.11 +++ b/src/go/tests/expect/stats_single/insert_3.5.11 @@ -1,8 +1,8 @@ [ { - "ID": "a7ce8dee16beadb767484112e6b29af3", + "ID": "e357abe482dcc0cd03ab742741bf1c86", "Namespace": "test.coll", - "Operation": "insert", + "Operation": "INSERT", "Query": "{\"ns\":\"test.coll\",\"op\":\"insert\",\"command\":{\"insert\":\"coll\",\"ordered\":true,\"$db\":\"test\"}}\n", "Fingerprint": "INSERT coll", "FirstSeen": "2017-08-20T15:39:49.44Z", diff --git a/src/go/tests/expect/stats_single/mapreduce_2.6.12 b/src/go/tests/expect/stats_single/mapreduce_2.6.12 index 13c867a4..6fb663ec 100755 --- a/src/go/tests/expect/stats_single/mapreduce_2.6.12 +++ b/src/go/tests/expect/stats_single/mapreduce_2.6.12 @@ -1,8 +1,8 @@ [ { - "ID": "23ca094f285d0cd9538fb1b1f6ef0f4f", - "Namespace": "test.$cmd", - "Operation": "command", + "ID": "cc3cb3824eea4094eb042f5ca76bd385", + "Namespace": "test.coll", + "Operation": "MAPREDUCE", "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"mapreduce\":\"coll\",\"map\":\"\",\"reduce\":\"\",\"query\":{\"a\":{\"$gte\":0}},\"out\":{\"inline\":1}}}\n", "Fingerprint": "MAPREDUCE coll a", "FirstSeen": "2017-08-20T15:39:16.701Z", diff --git a/src/go/tests/expect/stats_single/mapreduce_3.0.15 b/src/go/tests/expect/stats_single/mapreduce_3.0.15 index 8b81c024..6e511a93 100755 --- a/src/go/tests/expect/stats_single/mapreduce_3.0.15 +++ b/src/go/tests/expect/stats_single/mapreduce_3.0.15 @@ -1,8 +1,8 @@ [ { - "ID": "23ca094f285d0cd9538fb1b1f6ef0f4f", - "Namespace": "test.$cmd", - "Operation": "command", + "ID": "cc3cb3824eea4094eb042f5ca76bd385", + "Namespace": "test.coll", + "Operation": "MAPREDUCE", "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"mapreduce\":\"coll\",\"map\":\"\",\"reduce\":\"\",\"query\":{\"a\":{\"$gte\":0}},\"out\":{\"inline\":1}}}\n", "Fingerprint": "MAPREDUCE coll a", "FirstSeen": "2017-08-20T15:39:22.582Z", diff --git a/src/go/tests/expect/stats_single/mapreduce_3.2.16 b/src/go/tests/expect/stats_single/mapreduce_3.2.16 index c61f9205..c4da8735 100755 --- a/src/go/tests/expect/stats_single/mapreduce_3.2.16 +++ b/src/go/tests/expect/stats_single/mapreduce_3.2.16 @@ -1,8 +1,8 @@ [ { - "ID": "130827f5b7afe1369f619ccd5cd61ec4", + "ID": "cc3cb3824eea4094eb042f5ca76bd385", "Namespace": "test.coll", - "Operation": "command", + "Operation": "MAPREDUCE", "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"mapreduce\":\"coll\",\"map\":\"\",\"reduce\":\"\",\"query\":{\"a\":{\"$gte\":0}},\"out\":{\"inline\":1}}}\n", "Fingerprint": "MAPREDUCE coll a", "FirstSeen": "2017-08-20T15:39:32.572Z", diff --git a/src/go/tests/expect/stats_single/mapreduce_3.4.7 b/src/go/tests/expect/stats_single/mapreduce_3.4.7 index 15ca2d6c..b49e4a28 100755 --- a/src/go/tests/expect/stats_single/mapreduce_3.4.7 +++ b/src/go/tests/expect/stats_single/mapreduce_3.4.7 @@ -1,8 +1,8 @@ [ { - "ID": "130827f5b7afe1369f619ccd5cd61ec4", + "ID": "cc3cb3824eea4094eb042f5ca76bd385", "Namespace": "test.coll", - "Operation": "command", + "Operation": "MAPREDUCE", "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"mapreduce\":\"coll\",\"map\":{\"code\":\"function () {\\n emit(this.a, this.b);\\n}\"},\"reduce\":{\"code\":\"function (a, b) {\\n return Array.sum(b);\\n}\"},\"query\":{\"a\":{\"$gte\":0}},\"out\":{\"inline\":1}}}\n", "Fingerprint": "MAPREDUCE coll a", "FirstSeen": "2017-08-20T15:39:39.249Z", diff --git a/src/go/tests/expect/stats_single/mapreduce_3.5.11 b/src/go/tests/expect/stats_single/mapreduce_3.5.11 index 5c88a2d6..b1d0f7da 100755 --- a/src/go/tests/expect/stats_single/mapreduce_3.5.11 +++ b/src/go/tests/expect/stats_single/mapreduce_3.5.11 @@ -1,8 +1,8 @@ [ { - "ID": "130827f5b7afe1369f619ccd5cd61ec4", + "ID": "cc3cb3824eea4094eb042f5ca76bd385", "Namespace": "test.coll", - "Operation": "command", + "Operation": "MAPREDUCE", "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"mapreduce\":\"coll\",\"map\":{\"code\":\"function () {\\n emit(this.a, this.b);\\n}\"},\"reduce\":{\"code\":\"function (a, b) {\\n return Array.sum(b);\\n}\"},\"query\":{\"a\":{\"$gte\":0}},\"out\":{\"inline\":1},\"$db\":\"test\"}}\n", "Fingerprint": "MAPREDUCE coll a", "FirstSeen": "2017-08-20T15:39:49.68Z", diff --git a/src/go/tests/expect/stats_single/update_2.6.12 b/src/go/tests/expect/stats_single/update_2.6.12 index 479a30dd..37b6e372 100755 --- a/src/go/tests/expect/stats_single/update_2.6.12 +++ b/src/go/tests/expect/stats_single/update_2.6.12 @@ -1,8 +1,8 @@ [ { - "ID": "27cb39e62745b1ff4121b4bf6f21fb12", + "ID": "f74a5120ac22d02120ccbf6d478b0dbc", "Namespace": "test.coll", - "Operation": "update", + "Operation": "UPDATE", "Query": "{\"ns\":\"test.coll\",\"op\":\"update\",\"query\":{\"a\":{\"$gte\":2}},\"updateobj\":{\"$set\":{\"c\":1},\"$inc\":{\"a\":-10}}}\n", "Fingerprint": "UPDATE coll a", "FirstSeen": "2017-08-20T15:39:16.921Z", diff --git a/src/go/tests/expect/stats_single/update_3.0.15 b/src/go/tests/expect/stats_single/update_3.0.15 index e55186a7..24c232fb 100755 --- a/src/go/tests/expect/stats_single/update_3.0.15 +++ b/src/go/tests/expect/stats_single/update_3.0.15 @@ -1,8 +1,8 @@ [ { - "ID": "27cb39e62745b1ff4121b4bf6f21fb12", + "ID": "f74a5120ac22d02120ccbf6d478b0dbc", "Namespace": "test.coll", - "Operation": "update", + "Operation": "UPDATE", "Query": "{\"ns\":\"test.coll\",\"op\":\"update\",\"query\":{\"a\":{\"$gte\":2}},\"updateobj\":{\"$set\":{\"c\":1},\"$inc\":{\"a\":-10}}}\n", "Fingerprint": "UPDATE coll a", "FirstSeen": "2017-08-20T15:39:22.788Z", diff --git a/src/go/tests/expect/stats_single/update_3.2.16 b/src/go/tests/expect/stats_single/update_3.2.16 index dd8c4e4b..dad030bc 100755 --- a/src/go/tests/expect/stats_single/update_3.2.16 +++ b/src/go/tests/expect/stats_single/update_3.2.16 @@ -1,8 +1,8 @@ [ { - "ID": "27cb39e62745b1ff4121b4bf6f21fb12", + "ID": "f74a5120ac22d02120ccbf6d478b0dbc", "Namespace": "test.coll", - "Operation": "update", + "Operation": "UPDATE", "Query": "{\"ns\":\"test.coll\",\"op\":\"update\",\"query\":{\"a\":{\"$gte\":2}},\"updateobj\":{\"$set\":{\"c\":1},\"$inc\":{\"a\":-10}}}\n", "Fingerprint": "UPDATE coll a", "FirstSeen": "2017-08-20T15:39:32.737Z", diff --git a/src/go/tests/expect/stats_single/update_3.4.7 b/src/go/tests/expect/stats_single/update_3.4.7 index cd7a0257..f0d5f8d9 100755 --- a/src/go/tests/expect/stats_single/update_3.4.7 +++ b/src/go/tests/expect/stats_single/update_3.4.7 @@ -1,8 +1,8 @@ [ { - "ID": "27cb39e62745b1ff4121b4bf6f21fb12", + "ID": "f74a5120ac22d02120ccbf6d478b0dbc", "Namespace": "test.coll", - "Operation": "update", + "Operation": "UPDATE", "Query": "{\"ns\":\"test.coll\",\"op\":\"update\",\"query\":{\"a\":{\"$gte\":2}},\"updateobj\":{\"$set\":{\"c\":1},\"$inc\":{\"a\":-10}}}\n", "Fingerprint": "UPDATE coll a", "FirstSeen": "2017-08-20T15:39:39.434Z", diff --git a/src/go/tests/expect/stats_single/update_3.5.11 b/src/go/tests/expect/stats_single/update_3.5.11 index e389f127..06acdb1a 100755 --- a/src/go/tests/expect/stats_single/update_3.5.11 +++ b/src/go/tests/expect/stats_single/update_3.5.11 @@ -1,8 +1,8 @@ [ { - "ID": "27cb39e62745b1ff4121b4bf6f21fb12", + "ID": "f74a5120ac22d02120ccbf6d478b0dbc", "Namespace": "test.coll", - "Operation": "update", + "Operation": "UPDATE", "Query": "{\"ns\":\"test.coll\",\"op\":\"update\",\"command\":{\"q\":{\"a\":{\"$gte\":2}},\"u\":{\"$set\":{\"c\":1},\"$inc\":{\"a\":-10}},\"multi\":false,\"upsert\":false}}\n", "Fingerprint": "UPDATE coll a", "FirstSeen": "2017-08-20T15:39:49.855Z", diff --git a/src/go/tests/profiler_docs_stats.want.json b/src/go/tests/profiler_docs_stats.want.json index af2d1b71..d54aec25 100644 --- a/src/go/tests/profiler_docs_stats.want.json +++ b/src/go/tests/profiler_docs_stats.want.json @@ -1,8 +1,8 @@ [ { - "ID": "16196765fb4c14edb91efdbe4f5c5973", + "ID": "95575e896c2830043dc333cb8ee61339", "Namespace": "samples.col1", - "Operation": "query", + "Operation": "FIND", "Query": "{\"ns\":\"samples.col1\",\"op\":\"query\",\"query\":{\"find\":\"col1\",\"shardVersion\":[0,\"000000000000000000000000\"]}}\n", "Fingerprint": "FIND col1 find", "FirstSeen": "2017-04-10T13:16:23.29-03:00", @@ -53,9 +53,9 @@ } }, { - "ID": "4e4774ad26f934a193757002a991ebb8", + "ID": "d7088d6b50551d1f2f5f34b006c0140d", "Namespace": "samples.col1", - "Operation": "query", + "Operation": "FIND", "Query": "{\"ns\":\"samples.col1\",\"op\":\"query\",\"query\":{\"find\":\"col1\",\"filter\":{\"s2\":{\"$gte\":\"41991\",\"$lt\":\"33754\"}},\"shardVersion\":[0,\"000000000000000000000000\"]}}\n", "Fingerprint": "FIND col1 s2", "FirstSeen": "2017-04-10T13:15:53.532-03:00", @@ -106,9 +106,9 @@ } }, { - "ID": "8cb8666ace7e54767b4d3c4f61860cf9", + "ID": "b4b7a063b3afbcbdf042a0f0f9e48a9d", "Namespace": "samples.col1", - "Operation": "query", + "Operation": "FIND", "Query": "{\"ns\":\"samples.col1\",\"op\":\"query\",\"query\":{\"find\":\"col1\",\"filter\":{\"user_id\":{\"$gte\":3.384024924e+09,\"$lt\":1.95092007e+08}},\"projection\":{\"$sortKey\":{\"$meta\":\"sortKey\"}},\"shardVersion\":[0,\"000000000000000000000000\"],\"sort\":{\"user_id\":1}}}\n", "Fingerprint": "FIND col1 user_id", "FirstSeen": "2017-04-10T13:15:53.524-03:00", From b2a08caaa72f342d70e4fbb5a507a6ee191ca178 Mon Sep 17 00:00:00 2001 From: Kamil Dziedzic Date: Sat, 14 Oct 2017 20:26:52 +0200 Subject: [PATCH 091/104] fix fingerprint, and drop queries since they differe between versions --- src/go/mongolib/util/util.go | 5 +++++ src/go/pt-mongodb-query-digest/main_test.go | 21 +++------------------ 2 files changed, 8 insertions(+), 18 deletions(-) diff --git a/src/go/mongolib/util/util.go b/src/go/mongolib/util/util.go index 313ca47b..dd30ec8b 100644 --- a/src/go/mongolib/util/util.go +++ b/src/go/mongolib/util/util.go @@ -332,5 +332,10 @@ func GetQueryField(doc proto.SystemProfile) (bson.M, error) { return nil, CANNOT_GET_QUERY_ERROR } + // {"ns":"test.system.js","op":"query","query":{"find":"system.js"}} + if len(query) == 1 && query[0].Name == "find" { + return bson.M{}, nil + } + return query.Map(), nil } diff --git a/src/go/pt-mongodb-query-digest/main_test.go b/src/go/pt-mongodb-query-digest/main_test.go index bc186b44..9b82e826 100644 --- a/src/go/pt-mongodb-query-digest/main_test.go +++ b/src/go/pt-mongodb-query-digest/main_test.go @@ -305,105 +305,90 @@ Skipping profiled queries on these collections: \[system\.profile\] Namespace: "test.coll", Operation: "INSERT", Fingerprint: "INSERT coll", - Query: `{"ns":"test.coll","op":"insert","query":{"insert":"coll","documents":\[{"_id":{"\$oid":".*"},"a":9}\],"ordered":true}}`, }, { ID: "c9b40ce564762834d12b0390a292645c", Namespace: "test.coll", Operation: "DROP", Fingerprint: "DROP coll drop", - Query: `{"ns":"test.coll","op":"command","command":{"drop":"coll"}}`, }, { ID: "e72ad41302045bd6c2bcad76511f915a", Namespace: "test.coll", Operation: "REMOVE", Fingerprint: "REMOVE coll a,b", - Query: regexp.QuoteMeta(`{"ns":"test.coll","op":"remove","query":{"a":{"$gte":2},"b":{"$gte":2}}}`), }, { ID: "30dbfbc89efd8cfd40774dff0266a28f", Namespace: "test.coll", Operation: "AGGREGATE", Fingerprint: "AGGREGATE coll a", - Query: regexp.QuoteMeta(`{"ns":"test.coll","op":"command","command":{"aggregate":"coll","pipeline":[{"$match":{"a":{"$gte":2}}}],"cursor":{}}}`), }, { ID: "e4122a58c99ab0a4020ce7d195c5a8cb", Namespace: "test.coll", Operation: "DISTINCT", Fingerprint: "DISTINCT coll a,b", - Query: regexp.QuoteMeta(`{"ns":"test.coll","op":"command","command":{"distinct":"coll","key":"a","query":{"b":{"$gte":5}}}}`), }, { ID: "a6782ae38ef891d5506341a4b0ab2747", Namespace: "test", Operation: "EVAL", Fingerprint: "EVAL", - Query: regexp.QuoteMeta(`{"ns":"test","op":"command","command":{"$eval":"db"}}`), }, { ID: "76d7662df07b44135ac3e07e44a6eb39", Namespace: "", Operation: "EXPLAIN", Fingerprint: "EXPLAIN", - Query: `{"ns":"test.coll","op":"command","command":{"explain":{"find":"coll","filter":{}},"verbosity":"queryPlanner"}}`, }, { ID: "e8a3f05a4bd3f0bfa7d38eb2372258b1", Namespace: "test.coll", Operation: "FINDANDMODIFY", Fingerprint: "FINDANDMODIFY coll a", - Query: regexp.QuoteMeta(`{"ns":"test.coll","op":"command","command":{"findandmodify":"coll","query":{"a":2},"update":{"$inc":{"b":1}}},"updateobj":{"$inc":{"b":1}}}`), }, { - ID: "67c5f1bafcb8cd4b3af9f008f496f74b", + ID: "798d7c1cd25b63cb6a307126a25910d6", Namespace: "test.system.js", Operation: "FIND", - Fingerprint: "FIND system.js find", - Query: `{"ns":"test.system.js","op":"query","query":{"find":"system.js"}}`, + Fingerprint: "FIND system.js", }, { ID: "c70403cbd55ffbb07f08c0cb77a24b19", Namespace: "test.coll", Operation: "GEONEAR", Fingerprint: "GEONEAR coll", - Query: regexp.QuoteMeta(`{"ns":"test.coll","op":"command","command":{"geoNear":"coll","near":{"type":"Point","coordinates":[1,1]},"spherical":true}}`), }, { ID: "ca8bb19386488570447f5753741fb494", Namespace: "test.coll", Operation: "GROUP", Fingerprint: "GROUP coll a,b", - Query: regexp.QuoteMeta(`{"ns":"test.coll","op":"command","command":{"group":{"key":{"a":1,"b":1},"cond":{"b":3},"initial":{},"ns":"coll","$reduce":{"Code":"function () {}","Scope":null}}}}`), }, { ID: "10b8f47b366fbfd1fb01f8d17d75b1a2", Namespace: "test.coll", Operation: "COUNT", Fingerprint: "COUNT coll a", - Query: regexp.QuoteMeta(`{"ns":"test.coll","op":"command","command":{"count":"coll","query":{"a":{"$gt":5}},"fields":{}}}`), }, { ID: "cc3cb3824eea4094eb042f5ca76bd385", Namespace: "test.coll", Operation: "MAPREDUCE", Fingerprint: "MAPREDUCE coll a", - Query: regexp.QuoteMeta(`{"ns":"test.coll","op":"command","command":{"mapreduce":"coll","map":{"Code":"function () {\n emit(this.a, this.b);\n}","Scope":null},"reduce":{"Code":"function (a, b) {\n return Array.sum(b);\n}","Scope":null},"query":{"a":{"$gte":0}},"out":{"inline":1}}}`), }, { ID: "cba2dff0740762c6e5769f0e300df676", Namespace: "test.coll", Operation: "COUNT", Fingerprint: "COUNT coll", - Query: `{"ns":"test.coll","op":"command","command":{"count":"coll","query":{},"fields":{}}}`, }, { ID: "f74a5120ac22d02120ccbf6d478b0dbc", Namespace: "test.coll", Operation: "UPDATE", Fingerprint: "UPDATE coll a", - Query: regexp.QuoteMeta(`{"ns":"test.coll","op":"update","query":{"a":{"$gte":2}},"updateobj":{"$set":{"c":1},"$inc":{"a":-10}}}`), }, } @@ -422,7 +407,7 @@ Skipping profiled queries on these collections: \[system\.profile\] # Namespace {{.Namespace}} # Operation {{.Operation}} # Fingerprint {{.Fingerprint}} -# Query {{.Query}} +# Query .* ` From a2650602a04984b3a32268cb3608818498bd0b50 Mon Sep 17 00:00:00 2001 From: Kamil Dziedzic Date: Sat, 14 Oct 2017 20:32:29 +0200 Subject: [PATCH 092/104] drop MongoDB 2.6; it works, but generates some noisy queries --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 6c558257..aa3021cb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,7 +11,6 @@ services: env: matrix: - - MONGODB_IMAGE=mongo:2.6 - MONGODB_IMAGE=mongo:3.0 - MONGODB_IMAGE=mongo:3.2 - MONGODB_IMAGE=mongo:3.4 From fab9ad211724068921833d764c64e86154b22267 Mon Sep 17 00:00:00 2001 From: Kamil Dziedzic Date: Sat, 14 Oct 2017 20:39:29 +0200 Subject: [PATCH 093/104] rever updating vendor dir --- glide.lock | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/glide.lock b/glide.lock index 529dd93f..3d8c6b1e 100644 --- a/glide.lock +++ b/glide.lock @@ -4,11 +4,11 @@ imports: - name: github.com/bradfitz/slice version: d9036e2120b5ddfa53f3ebccd618c4af275f47da - name: github.com/go-ole/go-ole - version: 085abb85892dc1949567b726dff00fa226c60c45 + version: 02d3668a0cf01f58411cc85cd37c174c257ec7c2 subpackages: - oleutil - name: github.com/golang/mock - version: 18f6dd13ccdd227b8ebc546ca95cd62a02f3970c + version: 93f6609a15b7de76bd49259f1f9a6b58df358936 subpackages: - gomock - name: github.com/hashicorp/go-version @@ -20,7 +20,7 @@ imports: - name: github.com/Masterminds/semver version: 517734cc7d6470c0d07130e40fd40bdeb9bcd3fd - name: github.com/montanaflynn/stats - version: 4a163274fa4ca0b524ccee24757d7bec79475aca + version: 41c34e4914ec3c05d485e564d9028d8861d5d9ad - name: github.com/pborman/getopt version: 7148bc3a4c3008adfcab60cbebfd0576018f330b subpackages: @@ -34,7 +34,7 @@ imports: - name: github.com/satori/go.uuid version: 5bf94b69c6b68ee1b541973bb8e1144db23a194b - name: github.com/shirou/gopsutil - version: a452de7c734a0fa0f16d2e5725b0fa5934d9fbec + version: 09e98597147f04686f71603d5525627cd066701d subpackages: - cpu - host @@ -53,15 +53,15 @@ imports: subpackages: - reflectutil - name: golang.org/x/crypto - version: 81e90905daefcd6fd217b62423c0908922eadb30 + version: 3627ff35f31987174dbee61d9d1dcc1c643e7174 subpackages: - ssh/terminal - name: golang.org/x/net - version: 1c05540f6879653db88113bc4a2b70aec4bd491f + version: 054b33e6527139ad5b1ec2f6232c3b175bd9a30c subpackages: - context - name: golang.org/x/sys - version: bb24a47a89eac6c1227fbcb2ae37a8b9ed323366 + version: abf9c25f54453410d0c6668e519582a9e1115027 subpackages: - unix - windows From 8bbb9058daa4f17954ad1bbb5508853e2907c218 Mon Sep 17 00:00:00 2001 From: Kamil Dziedzic Date: Sat, 14 Oct 2017 21:39:24 +0200 Subject: [PATCH 094/104] use docker mongo --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index aa3021cb..b626bf9c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,7 +37,7 @@ before_script: - docker-compose --version - docker-compose exec mongo mongo --version # we need at least one document in test db - - mongo --eval 'db.init.insert({})' + - docker-compose exec mongo --eval 'db.init.insert({})' script: - go test -timeout 1m $(glide nv) From 24eff6d4e7991e94fe3d096e278f55a9677d85e5 Mon Sep 17 00:00:00 2001 From: Kamil Dziedzic Date: Sat, 14 Oct 2017 22:01:12 +0200 Subject: [PATCH 095/104] speed up test --- src/go/pt-mongodb-query-digest/main_test.go | 53 +++++++++++---------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/src/go/pt-mongodb-query-digest/main_test.go b/src/go/pt-mongodb-query-digest/main_test.go index 9b82e826..474c4bce 100644 --- a/src/go/pt-mongodb-query-digest/main_test.go +++ b/src/go/pt-mongodb-query-digest/main_test.go @@ -259,11 +259,13 @@ func testAllOperationsTemplate(t *testing.T, data Data) { t.Fatalf("cannot list samples: %s", err) } + fs := []string{} for _, file := range files { - err := run(dir + file.Name()) - if err != nil { - t.Fatalf("cannot execute query '%s': %s", dir+file.Name(), err) - } + fs = append(fs, dir+file.Name()) + } + err = run(fs...) + if err != nil { + t.Fatalf("cannot execute queries: %s", err) } // disable profiling so pt-mongodb-query digest reads rows from `system.profile` @@ -280,25 +282,6 @@ func testAllOperationsTemplate(t *testing.T, data Data) { t.Error(err) } - expected := `Profiler is disabled for the "test" database but there are 125 documents in the system.profile collection. -Using those documents for the stats -pt-mongodb-query-digest .+ -Host: ` + data.url + ` -Skipping profiled queries on these collections: \[system\.profile\] - - -# Totals -# Ratio [0-9\.]+ \(docs scanned/returned\) -# Attribute pct total min max avg 95% stddev median -# ================== === ======== ======== ======== ======== ======== ======= ======== -# Count \(docs\) 125\s -# Exec Time ms (\s*[0-9]+){8}\s -# Docs Scanned (\s*[0-9\.]+){8}\s -# Docs Returned (\s*[0-9\.]+){8}\s -# Bytes sent (\s*[0-9\.K]+){8}(K|\s) -#\s -` - queries := []stats.QueryStats{ { ID: "e357abe482dcc0cd03ab742741bf1c86", @@ -392,6 +375,25 @@ Skipping profiled queries on these collections: \[system\.profile\] }, } + expected := `Profiler is disabled for the "test" database but there are 125 documents in the system.profile collection. +Using those documents for the stats +pt-mongodb-query-digest .+ +Host: ` + data.url + ` +Skipping profiled queries on these collections: \[system\.profile\] + + +# Totals +# Ratio [0-9\.]+ \(docs scanned/returned\) +# Attribute pct total min max avg 95% stddev median +# ================== === ======== ======== ======== ======== ======== ======= ======== +# Count \(docs\) 125\s +# Exec Time ms (\s*[0-9]+){8}\s +# Docs Scanned (\s*[0-9\.]+){8}\s +# Docs Returned (\s*[0-9\.]+){8}\s +# Bytes sent (\s*[0-9\.K]+){8}(K|\s) +#\s +` + queryTpl := ` # Query [0-9]+: [0-9\.]+ QPS, ID {{.ID}} # Ratio [0-9\.]+ \(docs scanned/returned\) @@ -467,9 +469,8 @@ func assertRegexpLines(t *testing.T, rx string, str string, msgAndArgs ...interf } } -func run(filename string) error { +func run(arg ...string) error { ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) defer cancel() - return exec.CommandContext(ctx, "mongo", filename).Run() - + return exec.CommandContext(ctx, "mongo", arg...).Run() } From 9df5aac596611a74b261c353f49ec0cd80481c33 Mon Sep 17 00:00:00 2001 From: Kamil Dziedzic Date: Sat, 14 Oct 2017 22:18:44 +0200 Subject: [PATCH 096/104] fix cmd --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index b626bf9c..4851ddfb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,7 +37,7 @@ before_script: - docker-compose --version - docker-compose exec mongo mongo --version # we need at least one document in test db - - docker-compose exec mongo --eval 'db.init.insert({})' + - docker-compose exec mongo mongo --eval 'db.init.insert({})' script: - go test -timeout 1m $(glide nv) From 6ada40b35885b2d325c5d54d09a8348a097ec6ce Mon Sep 17 00:00:00 2001 From: Kamil Dziedzic Date: Sat, 14 Oct 2017 22:19:54 +0200 Subject: [PATCH 097/104] use go 1.9 by default --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4851ddfb..4f4e030b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ sudo: required language: go go: - - 1.8.x + - 1.9.x services: - docker @@ -20,7 +20,7 @@ env: matrix: include: - - go: 1.9.x + - go: 1.8.x env: - go: tip env: From 9b07eac00274ecce6b83f5912b6357c1d27e9bb7 Mon Sep 17 00:00:00 2001 From: Kamil Dziedzic Date: Sat, 14 Oct 2017 22:32:29 +0200 Subject: [PATCH 098/104] try to drop some info --- .travis.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4f4e030b..41181720 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,3 @@ -dist: trusty -sudo: required - language: go go: From 8cf08fd882d1a8f8b3d6186fb3d9393a83e16bcb Mon Sep 17 00:00:00 2001 From: Kamil Dziedzic Date: Sun, 15 Oct 2017 04:14:21 +0200 Subject: [PATCH 099/104] support getmore; support find with sort; cleanups --- src/go/lib/tutil/util.go | 4 + src/go/mongolib/explain/explain_test.go | 9 + .../mongolib/fingerprinter/fingerprinter.go | 14 +- .../fingerprinter/fingerprinter_test.go | 25 +- src/go/mongolib/proto/system.profile.go | 57 +- src/go/mongolib/util/util.go | 34 -- src/go/pt-mongodb-query-digest/main.go | 3 +- src/go/pt-mongodb-query-digest/main_test.go | 55 +- src/go/tests/doc/out/aggregate_2.6.12 | 8 +- src/go/tests/doc/out/aggregate_3.0.15 | 4 +- src/go/tests/doc/out/aggregate_3.2.16 | 4 +- src/go/tests/doc/out/aggregate_3.4.7 | 2 +- src/go/tests/doc/out/aggregate_3.5.11 | 2 +- src/go/tests/doc/out/count_2.6.12 | 8 +- src/go/tests/doc/out/count_3.0.15 | 2 +- src/go/tests/doc/out/count_3.2.16 | 2 +- src/go/tests/doc/out/count_3.4.7 | 4 +- src/go/tests/doc/out/count_3.5.11 | 4 +- src/go/tests/doc/out/count_with_query_2.6.12 | 8 +- src/go/tests/doc/out/count_with_query_3.0.15 | 2 +- src/go/tests/doc/out/count_with_query_3.2.16 | 2 +- src/go/tests/doc/out/count_with_query_3.4.7 | 54 +- src/go/tests/doc/out/count_with_query_3.5.11 | 54 +- src/go/tests/doc/out/delete_2.6.12 | 6 +- src/go/tests/doc/out/delete_3.0.15 | 2 +- src/go/tests/doc/out/delete_3.2.16 | 2 +- src/go/tests/doc/out/delete_3.4.7 | 24 +- src/go/tests/doc/out/delete_3.5.11 | 26 +- src/go/tests/doc/out/delete_all_2.6.12 | 8 +- src/go/tests/doc/out/delete_all_3.0.15 | 8 +- src/go/tests/doc/out/delete_all_3.2.16 | 6 +- src/go/tests/doc/out/delete_all_3.4.7 | 44 +- src/go/tests/doc/out/delete_all_3.5.11 | 46 +- src/go/tests/doc/out/distinct_2.6.12 | 10 +- src/go/tests/doc/out/distinct_3.0.15 | 4 +- src/go/tests/doc/out/distinct_3.2.16 | 4 +- src/go/tests/doc/out/distinct_3.4.7 | 24 +- src/go/tests/doc/out/distinct_3.5.11 | 24 +- src/go/tests/doc/out/eval_2.6.12 | 14 +- src/go/tests/doc/out/eval_3.0.15 | 8 +- src/go/tests/doc/out/eval_3.2.16 | 8 +- src/go/tests/doc/out/eval_3.4.7 | 8 +- src/go/tests/doc/out/eval_3.5.11 | 8 +- src/go/tests/doc/out/explain_2.6.12 | 18 +- src/go/tests/doc/out/explain_3.0.15 | 2 +- src/go/tests/doc/out/explain_3.2.16 | 2 +- src/go/tests/doc/out/explain_3.4.7 | 2 +- src/go/tests/doc/out/explain_3.5.11 | 2 +- src/go/tests/doc/out/find_2.6.12 | 32 +- src/go/tests/doc/out/find_3.0.15 | 34 +- src/go/tests/doc/out/find_3.2.16 | 36 +- src/go/tests/doc/out/find_3.4.7 | 38 +- src/go/tests/doc/out/find_3.5.11 | 40 +- src/go/tests/doc/out/find_andrii_2.6.12 | 87 +--- src/go/tests/doc/out/find_andrii_3.0.15 | 163 +----- src/go/tests/doc/out/find_andrii_3.2.16 | 85 +-- src/go/tests/doc/out/find_andrii_3.4.7 | 87 +--- src/go/tests/doc/out/find_andrii_3.5.11 | 87 +--- src/go/tests/doc/out/find_empty_2.6.12 | 28 +- src/go/tests/doc/out/find_empty_3.0.15 | 25 +- src/go/tests/doc/out/find_empty_3.2.16 | 25 +- src/go/tests/doc/out/find_empty_3.4.7 | 24 +- src/go/tests/doc/out/find_empty_3.5.11 | 24 +- src/go/tests/doc/out/find_with_sort_2.6.12 | 102 ++++ src/go/tests/doc/out/find_with_sort_3.0.15 | 124 +++++ src/go/tests/doc/out/find_with_sort_3.2.16 | 123 +++++ src/go/tests/doc/out/find_with_sort_3.4.7 | 127 +++++ src/go/tests/doc/out/find_with_sort_3.5.11 | 128 +++++ src/go/tests/doc/out/findandmodify_2.6.12 | 8 +- src/go/tests/doc/out/findandmodify_3.0.15 | 2 +- src/go/tests/doc/out/findandmodify_3.2.16 | 4 +- src/go/tests/doc/out/findandmodify_3.4.7 | 4 +- src/go/tests/doc/out/findandmodify_3.5.11 | 4 +- src/go/tests/doc/out/geonear_2.6.12 | 8 +- src/go/tests/doc/out/geonear_3.0.15 | 4 +- src/go/tests/doc/out/geonear_3.2.16 | 4 +- src/go/tests/doc/out/geonear_3.4.7 | 10 +- src/go/tests/doc/out/geonear_3.5.11 | 6 +- src/go/tests/doc/out/getmore_2.6.12 | 33 ++ src/go/tests/doc/out/getmore_3.0.15 | 46 ++ src/go/tests/doc/out/getmore_3.2.16 | 44 ++ src/go/tests/doc/out/getmore_3.4.7 | 103 ++++ src/go/tests/doc/out/getmore_3.5.11 | 106 ++++ src/go/tests/doc/out/group_2.6.12 | 10 +- src/go/tests/doc/out/group_3.0.15 | 4 +- src/go/tests/doc/out/group_3.2.16 | 4 +- src/go/tests/doc/out/group_3.4.7 | 6 +- src/go/tests/doc/out/group_3.5.11 | 6 +- src/go/tests/doc/out/insert_2.6.12 | 6 +- src/go/tests/doc/out/insert_3.0.15 | 20 +- src/go/tests/doc/out/insert_3.2.16 | 14 +- src/go/tests/doc/out/insert_3.4.7 | 15 +- src/go/tests/doc/out/insert_3.5.11 | 15 +- src/go/tests/doc/out/mapreduce_2.6.12 | 10 +- src/go/tests/doc/out/mapreduce_3.0.15 | 4 +- src/go/tests/doc/out/mapreduce_3.2.16 | 4 +- src/go/tests/doc/out/mapreduce_3.4.7 | 22 +- src/go/tests/doc/out/mapreduce_3.5.11 | 4 +- src/go/tests/doc/out/update_2.6.12 | 10 +- src/go/tests/doc/out/update_3.0.15 | 6 +- src/go/tests/doc/out/update_3.2.16 | 4 +- src/go/tests/doc/out/update_3.4.7 | 2 +- src/go/tests/doc/out/update_3.5.11 | 2 +- src/go/tests/doc/script/profile/aggregate.js | 6 +- src/go/tests/doc/script/profile/count.js | 5 +- .../doc/script/profile/count_with_query.js | 5 +- src/go/tests/doc/script/profile/delete.js | 8 +- src/go/tests/doc/script/profile/delete_all.js | 8 +- src/go/tests/doc/script/profile/distinct.js | 6 +- src/go/tests/doc/script/profile/eval.js | 2 +- src/go/tests/doc/script/profile/explain.js | 4 +- src/go/tests/doc/script/profile/find.js | 13 +- .../tests/doc/script/profile/find_andrii.js | 9 +- src/go/tests/doc/script/profile/find_empty.js | 4 +- .../doc/script/profile/find_with_sort.js | 9 + .../tests/doc/script/profile/findandmodify.js | 2 +- src/go/tests/doc/script/profile/geonear.js | 5 +- src/go/tests/doc/script/profile/getmore.js | 14 + src/go/tests/doc/script/profile/group.js | 5 +- src/go/tests/doc/script/profile/insert.js | 3 +- src/go/tests/doc/script/profile/mapreduce.js | 3 +- src/go/tests/doc/script/profile/update.js | 6 +- .../available_metrics/available_metrics | 182 +++---- src/go/tests/expect/stats_all/sum.json | 488 ++++++++++-------- .../expect/stats_single/aggregate_2.6.12 | 4 +- .../expect/stats_single/aggregate_3.0.15 | 6 +- .../expect/stats_single/aggregate_3.2.16 | 6 +- .../tests/expect/stats_single/aggregate_3.4.7 | 4 +- .../expect/stats_single/aggregate_3.5.11 | 4 +- src/go/tests/expect/stats_single/count_2.6.12 | 4 +- src/go/tests/expect/stats_single/count_3.0.15 | 4 +- src/go/tests/expect/stats_single/count_3.2.16 | 4 +- src/go/tests/expect/stats_single/count_3.4.7 | 4 +- src/go/tests/expect/stats_single/count_3.5.11 | 4 +- .../stats_single/count_with_query_2.6.12 | 4 +- .../stats_single/count_with_query_3.0.15 | 4 +- .../stats_single/count_with_query_3.2.16 | 4 +- .../stats_single/count_with_query_3.4.7 | 6 +- .../stats_single/count_with_query_3.5.11 | 6 +- .../tests/expect/stats_single/delete_2.6.12 | 4 +- .../tests/expect/stats_single/delete_3.0.15 | 4 +- .../tests/expect/stats_single/delete_3.2.16 | 4 +- src/go/tests/expect/stats_single/delete_3.4.7 | 6 +- .../tests/expect/stats_single/delete_3.5.11 | 8 +- .../expect/stats_single/delete_all_2.6.12 | 4 +- .../expect/stats_single/delete_all_3.0.15 | 6 +- .../expect/stats_single/delete_all_3.2.16 | 6 +- .../expect/stats_single/delete_all_3.4.7 | 8 +- .../expect/stats_single/delete_all_3.5.11 | 8 +- .../tests/expect/stats_single/distinct_2.6.12 | 6 +- .../tests/expect/stats_single/distinct_3.0.15 | 6 +- .../tests/expect/stats_single/distinct_3.2.16 | 6 +- .../tests/expect/stats_single/distinct_3.4.7 | 8 +- .../tests/expect/stats_single/distinct_3.5.11 | 8 +- src/go/tests/expect/stats_single/eval_2.6.12 | 10 +- src/go/tests/expect/stats_single/eval_3.0.15 | 10 +- src/go/tests/expect/stats_single/eval_3.2.16 | 10 +- src/go/tests/expect/stats_single/eval_3.4.7 | 10 +- src/go/tests/expect/stats_single/eval_3.5.11 | 10 +- .../tests/expect/stats_single/explain_2.6.12 | 6 +- .../tests/expect/stats_single/explain_3.0.15 | 4 +- .../tests/expect/stats_single/explain_3.2.16 | 4 +- .../tests/expect/stats_single/explain_3.4.7 | 4 +- .../tests/expect/stats_single/explain_3.5.11 | 4 +- src/go/tests/expect/stats_single/find_2.6.12 | 16 +- src/go/tests/expect/stats_single/find_3.0.15 | 16 +- src/go/tests/expect/stats_single/find_3.2.16 | 18 +- src/go/tests/expect/stats_single/find_3.4.7 | 16 +- src/go/tests/expect/stats_single/find_3.5.11 | 18 +- .../expect/stats_single/find_andrii_2.6.12 | 6 +- .../expect/stats_single/find_andrii_3.0.15 | 6 +- .../expect/stats_single/find_andrii_3.2.16 | 6 +- .../expect/stats_single/find_andrii_3.4.7 | 6 +- .../expect/stats_single/find_andrii_3.5.11 | 6 +- .../expect/stats_single/find_empty_2.6.12 | 10 +- .../expect/stats_single/find_empty_3.0.15 | 10 +- .../expect/stats_single/find_empty_3.2.16 | 10 +- .../expect/stats_single/find_empty_3.4.7 | 10 +- .../expect/stats_single/find_empty_3.5.11 | 10 +- .../expect/stats_single/find_with_sort_2.6.12 | 27 + .../expect/stats_single/find_with_sort_3.0.15 | 27 + .../expect/stats_single/find_with_sort_3.2.16 | 27 + .../expect/stats_single/find_with_sort_3.4.7 | 27 + .../expect/stats_single/find_with_sort_3.5.11 | 27 + .../expect/stats_single/findandmodify_2.6.12 | 6 +- .../expect/stats_single/findandmodify_3.0.15 | 4 +- .../expect/stats_single/findandmodify_3.2.16 | 6 +- .../expect/stats_single/findandmodify_3.4.7 | 6 +- .../expect/stats_single/findandmodify_3.5.11 | 6 +- .../tests/expect/stats_single/geonear_2.6.12 | 4 +- .../tests/expect/stats_single/geonear_3.0.15 | 6 +- .../tests/expect/stats_single/geonear_3.2.16 | 6 +- .../tests/expect/stats_single/geonear_3.4.7 | 6 +- .../tests/expect/stats_single/geonear_3.5.11 | 6 +- .../tests/expect/stats_single/getmore_2.6.12 | 27 + .../tests/expect/stats_single/getmore_3.0.15 | 27 + .../tests/expect/stats_single/getmore_3.2.16 | 27 + .../tests/expect/stats_single/getmore_3.4.7 | 27 + .../tests/expect/stats_single/getmore_3.5.11 | 27 + src/go/tests/expect/stats_single/group_2.6.12 | 6 +- src/go/tests/expect/stats_single/group_3.0.15 | 6 +- src/go/tests/expect/stats_single/group_3.2.16 | 6 +- src/go/tests/expect/stats_single/group_3.4.7 | 6 +- src/go/tests/expect/stats_single/group_3.5.11 | 6 +- .../tests/expect/stats_single/insert_2.6.12 | 4 +- .../tests/expect/stats_single/insert_3.0.15 | 6 +- .../tests/expect/stats_single/insert_3.2.16 | 6 +- src/go/tests/expect/stats_single/insert_3.4.7 | 6 +- .../tests/expect/stats_single/insert_3.5.11 | 6 +- .../expect/stats_single/mapreduce_2.6.12 | 6 +- .../expect/stats_single/mapreduce_3.0.15 | 6 +- .../expect/stats_single/mapreduce_3.2.16 | 6 +- .../tests/expect/stats_single/mapreduce_3.4.7 | 6 +- .../expect/stats_single/mapreduce_3.5.11 | 6 +- .../tests/expect/stats_single/update_2.6.12 | 4 +- .../tests/expect/stats_single/update_3.0.15 | 4 +- .../tests/expect/stats_single/update_3.2.16 | 6 +- src/go/tests/expect/stats_single/update_3.4.7 | 4 +- .../tests/expect/stats_single/update_3.5.11 | 4 +- 219 files changed, 2567 insertions(+), 1696 deletions(-) create mode 100644 src/go/tests/doc/out/find_with_sort_2.6.12 create mode 100644 src/go/tests/doc/out/find_with_sort_3.0.15 create mode 100644 src/go/tests/doc/out/find_with_sort_3.2.16 create mode 100644 src/go/tests/doc/out/find_with_sort_3.4.7 create mode 100644 src/go/tests/doc/out/find_with_sort_3.5.11 create mode 100644 src/go/tests/doc/out/getmore_2.6.12 create mode 100644 src/go/tests/doc/out/getmore_3.0.15 create mode 100644 src/go/tests/doc/out/getmore_3.2.16 create mode 100644 src/go/tests/doc/out/getmore_3.4.7 create mode 100644 src/go/tests/doc/out/getmore_3.5.11 create mode 100644 src/go/tests/doc/script/profile/find_with_sort.js create mode 100644 src/go/tests/doc/script/profile/getmore.js create mode 100755 src/go/tests/expect/stats_single/find_with_sort_2.6.12 create mode 100755 src/go/tests/expect/stats_single/find_with_sort_3.0.15 create mode 100755 src/go/tests/expect/stats_single/find_with_sort_3.2.16 create mode 100755 src/go/tests/expect/stats_single/find_with_sort_3.4.7 create mode 100755 src/go/tests/expect/stats_single/find_with_sort_3.5.11 create mode 100755 src/go/tests/expect/stats_single/getmore_2.6.12 create mode 100755 src/go/tests/expect/stats_single/getmore_3.0.15 create mode 100755 src/go/tests/expect/stats_single/getmore_3.2.16 create mode 100755 src/go/tests/expect/stats_single/getmore_3.4.7 create mode 100755 src/go/tests/expect/stats_single/getmore_3.5.11 diff --git a/src/go/lib/tutil/util.go b/src/go/lib/tutil/util.go index aa2b8ef9..3e3f8373 100644 --- a/src/go/lib/tutil/util.go +++ b/src/go/lib/tutil/util.go @@ -62,6 +62,10 @@ func LoadBson(filename string, destination interface{}) error { re := regexp.MustCompile(`" :`) buf = re.ReplaceAll(buf, []byte(`":`)) + // Using NumberLong is not supported + re = regexp.MustCompile(`NumberLong\((.*)\)`) + buf = re.ReplaceAll(buf, []byte(`$1`)) + // Using regexp is not supported // https://github.com/go-mgo/mgo/issues/363 re = regexp.MustCompile(`(/.*/)`) diff --git a/src/go/mongolib/explain/explain_test.go b/src/go/mongolib/explain/explain_test.go index c2826ab2..47bc9d28 100644 --- a/src/go/mongolib/explain/explain_test.go +++ b/src/go/mongolib/explain/explain_test.go @@ -77,9 +77,11 @@ func TestExplain(t *testing.T) { "distinct": "", "find_empty": "", "find": "", + "find_with_sort": "", "find_andrii": "", "findandmodify": "", "geonear": "Cannot explain cmd: geoNear", + "getmore": "", "group": "", "insert": "Cannot explain cmd: insert", "mapreduce": "Cannot explain cmd: mapReduce", @@ -104,6 +106,13 @@ func TestExplain(t *testing.T) { } } + for _, v := range versions { + // For versions < 3.4 parsing "getmore" is not supported and returns error + if ok, _ := Constraint("< 3.4", v); ok { + expectError["getmore_"+v] = "Cannot explain cmd: getMore" + } + } + // For versions >= 3.0, < 3.4 trying to explain "insert" returns different error if ok, _ := Constraint(">= 3.0, < 3.4", bi.Version); ok { for _, v := range versions { diff --git a/src/go/mongolib/fingerprinter/fingerprinter.go b/src/go/mongolib/fingerprinter/fingerprinter.go index 34f62105..e25536f6 100644 --- a/src/go/mongolib/fingerprinter/fingerprinter.go +++ b/src/go/mongolib/fingerprinter/fingerprinter.go @@ -66,6 +66,15 @@ func (f *Fingerprinter) Fingerprint(doc proto.SystemProfile) (Fingerprint, error } } + // if there is a orderby clause in the query, we have to add all fields in the sort + // fields list that are not in the query keys list (retKeys) + if sortKeys, ok := query.Map()["orderby"]; ok { + if sortKeysMap, ok := sortKeys.(bson.M); ok { + sortKeys := keys(sortKeysMap, f.keyFilters) + retKeys = append(retKeys, sortKeys...) + } + } + // Extract operation, collection, database and namespace op := "" collection := "" @@ -98,7 +107,7 @@ func (f *Fingerprinter) Fingerprint(doc proto.SystemProfile) (Fingerprint, error break } op = "find" - default: + case "command": if query.Len() == 0 { break } @@ -149,6 +158,9 @@ func (f *Fingerprinter) Fingerprint(doc proto.SystemProfile) (Fingerprint, error collection = "" retKeys = []string{} } + default: + op = doc.Op + retKeys = []string{} } sort.Strings(retKeys) diff --git a/src/go/mongolib/fingerprinter/fingerprinter_test.go b/src/go/mongolib/fingerprinter/fingerprinter_test.go index 9d9fb71f..004ceb1f 100644 --- a/src/go/mongolib/fingerprinter/fingerprinter_test.go +++ b/src/go/mongolib/fingerprinter/fingerprinter_test.go @@ -50,6 +50,8 @@ func ExampleFingerprint() { func TestFingerprint(t *testing.T) { doc := proto.SystemProfile{} + doc.Ns = "db.feedback" + doc.Op = "query" doc.Query = proto.BsonD{ {"find", "feedback"}, {"filter", bson.M{ @@ -63,13 +65,12 @@ func TestFingerprint(t *testing.T) { fp := NewFingerprinter(nil) got, err := fp.Fingerprint(doc) - if err != nil { t.Error("Error in fingerprint") } if got.Fingerprint != want { - t.Errorf("Invalid fingerprint. Got: %q, want %q", got, want) + t.Errorf("Invalid fingerprint. Got: %q, want %q", got.Fingerprint, want) } } @@ -128,16 +129,21 @@ func TestFingerprints(t *testing.T) { "find_empty_3.2.16": "FIND coll", "find_empty_3.4.7": "FIND coll", "find_empty_3.5.11": "FIND coll", - "find_2.6.12": "FIND coll a", - "find_3.0.15": "FIND coll a", - "find_3.2.16": "FIND coll a", - "find_3.4.7": "FIND coll a", - "find_3.5.11": "FIND coll a", + "find_2.6.12": "FIND coll k", + "find_3.0.15": "FIND coll k", + "find_3.2.16": "FIND coll k", + "find_3.4.7": "FIND coll k", + "find_3.5.11": "FIND coll k", "find_andrii_2.6.12": "FIND coll c,k,pad", "find_andrii_3.0.15": "FIND coll c,k,pad", "find_andrii_3.2.16": "FIND coll c,k,pad", "find_andrii_3.4.7": "FIND coll c,k,pad", "find_andrii_3.5.11": "FIND coll c,k,pad", + "find_with_sort_2.6.12": "FIND coll b,c", + "find_with_sort_3.0.15": "FIND coll b,c", + "find_with_sort_3.2.16": "FIND coll b,c", + "find_with_sort_3.4.7": "FIND coll b,c", + "find_with_sort_3.5.11": "FIND coll b,c", "findandmodify_2.6.12": "FINDANDMODIFY coll a", "findandmodify_3.0.15": "FINDANDMODIFY coll a", "findandmodify_3.2.16": "FINDANDMODIFY coll a", @@ -148,6 +154,11 @@ func TestFingerprints(t *testing.T) { "geonear_3.2.16": "GEONEAR coll", "geonear_3.4.7": "GEONEAR coll", "geonear_3.5.11": "GEONEAR coll", + "getmore_2.6.12": "GETMORE coll", + "getmore_3.0.15": "GETMORE coll", + "getmore_3.2.16": "GETMORE coll", + "getmore_3.4.7": "GETMORE coll", + "getmore_3.5.11": "GETMORE coll", "group_2.6.12": "GROUP coll a,b", "group_3.0.15": "GROUP coll a,b", "group_3.2.16": "GROUP coll a,b", diff --git a/src/go/mongolib/proto/system.profile.go b/src/go/mongolib/proto/system.profile.go index 73a1426d..6b2784ac 100644 --- a/src/go/mongolib/proto/system.profile.go +++ b/src/go/mongolib/proto/system.profile.go @@ -73,38 +73,41 @@ type SystemProfile struct { } `bson:"acquireCount"` } `bson:"MMAPV1Journal"` } `bson:"locks"` - Millis int `bson:"millis"` - Nreturned int `bson:"nreturned"` - Ns string `bson:"ns"` - NumYield int `bson:"numYield"` - Op string `bson:"op"` - Protocol string `bson:"protocol"` - Query BsonD `bson:"query"` - UpdateObj BsonD `bson:"updateobj"` - Command BsonD `bson:"command"` - ResponseLength int `bson:"responseLength"` - Ts time.Time `bson:"ts"` - User string `bson:"user"` - WriteConflicts int `bson:"writeConflicts"` + Millis int `bson:"millis"` + Nreturned int `bson:"nreturned"` + Ns string `bson:"ns"` + NumYield int `bson:"numYield"` + Op string `bson:"op"` + Protocol string `bson:"protocol"` + Query BsonD `bson:"query"` + UpdateObj BsonD `bson:"updateobj"` + Command BsonD `bson:"command"` + OriginatingCommand BsonD `bson:"originatingCommand"` + ResponseLength int `bson:"responseLength"` + Ts time.Time `bson:"ts"` + User string `bson:"user"` + WriteConflicts int `bson:"writeConflicts"` } func NewExampleQuery(doc SystemProfile) ExampleQuery { return ExampleQuery{ - Ns: doc.Ns, - Op: doc.Op, - Query: doc.Query, - Command: doc.Command, - UpdateObj: doc.UpdateObj, + Ns: doc.Ns, + Op: doc.Op, + Query: doc.Query, + Command: doc.Command, + OriginatingCommand: doc.OriginatingCommand, + UpdateObj: doc.UpdateObj, } } // ExampleQuery is a subset of SystemProfile type ExampleQuery struct { - Ns string `bson:"ns" json:"ns"` - Op string `bson:"op" json:"op"` - Query BsonD `bson:"query,omitempty" json:"query,omitempty"` - Command BsonD `bson:"command,omitempty" json:"command,omitempty"` - UpdateObj BsonD `bson:"updateobj,omitempty" json:"updateobj,omitempty"` + Ns string `bson:"ns" json:"ns"` + Op string `bson:"op" json:"op"` + Query BsonD `bson:"query,omitempty" json:"query,omitempty"` + Command BsonD `bson:"command,omitempty" json:"command,omitempty"` + OriginatingCommand BsonD `bson:"originatingCommand,omitempty" json:"originatingCommand,omitempty"` + UpdateObj BsonD `bson:"updateobj,omitempty" json:"updateobj,omitempty"` } func (self ExampleQuery) Db() string { @@ -218,6 +221,14 @@ func (self ExampleQuery) ExplainCmd() bson.D { {"insert", coll}, } } + case "getmore": + if self.OriginatingCommand.Len() > 0 { + cmd = self.OriginatingCommand + } else { + cmd = BsonD{ + {Name: "getMore", Value: ""}, + } + } case "command": if cmd.Len() == 0 || cmd[0].Name != "group" { break diff --git a/src/go/mongolib/util/util.go b/src/go/mongolib/util/util.go index dd30ec8b..e8ad249d 100644 --- a/src/go/mongolib/util/util.go +++ b/src/go/mongolib/util/util.go @@ -273,40 +273,6 @@ func GetQueryField(doc proto.SystemProfile) (bson.M, error) { // "query" : { // "query" : { // "$and" : [ - // { - // "k" : { - // "$gt" : 1 - // } - // }, - // { - // "k" : { - // "$lt" : 2 - // } - // }, - // { - // "$or" : [ - // { - // "c" : { - // "$in" : [ - // /^0/, - // /^2/, - // /^4/, - // /^6/ - // ] - // } - // }, - // { - // "pad" : { - // "$in" : [ - // /9$/, - // /7$/, - // /5$/, - // /3$/ - // ] - // } - // } - // ] - // } // ] // }, // "orderby" : { diff --git a/src/go/pt-mongodb-query-digest/main.go b/src/go/pt-mongodb-query-digest/main.go index 625a640e..4eefd044 100644 --- a/src/go/pt-mongodb-query-digest/main.go +++ b/src/go/pt-mongodb-query-digest/main.go @@ -136,8 +136,7 @@ func main() { filters = append(filters, filter.NewFilterByCollection(opts.SkipCollections)) } - query := bson.M{"op": bson.M{"$nin": []string{"getmore"}}} - i := session.DB(di.Database).C("system.profile").Find(query).Sort("-$natural").Iter() + i := session.DB(di.Database).C("system.profile").Find(bson.M{}).Sort("-$natural").Iter() fp := fingerprinter.NewFingerprinter(fingerprinter.DEFAULT_KEY_FILTERS) s := stats.New(fp) diff --git a/src/go/pt-mongodb-query-digest/main_test.go b/src/go/pt-mongodb-query-digest/main_test.go index 474c4bce..a2f76f39 100644 --- a/src/go/pt-mongodb-query-digest/main_test.go +++ b/src/go/pt-mongodb-query-digest/main_test.go @@ -12,6 +12,7 @@ import ( "reflect" "regexp" "runtime" + "sort" "strings" "testing" "text/template" @@ -263,6 +264,7 @@ func testAllOperationsTemplate(t *testing.T, data Data) { for _, file := range files { fs = append(fs, dir+file.Name()) } + sort.Strings(fs) err = run(fs...) if err != nil { t.Fatalf("cannot execute queries: %s", err) @@ -295,6 +297,12 @@ func testAllOperationsTemplate(t *testing.T, data Data) { Operation: "DROP", Fingerprint: "DROP coll drop", }, + { + ID: "db759bfd83441deecc71382323041ce6", + Namespace: "test.coll", + Operation: "GETMORE", + Fingerprint: "GETMORE coll", + }, { ID: "e72ad41302045bd6c2bcad76511f915a", Namespace: "test.coll", @@ -307,12 +315,6 @@ func testAllOperationsTemplate(t *testing.T, data Data) { Operation: "AGGREGATE", Fingerprint: "AGGREGATE coll a", }, - { - ID: "e4122a58c99ab0a4020ce7d195c5a8cb", - Namespace: "test.coll", - Operation: "DISTINCT", - Fingerprint: "DISTINCT coll a,b", - }, { ID: "a6782ae38ef891d5506341a4b0ab2747", Namespace: "test", @@ -331,6 +333,36 @@ func testAllOperationsTemplate(t *testing.T, data Data) { Operation: "FINDANDMODIFY", Fingerprint: "FINDANDMODIFY coll a", }, + { + ID: "2a639e77efe3e68399ef9482575b3421", + Namespace: "test.coll", + Operation: "FIND", + Fingerprint: "FIND coll", + }, + { + ID: "fe0bf975a044fe47fd32b835ceba612d", + Namespace: "test.coll", + Operation: "FIND", + Fingerprint: "FIND coll a", + }, + { + ID: "20fe80188ec82c9d3c3dcf3f4817f8f9", + Namespace: "test.coll", + Operation: "FIND", + Fingerprint: "FIND coll b,c", + }, + { + ID: "02104210d67fe680273784d833f86831", + Namespace: "test.coll", + Operation: "FIND", + Fingerprint: "FIND coll c,k,pad", + }, + { + ID: "5efe4738d807c74b3980de76c37a0870", + Namespace: "test.coll", + Operation: "FIND", + Fingerprint: "FIND coll k", + }, { ID: "798d7c1cd25b63cb6a307126a25910d6", Namespace: "test.system.js", @@ -343,6 +375,12 @@ func testAllOperationsTemplate(t *testing.T, data Data) { Operation: "GEONEAR", Fingerprint: "GEONEAR coll", }, + { + ID: "e4122a58c99ab0a4020ce7d195c5a8cb", + Namespace: "test.coll", + Operation: "DISTINCT", + Fingerprint: "DISTINCT coll a,b", + }, { ID: "ca8bb19386488570447f5753741fb494", Namespace: "test.coll", @@ -375,7 +413,8 @@ func testAllOperationsTemplate(t *testing.T, data Data) { }, } - expected := `Profiler is disabled for the "test" database but there are 125 documents in the system.profile collection. + ndocs := "165" + expected := `Profiler is disabled for the "test" database but there are ` + ndocs + ` documents in the system.profile collection. Using those documents for the stats pt-mongodb-query-digest .+ Host: ` + data.url + ` @@ -386,7 +425,7 @@ Skipping profiled queries on these collections: \[system\.profile\] # Ratio [0-9\.]+ \(docs scanned/returned\) # Attribute pct total min max avg 95% stddev median # ================== === ======== ======== ======== ======== ======== ======= ======== -# Count \(docs\) 125\s +# Count \(docs\) ` + ndocs + `\s # Exec Time ms (\s*[0-9]+){8}\s # Docs Scanned (\s*[0-9\.]+){8}\s # Docs Returned (\s*[0-9\.]+){8}\s diff --git a/src/go/tests/doc/out/aggregate_2.6.12 b/src/go/tests/doc/out/aggregate_2.6.12 index ba3b921b..037b4edf 100644 --- a/src/go/tests/doc/out/aggregate_2.6.12 +++ b/src/go/tests/doc/out/aggregate_2.6.12 @@ -20,12 +20,12 @@ "numYield" : 0, "lockStats" : { "timeLockedMicros" : { - "r" : NumberLong(154), + "r" : NumberLong(222), "w" : NumberLong(0) }, "timeAcquiringMicros" : { - "r" : NumberLong(4), - "w" : NumberLong(2) + "r" : NumberLong(15), + "w" : NumberLong(6) } }, "responseLength" : 385, @@ -33,7 +33,7 @@ "execStats" : { }, - "ts" : ISODate("2017-08-20T15:39:14.658Z"), + "ts" : ISODate("2017-10-15T01:54:08.661Z"), "client" : "127.0.0.1", "allUsers" : [ ], "user" : "" diff --git a/src/go/tests/doc/out/aggregate_3.0.15 b/src/go/tests/doc/out/aggregate_3.0.15 index 619ff376..62ad4332 100644 --- a/src/go/tests/doc/out/aggregate_3.0.15 +++ b/src/go/tests/doc/out/aggregate_3.0.15 @@ -42,11 +42,11 @@ } }, "responseLength" : 385, - "millis" : 2, + "millis" : 0, "execStats" : { }, - "ts" : ISODate("2017-08-20T15:39:20.858Z"), + "ts" : ISODate("2017-10-15T01:54:18.509Z"), "client" : "127.0.0.1", "allUsers" : [ ], "user" : "" diff --git a/src/go/tests/doc/out/aggregate_3.2.16 b/src/go/tests/doc/out/aggregate_3.2.16 index 49b5ccb7..adf0950b 100644 --- a/src/go/tests/doc/out/aggregate_3.2.16 +++ b/src/go/tests/doc/out/aggregate_3.2.16 @@ -38,11 +38,11 @@ }, "responseLength" : 388, "protocol" : "op_command", - "millis" : 2, + "millis" : 0, "execStats" : { }, - "ts" : ISODate("2017-08-20T15:39:29.915Z"), + "ts" : ISODate("2017-10-15T01:54:31.293Z"), "client" : "127.0.0.1", "allUsers" : [ ], "user" : "" diff --git a/src/go/tests/doc/out/aggregate_3.4.7 b/src/go/tests/doc/out/aggregate_3.4.7 index 7464feb8..ce833012 100644 --- a/src/go/tests/doc/out/aggregate_3.4.7 +++ b/src/go/tests/doc/out/aggregate_3.4.7 @@ -42,7 +42,7 @@ "protocol" : "op_command", "millis" : 0, "planSummary" : "IXSCAN { a: 1 }", - "ts" : ISODate("2017-08-20T15:39:36.711Z"), + "ts" : ISODate("2017-10-15T01:54:41.948Z"), "client" : "127.0.0.1", "appName" : "MongoDB Shell", "allUsers" : [ ], diff --git a/src/go/tests/doc/out/aggregate_3.5.11 b/src/go/tests/doc/out/aggregate_3.5.11 index a039c308..64b0f1ae 100644 --- a/src/go/tests/doc/out/aggregate_3.5.11 +++ b/src/go/tests/doc/out/aggregate_3.5.11 @@ -43,7 +43,7 @@ "protocol" : "op_msg", "millis" : 2, "planSummary" : "IXSCAN { a: 1 }", - "ts" : ISODate("2017-08-20T15:39:47.203Z"), + "ts" : ISODate("2017-10-15T01:54:52.564Z"), "client" : "127.0.0.1", "appName" : "MongoDB Shell", "allUsers" : [ ], diff --git a/src/go/tests/doc/out/count_2.6.12 b/src/go/tests/doc/out/count_2.6.12 index b073b918..093b388e 100644 --- a/src/go/tests/doc/out/count_2.6.12 +++ b/src/go/tests/doc/out/count_2.6.12 @@ -14,12 +14,12 @@ "numYield" : 0, "lockStats" : { "timeLockedMicros" : { - "r" : NumberLong(12), + "r" : NumberLong(33), "w" : NumberLong(0) }, "timeAcquiringMicros" : { - "r" : NumberLong(2), - "w" : NumberLong(2) + "r" : NumberLong(3), + "w" : NumberLong(5) } }, "responseLength" : 48, @@ -27,7 +27,7 @@ "execStats" : { }, - "ts" : ISODate("2017-08-20T15:39:14.823Z"), + "ts" : ISODate("2017-10-15T01:54:08.889Z"), "client" : "127.0.0.1", "allUsers" : [ ], "user" : "" diff --git a/src/go/tests/doc/out/count_3.0.15 b/src/go/tests/doc/out/count_3.0.15 index 2d7a5c5c..1513d50e 100644 --- a/src/go/tests/doc/out/count_3.0.15 +++ b/src/go/tests/doc/out/count_3.0.15 @@ -40,7 +40,7 @@ "execStats" : { }, - "ts" : ISODate("2017-08-20T15:39:20.982Z"), + "ts" : ISODate("2017-10-15T01:54:18.673Z"), "client" : "127.0.0.1", "allUsers" : [ ], "user" : "" diff --git a/src/go/tests/doc/out/count_3.2.16 b/src/go/tests/doc/out/count_3.2.16 index 975cd10c..101c99e2 100644 --- a/src/go/tests/doc/out/count_3.2.16 +++ b/src/go/tests/doc/out/count_3.2.16 @@ -36,7 +36,7 @@ "execStats" : { }, - "ts" : ISODate("2017-08-20T15:39:30.094Z"), + "ts" : ISODate("2017-10-15T01:54:31.529Z"), "client" : "127.0.0.1", "allUsers" : [ ], "user" : "" diff --git a/src/go/tests/doc/out/count_3.4.7 b/src/go/tests/doc/out/count_3.4.7 index 1309138a..24567915 100644 --- a/src/go/tests/doc/out/count_3.4.7 +++ b/src/go/tests/doc/out/count_3.4.7 @@ -46,10 +46,10 @@ "restoreState" : 0, "isEOF" : 1, "invalidates" : 0, - "nCounted" : 20, + "nCounted" : 10, "nSkipped" : 0 }, - "ts" : ISODate("2017-08-20T15:39:36.897Z"), + "ts" : ISODate("2017-10-15T01:54:42.157Z"), "client" : "127.0.0.1", "appName" : "MongoDB Shell", "allUsers" : [ ], diff --git a/src/go/tests/doc/out/count_3.5.11 b/src/go/tests/doc/out/count_3.5.11 index 61458ff1..6ea4499b 100644 --- a/src/go/tests/doc/out/count_3.5.11 +++ b/src/go/tests/doc/out/count_3.5.11 @@ -47,10 +47,10 @@ "restoreState" : 0, "isEOF" : 1, "invalidates" : 0, - "nCounted" : 20, + "nCounted" : 10, "nSkipped" : 0 }, - "ts" : ISODate("2017-08-20T15:39:47.396Z"), + "ts" : ISODate("2017-10-15T01:54:52.844Z"), "client" : "127.0.0.1", "appName" : "MongoDB Shell", "allUsers" : [ ], diff --git a/src/go/tests/doc/out/count_with_query_2.6.12 b/src/go/tests/doc/out/count_with_query_2.6.12 index d20bab68..94f74603 100644 --- a/src/go/tests/doc/out/count_with_query_2.6.12 +++ b/src/go/tests/doc/out/count_with_query_2.6.12 @@ -16,12 +16,12 @@ "numYield" : 0, "lockStats" : { "timeLockedMicros" : { - "r" : NumberLong(131), + "r" : NumberLong(75), "w" : NumberLong(0) }, "timeAcquiringMicros" : { - "r" : NumberLong(3), - "w" : NumberLong(4) + "r" : NumberLong(6), + "w" : NumberLong(6) } }, "responseLength" : 48, @@ -29,7 +29,7 @@ "execStats" : { }, - "ts" : ISODate("2017-08-20T15:39:14.971Z"), + "ts" : ISODate("2017-10-15T01:54:09.039Z"), "client" : "127.0.0.1", "allUsers" : [ ], "user" : "" diff --git a/src/go/tests/doc/out/count_with_query_3.0.15 b/src/go/tests/doc/out/count_with_query_3.0.15 index fe86634a..9f4d4cc1 100644 --- a/src/go/tests/doc/out/count_with_query_3.0.15 +++ b/src/go/tests/doc/out/count_with_query_3.0.15 @@ -42,7 +42,7 @@ "execStats" : { }, - "ts" : ISODate("2017-08-20T15:39:21.124Z"), + "ts" : ISODate("2017-10-15T01:54:18.838Z"), "client" : "127.0.0.1", "allUsers" : [ ], "user" : "" diff --git a/src/go/tests/doc/out/count_with_query_3.2.16 b/src/go/tests/doc/out/count_with_query_3.2.16 index 852e8afe..4c71ff19 100644 --- a/src/go/tests/doc/out/count_with_query_3.2.16 +++ b/src/go/tests/doc/out/count_with_query_3.2.16 @@ -38,7 +38,7 @@ "execStats" : { }, - "ts" : ISODate("2017-08-20T15:39:30.251Z"), + "ts" : ISODate("2017-10-15T01:54:31.756Z"), "client" : "127.0.0.1", "allUsers" : [ ], "user" : "" diff --git a/src/go/tests/doc/out/count_with_query_3.4.7 b/src/go/tests/doc/out/count_with_query_3.4.7 index 5bdc59ff..076352b6 100644 --- a/src/go/tests/doc/out/count_with_query_3.4.7 +++ b/src/go/tests/doc/out/count_with_query_3.4.7 @@ -12,8 +12,8 @@ } }, - "keysExamined" : 13, - "docsExamined" : 0, + "keysExamined" : 0, + "docsExamined" : 10, "numYield" : 0, "locks" : { "Global" : { @@ -35,59 +35,43 @@ "responseLength" : 29, "protocol" : "op_command", "millis" : 0, - "planSummary" : "COUNT_SCAN { a: 1 }", + "planSummary" : "COLLSCAN", "execStats" : { "stage" : "COUNT", "nReturned" : 0, "executionTimeMillisEstimate" : 0, - "works" : 13, + "works" : 12, "advanced" : 0, - "needTime" : 12, + "needTime" : 11, "needYield" : 0, "saveState" : 0, "restoreState" : 0, "isEOF" : 1, "invalidates" : 0, - "nCounted" : 12, + "nCounted" : 4, "nSkipped" : 0, "inputStage" : { - "stage" : "COUNT_SCAN", - "nReturned" : 12, + "stage" : "COLLSCAN", + "filter" : { + "a" : { + "$gt" : 5 + } + }, + "nReturned" : 4, "executionTimeMillisEstimate" : 0, - "works" : 13, - "advanced" : 12, - "needTime" : 0, + "works" : 12, + "advanced" : 4, + "needTime" : 7, "needYield" : 0, "saveState" : 0, "restoreState" : 0, "isEOF" : 1, "invalidates" : 0, - "keysExamined" : 13, - "keyPattern" : { - "a" : 1 - }, - "indexName" : "a_1", - "isMultiKey" : false, - "multiKeyPaths" : { - "a" : [ ] - }, - "isUnique" : false, - "isSparse" : false, - "isPartial" : false, - "indexVersion" : 2, - "indexBounds" : { - "startKey" : { - "a" : 5 - }, - "startKeyInclusive" : false, - "endKey" : { - "a" : Infinity - }, - "endKeyInclusive" : true - } + "direction" : "forward", + "docsExamined" : 10 } }, - "ts" : ISODate("2017-08-20T15:39:37.077Z"), + "ts" : ISODate("2017-10-15T01:54:42.350Z"), "client" : "127.0.0.1", "appName" : "MongoDB Shell", "allUsers" : [ ], diff --git a/src/go/tests/doc/out/count_with_query_3.5.11 b/src/go/tests/doc/out/count_with_query_3.5.11 index e7c3d455..f7f27b5e 100644 --- a/src/go/tests/doc/out/count_with_query_3.5.11 +++ b/src/go/tests/doc/out/count_with_query_3.5.11 @@ -13,8 +13,8 @@ }, "$db" : "test" }, - "keysExamined" : 13, - "docsExamined" : 0, + "keysExamined" : 0, + "docsExamined" : 10, "numYield" : 0, "locks" : { "Global" : { @@ -36,59 +36,43 @@ "responseLength" : 29, "protocol" : "op_msg", "millis" : 0, - "planSummary" : "COUNT_SCAN { a: 1 }", + "planSummary" : "COLLSCAN", "execStats" : { "stage" : "COUNT", "nReturned" : 0, "executionTimeMillisEstimate" : 0, - "works" : 13, + "works" : 12, "advanced" : 0, - "needTime" : 12, + "needTime" : 11, "needYield" : 0, "saveState" : 0, "restoreState" : 0, "isEOF" : 1, "invalidates" : 0, - "nCounted" : 12, + "nCounted" : 4, "nSkipped" : 0, "inputStage" : { - "stage" : "COUNT_SCAN", - "nReturned" : 12, + "stage" : "COLLSCAN", + "filter" : { + "a" : { + "$gt" : 5 + } + }, + "nReturned" : 4, "executionTimeMillisEstimate" : 0, - "works" : 13, - "advanced" : 12, - "needTime" : 0, + "works" : 12, + "advanced" : 4, + "needTime" : 7, "needYield" : 0, "saveState" : 0, "restoreState" : 0, "isEOF" : 1, "invalidates" : 0, - "keysExamined" : 13, - "keyPattern" : { - "a" : 1 - }, - "indexName" : "a_1", - "isMultiKey" : false, - "multiKeyPaths" : { - "a" : [ ] - }, - "isUnique" : false, - "isSparse" : false, - "isPartial" : false, - "indexVersion" : 2, - "indexBounds" : { - "startKey" : { - "a" : 5 - }, - "startKeyInclusive" : false, - "endKey" : { - "a" : Infinity - }, - "endKeyInclusive" : true - } + "direction" : "forward", + "docsExamined" : 10 } }, - "ts" : ISODate("2017-08-20T15:39:47.573Z"), + "ts" : ISODate("2017-10-15T01:54:53.078Z"), "client" : "127.0.0.1", "appName" : "MongoDB Shell", "allUsers" : [ ], diff --git a/src/go/tests/doc/out/delete_2.6.12 b/src/go/tests/doc/out/delete_2.6.12 index 8546bd8c..223c26bd 100644 --- a/src/go/tests/doc/out/delete_2.6.12 +++ b/src/go/tests/doc/out/delete_2.6.12 @@ -15,18 +15,18 @@ "lockStats" : { "timeLockedMicros" : { "r" : NumberLong(0), - "w" : NumberLong(182) + "w" : NumberLong(144) }, "timeAcquiringMicros" : { "r" : NumberLong(0), - "w" : NumberLong(4) + "w" : NumberLong(11) } }, "millis" : 0, "execStats" : { }, - "ts" : ISODate("2017-08-20T15:39:15.126Z"), + "ts" : ISODate("2017-10-15T01:54:09.246Z"), "client" : "127.0.0.1", "allUsers" : [ ], "user" : "" diff --git a/src/go/tests/doc/out/delete_3.0.15 b/src/go/tests/doc/out/delete_3.0.15 index f9c6426a..dc0b6b9b 100644 --- a/src/go/tests/doc/out/delete_3.0.15 +++ b/src/go/tests/doc/out/delete_3.0.15 @@ -40,7 +40,7 @@ "execStats" : { }, - "ts" : ISODate("2017-08-20T15:39:21.265Z"), + "ts" : ISODate("2017-10-15T01:54:19.034Z"), "client" : "127.0.0.1", "allUsers" : [ ], "user" : "" diff --git a/src/go/tests/doc/out/delete_3.2.16 b/src/go/tests/doc/out/delete_3.2.16 index a04ce599..130dea8a 100644 --- a/src/go/tests/doc/out/delete_3.2.16 +++ b/src/go/tests/doc/out/delete_3.2.16 @@ -35,7 +35,7 @@ "execStats" : { }, - "ts" : ISODate("2017-08-20T15:39:30.543Z"), + "ts" : ISODate("2017-10-15T01:54:32.020Z"), "client" : "127.0.0.1", "allUsers" : [ ], "user" : "" diff --git a/src/go/tests/doc/out/delete_3.4.7 b/src/go/tests/doc/out/delete_3.4.7 index 9a253d6e..33b766bd 100644 --- a/src/go/tests/doc/out/delete_3.4.7 +++ b/src/go/tests/doc/out/delete_3.4.7 @@ -9,8 +9,8 @@ "$gte" : 2 } }, - "keysExamined" : 4, - "docsExamined" : 4, + "keysExamined" : 1, + "docsExamined" : 1, "ndeleted" : 1, "keysDeleted" : 2, "numYield" : 0, @@ -38,9 +38,9 @@ "stage" : "DELETE", "nReturned" : 0, "executionTimeMillisEstimate" : 0, - "works" : 5, + "works" : 2, "advanced" : 0, - "needTime" : 4, + "needTime" : 1, "needYield" : 0, "saveState" : 0, "restoreState" : 0, @@ -57,22 +57,22 @@ }, "nReturned" : 1, "executionTimeMillisEstimate" : 0, - "works" : 4, + "works" : 1, "advanced" : 1, - "needTime" : 3, + "needTime" : 0, "needYield" : 0, "saveState" : 1, "restoreState" : 1, "isEOF" : 0, "invalidates" : 0, - "docsExamined" : 4, + "docsExamined" : 1, "alreadyHasObj" : 0, "inputStage" : { "stage" : "IXSCAN", - "nReturned" : 4, + "nReturned" : 1, "executionTimeMillisEstimate" : 0, - "works" : 4, - "advanced" : 4, + "works" : 1, + "advanced" : 1, "needTime" : 0, "needYield" : 0, "saveState" : 1, @@ -97,7 +97,7 @@ "[2.0, inf.0]" ] }, - "keysExamined" : 4, + "keysExamined" : 1, "seeks" : 1, "dupsTested" : 0, "dupsDropped" : 0, @@ -105,7 +105,7 @@ } } }, - "ts" : ISODate("2017-08-20T15:39:37.279Z"), + "ts" : ISODate("2017-10-15T01:54:42.612Z"), "client" : "127.0.0.1", "appName" : "MongoDB Shell", "allUsers" : [ ], diff --git a/src/go/tests/doc/out/delete_3.5.11 b/src/go/tests/doc/out/delete_3.5.11 index 6c09b73d..d8d3e438 100644 --- a/src/go/tests/doc/out/delete_3.5.11 +++ b/src/go/tests/doc/out/delete_3.5.11 @@ -12,8 +12,8 @@ }, "limit" : 1 }, - "keysExamined" : 4, - "docsExamined" : 4, + "keysExamined" : 1, + "docsExamined" : 1, "ndeleted" : 1, "keysDeleted" : 2, "numYield" : 0, @@ -35,15 +35,15 @@ } } }, - "millis" : 0, + "millis" : 1, "planSummary" : "IXSCAN { a: 1 }", "execStats" : { "stage" : "DELETE", "nReturned" : 0, "executionTimeMillisEstimate" : 0, - "works" : 5, + "works" : 2, "advanced" : 0, - "needTime" : 4, + "needTime" : 1, "needYield" : 0, "saveState" : 0, "restoreState" : 0, @@ -60,22 +60,22 @@ }, "nReturned" : 1, "executionTimeMillisEstimate" : 0, - "works" : 4, + "works" : 1, "advanced" : 1, - "needTime" : 3, + "needTime" : 0, "needYield" : 0, "saveState" : 1, "restoreState" : 1, "isEOF" : 0, "invalidates" : 0, - "docsExamined" : 4, + "docsExamined" : 1, "alreadyHasObj" : 0, "inputStage" : { "stage" : "IXSCAN", - "nReturned" : 4, + "nReturned" : 1, "executionTimeMillisEstimate" : 0, - "works" : 4, - "advanced" : 4, + "works" : 1, + "advanced" : 1, "needTime" : 0, "needYield" : 0, "saveState" : 1, @@ -100,7 +100,7 @@ "[2.0, inf.0]" ] }, - "keysExamined" : 4, + "keysExamined" : 1, "seeks" : 1, "dupsTested" : 0, "dupsDropped" : 0, @@ -108,7 +108,7 @@ } } }, - "ts" : ISODate("2017-08-20T15:39:47.745Z"), + "ts" : ISODate("2017-10-15T01:54:53.333Z"), "client" : "127.0.0.1", "appName" : "MongoDB Shell", "allUsers" : [ ], diff --git a/src/go/tests/doc/out/delete_all_2.6.12 b/src/go/tests/doc/out/delete_all_2.6.12 index 66995bb7..2b78e86a 100644 --- a/src/go/tests/doc/out/delete_all_2.6.12 +++ b/src/go/tests/doc/out/delete_all_2.6.12 @@ -9,24 +9,24 @@ "$gte" : 2 } }, - "ndeleted" : 15, + "ndeleted" : 8, "keyUpdates" : 0, "numYield" : 0, "lockStats" : { "timeLockedMicros" : { "r" : NumberLong(0), - "w" : NumberLong(238) + "w" : NumberLong(396) }, "timeAcquiringMicros" : { "r" : NumberLong(0), - "w" : NumberLong(4) + "w" : NumberLong(12) } }, "millis" : 0, "execStats" : { }, - "ts" : ISODate("2017-08-30T10:54:45.348Z"), + "ts" : ISODate("2017-10-15T01:54:09.463Z"), "client" : "127.0.0.1", "allUsers" : [ ], "user" : "" diff --git a/src/go/tests/doc/out/delete_all_3.0.15 b/src/go/tests/doc/out/delete_all_3.0.15 index 78f5d10b..37e00f6e 100644 --- a/src/go/tests/doc/out/delete_all_3.0.15 +++ b/src/go/tests/doc/out/delete_all_3.0.15 @@ -9,7 +9,7 @@ "$gte" : 2 } }, - "ndeleted" : 15, + "ndeleted" : 8, "keyUpdates" : 0, "writeConflicts" : 0, "numYield" : 0, @@ -22,7 +22,7 @@ }, "MMAPV1Journal" : { "acquireCount" : { - "w" : NumberLong(16) + "w" : NumberLong(9) } }, "Database" : { @@ -36,11 +36,11 @@ } } }, - "millis" : 1, + "millis" : 0, "execStats" : { }, - "ts" : ISODate("2017-08-30T10:54:52.821Z"), + "ts" : ISODate("2017-10-15T01:54:19.206Z"), "client" : "127.0.0.1", "allUsers" : [ ], "user" : "" diff --git a/src/go/tests/doc/out/delete_all_3.2.16 b/src/go/tests/doc/out/delete_all_3.2.16 index 338c92c9..05b1c027 100644 --- a/src/go/tests/doc/out/delete_all_3.2.16 +++ b/src/go/tests/doc/out/delete_all_3.2.16 @@ -9,7 +9,7 @@ "$gte" : 2 } }, - "ndeleted" : 15, + "ndeleted" : 8, "keyUpdates" : 0, "writeConflicts" : 0, "numYield" : 0, @@ -31,11 +31,11 @@ } } }, - "millis" : 0, + "millis" : 1, "execStats" : { }, - "ts" : ISODate("2017-08-30T10:55:02.238Z"), + "ts" : ISODate("2017-10-15T01:54:32.281Z"), "client" : "127.0.0.1", "allUsers" : [ ], "user" : "" diff --git a/src/go/tests/doc/out/delete_all_3.4.7 b/src/go/tests/doc/out/delete_all_3.4.7 index 741b0c30..c9ef76b0 100644 --- a/src/go/tests/doc/out/delete_all_3.4.7 +++ b/src/go/tests/doc/out/delete_all_3.4.7 @@ -9,10 +9,10 @@ "$gte" : 2 } }, - "keysExamined" : 39, - "docsExamined" : 39, - "ndeleted" : 15, - "keysDeleted" : 30, + "keysExamined" : 8, + "docsExamined" : 8, + "ndeleted" : 8, + "keysDeleted" : 16, "numYield" : 0, "locks" : { "Global" : { @@ -32,21 +32,21 @@ } } }, - "millis" : 0, + "millis" : 1, "planSummary" : "IXSCAN { a: 1 }", "execStats" : { "stage" : "DELETE", "nReturned" : 0, "executionTimeMillisEstimate" : 0, - "works" : 40, + "works" : 9, "advanced" : 0, - "needTime" : 39, + "needTime" : 8, "needYield" : 0, "saveState" : 0, "restoreState" : 0, "isEOF" : 1, "invalidates" : 0, - "nWouldDelete" : 15, + "nWouldDelete" : 8, "nInvalidateSkips" : 0, "inputStage" : { "stage" : "FETCH", @@ -55,28 +55,28 @@ "$gte" : 2 } }, - "nReturned" : 15, + "nReturned" : 8, "executionTimeMillisEstimate" : 0, - "works" : 40, - "advanced" : 15, - "needTime" : 24, + "works" : 9, + "advanced" : 8, + "needTime" : 0, "needYield" : 0, - "saveState" : 15, - "restoreState" : 15, + "saveState" : 8, + "restoreState" : 8, "isEOF" : 1, "invalidates" : 0, - "docsExamined" : 39, + "docsExamined" : 8, "alreadyHasObj" : 0, "inputStage" : { "stage" : "IXSCAN", - "nReturned" : 39, + "nReturned" : 8, "executionTimeMillisEstimate" : 0, - "works" : 40, - "advanced" : 39, + "works" : 9, + "advanced" : 8, "needTime" : 0, "needYield" : 0, - "saveState" : 15, - "restoreState" : 15, + "saveState" : 8, + "restoreState" : 8, "isEOF" : 1, "invalidates" : 0, "keyPattern" : { @@ -97,7 +97,7 @@ "[2.0, inf.0]" ] }, - "keysExamined" : 39, + "keysExamined" : 8, "seeks" : 1, "dupsTested" : 0, "dupsDropped" : 0, @@ -105,7 +105,7 @@ } } }, - "ts" : ISODate("2017-08-30T10:55:09.833Z"), + "ts" : ISODate("2017-10-15T01:54:42.820Z"), "client" : "127.0.0.1", "appName" : "MongoDB Shell", "allUsers" : [ ], diff --git a/src/go/tests/doc/out/delete_all_3.5.11 b/src/go/tests/doc/out/delete_all_3.5.11 index 2435a88a..21b31346 100644 --- a/src/go/tests/doc/out/delete_all_3.5.11 +++ b/src/go/tests/doc/out/delete_all_3.5.11 @@ -12,10 +12,10 @@ }, "limit" : 0 }, - "keysExamined" : 39, - "docsExamined" : 39, - "ndeleted" : 15, - "keysDeleted" : 30, + "keysExamined" : 8, + "docsExamined" : 8, + "ndeleted" : 8, + "keysDeleted" : 16, "numYield" : 0, "locks" : { "Global" : { @@ -35,21 +35,21 @@ } } }, - "millis" : 0, + "millis" : 1, "planSummary" : "IXSCAN { a: 1 }", "execStats" : { "stage" : "DELETE", "nReturned" : 0, - "executionTimeMillisEstimate" : 0, - "works" : 40, + "executionTimeMillisEstimate" : 10, + "works" : 9, "advanced" : 0, - "needTime" : 39, + "needTime" : 8, "needYield" : 0, "saveState" : 0, "restoreState" : 0, "isEOF" : 1, "invalidates" : 0, - "nWouldDelete" : 15, + "nWouldDelete" : 8, "nInvalidateSkips" : 0, "inputStage" : { "stage" : "FETCH", @@ -58,28 +58,28 @@ "$gte" : 2 } }, - "nReturned" : 15, + "nReturned" : 8, "executionTimeMillisEstimate" : 0, - "works" : 40, - "advanced" : 15, - "needTime" : 24, + "works" : 9, + "advanced" : 8, + "needTime" : 0, "needYield" : 0, - "saveState" : 15, - "restoreState" : 15, + "saveState" : 8, + "restoreState" : 8, "isEOF" : 1, "invalidates" : 0, - "docsExamined" : 39, + "docsExamined" : 8, "alreadyHasObj" : 0, "inputStage" : { "stage" : "IXSCAN", - "nReturned" : 39, + "nReturned" : 8, "executionTimeMillisEstimate" : 0, - "works" : 40, - "advanced" : 39, + "works" : 9, + "advanced" : 8, "needTime" : 0, "needYield" : 0, - "saveState" : 15, - "restoreState" : 15, + "saveState" : 8, + "restoreState" : 8, "isEOF" : 1, "invalidates" : 0, "keyPattern" : { @@ -100,7 +100,7 @@ "[2.0, inf.0]" ] }, - "keysExamined" : 39, + "keysExamined" : 8, "seeks" : 1, "dupsTested" : 0, "dupsDropped" : 0, @@ -108,7 +108,7 @@ } } }, - "ts" : ISODate("2017-08-30T10:55:19.142Z"), + "ts" : ISODate("2017-10-15T01:54:53.615Z"), "client" : "127.0.0.1", "appName" : "MongoDB Shell", "allUsers" : [ ], diff --git a/src/go/tests/doc/out/distinct_2.6.12 b/src/go/tests/doc/out/distinct_2.6.12 index e7df47a7..35e9c086 100644 --- a/src/go/tests/doc/out/distinct_2.6.12 +++ b/src/go/tests/doc/out/distinct_2.6.12 @@ -14,20 +14,20 @@ "numYield" : 0, "lockStats" : { "timeLockedMicros" : { - "r" : NumberLong(250), + "r" : NumberLong(362), "w" : NumberLong(0) }, "timeAcquiringMicros" : { - "r" : NumberLong(2), - "w" : NumberLong(3) + "r" : NumberLong(6), + "w" : NumberLong(9341) } }, - "responseLength" : 254, + "responseLength" : 199, "millis" : 0, "execStats" : { }, - "ts" : ISODate("2017-08-20T15:39:15.323Z"), + "ts" : ISODate("2017-10-15T01:54:09.687Z"), "client" : "127.0.0.1", "allUsers" : [ ], "user" : "" diff --git a/src/go/tests/doc/out/distinct_3.0.15 b/src/go/tests/doc/out/distinct_3.0.15 index 955ab924..21bf1c7d 100644 --- a/src/go/tests/doc/out/distinct_3.0.15 +++ b/src/go/tests/doc/out/distinct_3.0.15 @@ -35,12 +35,12 @@ } } }, - "responseLength" : 261, + "responseLength" : 206, "millis" : 0, "execStats" : { }, - "ts" : ISODate("2017-08-20T15:39:21.392Z"), + "ts" : ISODate("2017-10-15T01:54:19.380Z"), "client" : "127.0.0.1", "allUsers" : [ ], "user" : "" diff --git a/src/go/tests/doc/out/distinct_3.2.16 b/src/go/tests/doc/out/distinct_3.2.16 index 474627cf..4a702cc4 100644 --- a/src/go/tests/doc/out/distinct_3.2.16 +++ b/src/go/tests/doc/out/distinct_3.2.16 @@ -30,13 +30,13 @@ } } }, - "responseLength" : 264, + "responseLength" : 209, "protocol" : "op_command", "millis" : 0, "execStats" : { }, - "ts" : ISODate("2017-08-20T15:39:30.748Z"), + "ts" : ISODate("2017-10-15T01:54:32.523Z"), "client" : "127.0.0.1", "allUsers" : [ ], "user" : "" diff --git a/src/go/tests/doc/out/distinct_3.4.7 b/src/go/tests/doc/out/distinct_3.4.7 index 6de98b90..0ced8f0a 100644 --- a/src/go/tests/doc/out/distinct_3.4.7 +++ b/src/go/tests/doc/out/distinct_3.4.7 @@ -10,8 +10,8 @@ } } }, - "keysExamined" : 10, - "docsExamined" : 10, + "keysExamined" : 5, + "docsExamined" : 5, "numYield" : 0, "locks" : { "Global" : { @@ -30,30 +30,30 @@ } } }, - "responseLength" : 145, + "responseLength" : 90, "protocol" : "op_command", "millis" : 0, "planSummary" : "IXSCAN { b: 1 }", "execStats" : { "stage" : "FETCH", - "nReturned" : 10, + "nReturned" : 5, "executionTimeMillisEstimate" : 0, - "works" : 11, - "advanced" : 10, + "works" : 6, + "advanced" : 5, "needTime" : 0, "needYield" : 0, "saveState" : 0, "restoreState" : 0, "isEOF" : 1, "invalidates" : 0, - "docsExamined" : 10, + "docsExamined" : 5, "alreadyHasObj" : 0, "inputStage" : { "stage" : "IXSCAN", - "nReturned" : 10, + "nReturned" : 5, "executionTimeMillisEstimate" : 0, - "works" : 11, - "advanced" : 10, + "works" : 6, + "advanced" : 5, "needTime" : 0, "needYield" : 0, "saveState" : 0, @@ -78,14 +78,14 @@ "[5.0, inf.0]" ] }, - "keysExamined" : 10, + "keysExamined" : 5, "seeks" : 1, "dupsTested" : 0, "dupsDropped" : 0, "seenInvalidated" : 0 } }, - "ts" : ISODate("2017-08-20T15:39:37.511Z"), + "ts" : ISODate("2017-10-15T01:54:43.048Z"), "client" : "127.0.0.1", "appName" : "MongoDB Shell", "allUsers" : [ ], diff --git a/src/go/tests/doc/out/distinct_3.5.11 b/src/go/tests/doc/out/distinct_3.5.11 index a6144b56..69c8442e 100644 --- a/src/go/tests/doc/out/distinct_3.5.11 +++ b/src/go/tests/doc/out/distinct_3.5.11 @@ -11,8 +11,8 @@ }, "$db" : "test" }, - "keysExamined" : 10, - "docsExamined" : 10, + "keysExamined" : 5, + "docsExamined" : 5, "numYield" : 0, "locks" : { "Global" : { @@ -31,30 +31,30 @@ } } }, - "responseLength" : 145, + "responseLength" : 90, "protocol" : "op_msg", "millis" : 0, "planSummary" : "IXSCAN { b: 1 }", "execStats" : { "stage" : "FETCH", - "nReturned" : 10, + "nReturned" : 5, "executionTimeMillisEstimate" : 0, - "works" : 11, - "advanced" : 10, + "works" : 6, + "advanced" : 5, "needTime" : 0, "needYield" : 0, "saveState" : 0, "restoreState" : 0, "isEOF" : 1, "invalidates" : 0, - "docsExamined" : 10, + "docsExamined" : 5, "alreadyHasObj" : 0, "inputStage" : { "stage" : "IXSCAN", - "nReturned" : 10, + "nReturned" : 5, "executionTimeMillisEstimate" : 0, - "works" : 11, - "advanced" : 10, + "works" : 6, + "advanced" : 5, "needTime" : 0, "needYield" : 0, "saveState" : 0, @@ -79,14 +79,14 @@ "[5.0, inf.0]" ] }, - "keysExamined" : 10, + "keysExamined" : 5, "seeks" : 1, "dupsTested" : 0, "dupsDropped" : 0, "seenInvalidated" : 0 } }, - "ts" : ISODate("2017-08-20T15:39:47.927Z"), + "ts" : ISODate("2017-10-15T01:54:53.874Z"), "client" : "127.0.0.1", "appName" : "MongoDB Shell", "allUsers" : [ ], diff --git a/src/go/tests/doc/out/eval_2.6.12 b/src/go/tests/doc/out/eval_2.6.12 index 132d8f0c..d8ba0b6f 100644 --- a/src/go/tests/doc/out/eval_2.6.12 +++ b/src/go/tests/doc/out/eval_2.6.12 @@ -2,28 +2,28 @@ "op" : "command", "ns" : "test.$cmd", "command" : { - "$eval" : "db" + "$eval" : "1" }, "keyUpdates" : 0, "numYield" : 0, "lockStats" : { "timeLockedMicros" : { "R" : NumberLong(0), - "W" : NumberLong(64994) + "W" : NumberLong(42972) }, "timeAcquiringMicros" : { "R" : NumberLong(0), - "W" : NumberLong(5), + "W" : NumberLong(8), "r" : NumberLong(0), - "w" : NumberLong(7) + "w" : NumberLong(6) } }, - "responseLength" : 108, - "millis" : 65, + "responseLength" : 53, + "millis" : 43, "execStats" : { }, - "ts" : ISODate("2017-09-05T19:39:24.522Z"), + "ts" : ISODate("2017-10-15T01:54:09.890Z"), "client" : "127.0.0.1", "allUsers" : [ ], "user" : "" diff --git a/src/go/tests/doc/out/eval_3.0.15 b/src/go/tests/doc/out/eval_3.0.15 index ebfc7ce9..f82cb588 100644 --- a/src/go/tests/doc/out/eval_3.0.15 +++ b/src/go/tests/doc/out/eval_3.0.15 @@ -2,7 +2,7 @@ "op" : "command", "ns" : "test.$cmd", "command" : { - "$eval" : "db" + "$eval" : "1" }, "keyUpdates" : 0, "writeConflicts" : 0, @@ -30,12 +30,12 @@ } } }, - "responseLength" : 108, - "millis" : 35, + "responseLength" : 53, + "millis" : 37, "execStats" : { }, - "ts" : ISODate("2017-09-05T19:39:32.054Z"), + "ts" : ISODate("2017-10-15T01:54:19.572Z"), "client" : "127.0.0.1", "allUsers" : [ ], "user" : "" diff --git a/src/go/tests/doc/out/eval_3.2.16 b/src/go/tests/doc/out/eval_3.2.16 index a977cb1f..6d632f6f 100644 --- a/src/go/tests/doc/out/eval_3.2.16 +++ b/src/go/tests/doc/out/eval_3.2.16 @@ -2,7 +2,7 @@ "op" : "command", "ns" : "test", "command" : { - "$eval" : "db" + "$eval" : "1" }, "keyUpdates" : 0, "writeConflicts" : 0, @@ -25,13 +25,13 @@ } } }, - "responseLength" : 93, + "responseLength" : 38, "protocol" : "op_command", - "millis" : 88, + "millis" : 56, "execStats" : { }, - "ts" : ISODate("2017-09-05T19:39:41.581Z"), + "ts" : ISODate("2017-10-15T01:54:32.759Z"), "client" : "127.0.0.1", "allUsers" : [ ], "user" : "" diff --git a/src/go/tests/doc/out/eval_3.4.7 b/src/go/tests/doc/out/eval_3.4.7 index 9d2e9786..ebfc7b7c 100644 --- a/src/go/tests/doc/out/eval_3.4.7 +++ b/src/go/tests/doc/out/eval_3.4.7 @@ -2,7 +2,7 @@ "op" : "command", "ns" : "test", "command" : { - "$eval" : "db" + "$eval" : "1" }, "numYield" : 0, "locks" : { @@ -23,10 +23,10 @@ } } }, - "responseLength" : 93, + "responseLength" : 38, "protocol" : "op_command", - "millis" : 91, - "ts" : ISODate("2017-09-05T19:39:48.888Z"), + "millis" : 48, + "ts" : ISODate("2017-10-15T01:54:43.273Z"), "client" : "127.0.0.1", "appName" : "MongoDB Shell", "allUsers" : [ ], diff --git a/src/go/tests/doc/out/eval_3.5.11 b/src/go/tests/doc/out/eval_3.5.11 index 3cc988e0..f2ff0ae7 100644 --- a/src/go/tests/doc/out/eval_3.5.11 +++ b/src/go/tests/doc/out/eval_3.5.11 @@ -2,7 +2,7 @@ "op" : "command", "ns" : "test", "command" : { - "$eval" : "db", + "$eval" : "1", "$db" : "test" }, "numYield" : 0, @@ -24,10 +24,10 @@ } } }, - "responseLength" : 93, + "responseLength" : 38, "protocol" : "op_msg", - "millis" : 47, - "ts" : ISODate("2017-09-05T19:40:00.171Z"), + "millis" : 40, + "ts" : ISODate("2017-10-15T01:54:54.085Z"), "client" : "127.0.0.1", "appName" : "MongoDB Shell", "allUsers" : [ ], diff --git a/src/go/tests/doc/out/explain_2.6.12 b/src/go/tests/doc/out/explain_2.6.12 index 0abbb9a0..057bc3fa 100644 --- a/src/go/tests/doc/out/explain_2.6.12 +++ b/src/go/tests/doc/out/explain_2.6.12 @@ -9,18 +9,18 @@ }, "ntoreturn" : 0, "ntoskip" : 0, - "nscanned" : 44, - "nscannedObjects" : 44, + "nscanned" : 10, + "nscannedObjects" : 10, "keyUpdates" : 0, "numYield" : 0, "lockStats" : { "timeLockedMicros" : { - "r" : NumberLong(95), + "r" : NumberLong(101), "w" : NumberLong(0) }, "timeAcquiringMicros" : { - "r" : NumberLong(14), - "w" : NumberLong(6) + "r" : NumberLong(6), + "w" : NumberLong(11) } }, "nreturned" : 1, @@ -28,18 +28,18 @@ "millis" : 0, "execStats" : { "type" : "COLLSCAN", - "works" : 46, + "works" : 12, "yields" : 0, "unyields" : 0, "invalidates" : 0, - "advanced" : 44, + "advanced" : 10, "needTime" : 1, "needFetch" : 0, "isEOF" : 1, - "docsTested" : 44, + "docsTested" : 10, "children" : [ ] }, - "ts" : ISODate("2017-09-05T19:39:24.666Z"), + "ts" : ISODate("2017-10-15T01:54:10.058Z"), "client" : "127.0.0.1", "allUsers" : [ ], "user" : "" diff --git a/src/go/tests/doc/out/explain_3.0.15 b/src/go/tests/doc/out/explain_3.0.15 index 4c79d0e5..f65e97cd 100644 --- a/src/go/tests/doc/out/explain_3.0.15 +++ b/src/go/tests/doc/out/explain_3.0.15 @@ -43,7 +43,7 @@ "execStats" : { }, - "ts" : ISODate("2017-09-05T19:39:32.210Z"), + "ts" : ISODate("2017-10-15T01:54:19.722Z"), "client" : "127.0.0.1", "allUsers" : [ ], "user" : "" diff --git a/src/go/tests/doc/out/explain_3.2.16 b/src/go/tests/doc/out/explain_3.2.16 index aa91a9ae..0d34e67c 100644 --- a/src/go/tests/doc/out/explain_3.2.16 +++ b/src/go/tests/doc/out/explain_3.2.16 @@ -36,7 +36,7 @@ "execStats" : { }, - "ts" : ISODate("2017-09-05T19:39:41.753Z"), + "ts" : ISODate("2017-10-15T01:54:32.931Z"), "client" : "127.0.0.1", "allUsers" : [ ], "user" : "" diff --git a/src/go/tests/doc/out/explain_3.4.7 b/src/go/tests/doc/out/explain_3.4.7 index 748d51be..75e82c10 100644 --- a/src/go/tests/doc/out/explain_3.4.7 +++ b/src/go/tests/doc/out/explain_3.4.7 @@ -31,7 +31,7 @@ "responseLength" : 328, "protocol" : "op_command", "millis" : 0, - "ts" : ISODate("2017-09-05T19:39:49.065Z"), + "ts" : ISODate("2017-10-15T01:54:43.427Z"), "client" : "127.0.0.1", "appName" : "MongoDB Shell", "allUsers" : [ ], diff --git a/src/go/tests/doc/out/explain_3.5.11 b/src/go/tests/doc/out/explain_3.5.11 index 7b23d107..aac05929 100644 --- a/src/go/tests/doc/out/explain_3.5.11 +++ b/src/go/tests/doc/out/explain_3.5.11 @@ -32,7 +32,7 @@ "responseLength" : 329, "protocol" : "op_msg", "millis" : 0, - "ts" : ISODate("2017-09-05T19:40:00.433Z"), + "ts" : ISODate("2017-10-15T01:54:54.257Z"), "client" : "127.0.0.1", "appName" : "MongoDB Shell", "allUsers" : [ ], diff --git a/src/go/tests/doc/out/find_2.6.12 b/src/go/tests/doc/out/find_2.6.12 index 6f9bc85f..77a18f4e 100644 --- a/src/go/tests/doc/out/find_2.6.12 +++ b/src/go/tests/doc/out/find_2.6.12 @@ -2,34 +2,34 @@ "op" : "query", "ns" : "test.coll", "query" : { - "a" : 1 + "k" : 1 }, "ntoreturn" : 0, "ntoskip" : 0, - "nscanned" : 6, - "nscannedObjects" : 6, + "nscanned" : 2, + "nscannedObjects" : 2, "keyUpdates" : 0, "numYield" : 0, "lockStats" : { "timeLockedMicros" : { - "r" : NumberLong(231), + "r" : NumberLong(213), "w" : NumberLong(0) }, "timeAcquiringMicros" : { - "r" : NumberLong(2), - "w" : NumberLong(26) + "r" : NumberLong(38), + "w" : NumberLong(3) } }, - "nreturned" : 6, - "responseLength" : 251, + "nreturned" : 2, + "responseLength" : 86, "millis" : 0, "execStats" : { "type" : "FETCH", - "works" : 7, + "works" : 3, "yields" : 0, "unyields" : 0, "invalidates" : 0, - "advanced" : 6, + "advanced" : 2, "needTime" : 0, "needFetch" : 0, "isEOF" : 1, @@ -39,28 +39,28 @@ "children" : [ { "type" : "IXSCAN", - "works" : 7, + "works" : 3, "yields" : 0, "unyields" : 0, "invalidates" : 0, - "advanced" : 6, + "advanced" : 2, "needTime" : 0, "needFetch" : 0, "isEOF" : 1, - "keyPattern" : "{ a: 1.0 }", + "keyPattern" : "{ k: 1.0 }", "isMultiKey" : 0, - "boundsVerbose" : "field #0['a']: [1.0, 1.0]", + "boundsVerbose" : "field #0['k']: [1.0, 1.0]", "yieldMovedCursor" : 0, "dupsTested" : 0, "dupsDropped" : 0, "seenInvalidated" : 0, "matchTested" : 0, - "keysExamined" : 6, + "keysExamined" : 2, "children" : [ ] } ] }, - "ts" : ISODate("2017-08-20T15:39:15.457Z"), + "ts" : ISODate("2017-10-15T01:54:10.277Z"), "client" : "127.0.0.1", "allUsers" : [ ], "user" : "" diff --git a/src/go/tests/doc/out/find_3.0.15 b/src/go/tests/doc/out/find_3.0.15 index 6549dad5..17470b31 100644 --- a/src/go/tests/doc/out/find_3.0.15 +++ b/src/go/tests/doc/out/find_3.0.15 @@ -2,12 +2,12 @@ "op" : "query", "ns" : "test.coll", "query" : { - "a" : 1 + "k" : 1 }, "ntoreturn" : 0, "ntoskip" : 0, - "nscanned" : 6, - "nscannedObjects" : 6, + "nscanned" : 2, + "nscannedObjects" : 2, "keyUpdates" : 0, "writeConflicts" : 0, "numYield" : 0, @@ -33,29 +33,29 @@ } } }, - "nreturned" : 6, - "responseLength" : 251, + "nreturned" : 2, + "responseLength" : 86, "millis" : 0, "execStats" : { "stage" : "FETCH", - "nReturned" : 6, + "nReturned" : 2, "executionTimeMillisEstimate" : 0, - "works" : 7, - "advanced" : 6, + "works" : 3, + "advanced" : 2, "needTime" : 0, "needFetch" : 0, "saveState" : 0, "restoreState" : 0, "isEOF" : 1, "invalidates" : 0, - "docsExamined" : 6, + "docsExamined" : 2, "alreadyHasObj" : 0, "inputStage" : { "stage" : "IXSCAN", - "nReturned" : 6, + "nReturned" : 2, "executionTimeMillisEstimate" : 0, - "works" : 7, - "advanced" : 6, + "works" : 3, + "advanced" : 2, "needTime" : 0, "needFetch" : 0, "saveState" : 0, @@ -63,24 +63,24 @@ "isEOF" : 1, "invalidates" : 0, "keyPattern" : { - "a" : 1 + "k" : 1 }, - "indexName" : "a_1", + "indexName" : "k_1", "isMultiKey" : false, "direction" : "forward", "indexBounds" : { - "a" : [ + "k" : [ "[1.0, 1.0]" ] }, - "keysExamined" : 6, + "keysExamined" : 2, "dupsTested" : 0, "dupsDropped" : 0, "seenInvalidated" : 0, "matchTested" : 0 } }, - "ts" : ISODate("2017-08-20T15:39:21.515Z"), + "ts" : ISODate("2017-10-15T01:54:19.953Z"), "client" : "127.0.0.1", "allUsers" : [ ], "user" : "" diff --git a/src/go/tests/doc/out/find_3.2.16 b/src/go/tests/doc/out/find_3.2.16 index fd84c5d1..dd0ff3c6 100644 --- a/src/go/tests/doc/out/find_3.2.16 +++ b/src/go/tests/doc/out/find_3.2.16 @@ -4,11 +4,11 @@ "query" : { "find" : "coll", "filter" : { - "a" : 1 + "k" : 1 } }, - "keysExamined" : 6, - "docsExamined" : 6, + "keysExamined" : 2, + "docsExamined" : 2, "cursorExhausted" : true, "keyUpdates" : 0, "writeConflicts" : 0, @@ -30,30 +30,30 @@ } } }, - "nreturned" : 6, - "responseLength" : 349, + "nreturned" : 2, + "responseLength" : 172, "protocol" : "op_command", - "millis" : 0, + "millis" : 1, "execStats" : { "stage" : "FETCH", - "nReturned" : 6, + "nReturned" : 2, "executionTimeMillisEstimate" : 0, - "works" : 7, - "advanced" : 6, + "works" : 3, + "advanced" : 2, "needTime" : 0, "needYield" : 0, "saveState" : 0, "restoreState" : 0, "isEOF" : 1, "invalidates" : 0, - "docsExamined" : 6, + "docsExamined" : 2, "alreadyHasObj" : 0, "inputStage" : { "stage" : "IXSCAN", - "nReturned" : 6, + "nReturned" : 2, "executionTimeMillisEstimate" : 0, - "works" : 7, - "advanced" : 6, + "works" : 3, + "advanced" : 2, "needTime" : 0, "needYield" : 0, "saveState" : 0, @@ -61,9 +61,9 @@ "isEOF" : 1, "invalidates" : 0, "keyPattern" : { - "a" : 1 + "k" : 1 }, - "indexName" : "a_1", + "indexName" : "k_1", "isMultiKey" : false, "isUnique" : false, "isSparse" : false, @@ -71,17 +71,17 @@ "indexVersion" : 1, "direction" : "forward", "indexBounds" : { - "a" : [ + "k" : [ "[1.0, 1.0]" ] }, - "keysExamined" : 6, + "keysExamined" : 2, "dupsTested" : 0, "dupsDropped" : 0, "seenInvalidated" : 0 } }, - "ts" : ISODate("2017-08-20T15:39:30.913Z"), + "ts" : ISODate("2017-10-15T01:54:33.179Z"), "client" : "127.0.0.1", "allUsers" : [ ], "user" : "" diff --git a/src/go/tests/doc/out/find_3.4.7 b/src/go/tests/doc/out/find_3.4.7 index 56512835..49d13b7c 100644 --- a/src/go/tests/doc/out/find_3.4.7 +++ b/src/go/tests/doc/out/find_3.4.7 @@ -4,11 +4,11 @@ "query" : { "find" : "coll", "filter" : { - "a" : 1 + "k" : 1 } }, - "keysExamined" : 6, - "docsExamined" : 6, + "keysExamined" : 2, + "docsExamined" : 2, "cursorExhausted" : true, "numYield" : 0, "locks" : { @@ -28,31 +28,31 @@ } } }, - "nreturned" : 6, - "responseLength" : 331, + "nreturned" : 2, + "responseLength" : 154, "protocol" : "op_command", "millis" : 0, - "planSummary" : "IXSCAN { a: 1 }", + "planSummary" : "IXSCAN { k: 1 }", "execStats" : { "stage" : "FETCH", - "nReturned" : 6, + "nReturned" : 2, "executionTimeMillisEstimate" : 0, - "works" : 7, - "advanced" : 6, + "works" : 3, + "advanced" : 2, "needTime" : 0, "needYield" : 0, "saveState" : 0, "restoreState" : 0, "isEOF" : 1, "invalidates" : 0, - "docsExamined" : 6, + "docsExamined" : 2, "alreadyHasObj" : 0, "inputStage" : { "stage" : "IXSCAN", - "nReturned" : 6, + "nReturned" : 2, "executionTimeMillisEstimate" : 0, - "works" : 7, - "advanced" : 6, + "works" : 3, + "advanced" : 2, "needTime" : 0, "needYield" : 0, "saveState" : 0, @@ -60,12 +60,12 @@ "isEOF" : 1, "invalidates" : 0, "keyPattern" : { - "a" : 1 + "k" : 1 }, - "indexName" : "a_1", + "indexName" : "k_1", "isMultiKey" : false, "multiKeyPaths" : { - "a" : [ ] + "k" : [ ] }, "isUnique" : false, "isSparse" : false, @@ -73,18 +73,18 @@ "indexVersion" : 2, "direction" : "forward", "indexBounds" : { - "a" : [ + "k" : [ "[1.0, 1.0]" ] }, - "keysExamined" : 6, + "keysExamined" : 2, "seeks" : 1, "dupsTested" : 0, "dupsDropped" : 0, "seenInvalidated" : 0 } }, - "ts" : ISODate("2017-08-20T15:39:37.660Z"), + "ts" : ISODate("2017-10-15T01:54:43.713Z"), "client" : "127.0.0.1", "appName" : "MongoDB Shell", "allUsers" : [ ], diff --git a/src/go/tests/doc/out/find_3.5.11 b/src/go/tests/doc/out/find_3.5.11 index f81a7832..05790ee6 100644 --- a/src/go/tests/doc/out/find_3.5.11 +++ b/src/go/tests/doc/out/find_3.5.11 @@ -4,12 +4,12 @@ "command" : { "find" : "coll", "filter" : { - "a" : 1 + "k" : 1 }, "$db" : "test" }, - "keysExamined" : 6, - "docsExamined" : 6, + "keysExamined" : 2, + "docsExamined" : 2, "cursorExhausted" : true, "numYield" : 0, "locks" : { @@ -29,31 +29,31 @@ } } }, - "nreturned" : 6, - "responseLength" : 331, + "nreturned" : 2, + "responseLength" : 154, "protocol" : "op_msg", - "millis" : 1, - "planSummary" : "IXSCAN { a: 1 }", + "millis" : 0, + "planSummary" : "IXSCAN { k: 1 }", "execStats" : { "stage" : "FETCH", - "nReturned" : 6, + "nReturned" : 2, "executionTimeMillisEstimate" : 0, - "works" : 7, - "advanced" : 6, + "works" : 3, + "advanced" : 2, "needTime" : 0, "needYield" : 0, "saveState" : 0, "restoreState" : 0, "isEOF" : 1, "invalidates" : 0, - "docsExamined" : 6, + "docsExamined" : 2, "alreadyHasObj" : 0, "inputStage" : { "stage" : "IXSCAN", - "nReturned" : 6, + "nReturned" : 2, "executionTimeMillisEstimate" : 0, - "works" : 7, - "advanced" : 6, + "works" : 3, + "advanced" : 2, "needTime" : 0, "needYield" : 0, "saveState" : 0, @@ -61,12 +61,12 @@ "isEOF" : 1, "invalidates" : 0, "keyPattern" : { - "a" : 1 + "k" : 1 }, - "indexName" : "a_1", + "indexName" : "k_1", "isMultiKey" : false, "multiKeyPaths" : { - "a" : [ ] + "k" : [ ] }, "isUnique" : false, "isSparse" : false, @@ -74,18 +74,18 @@ "indexVersion" : 2, "direction" : "forward", "indexBounds" : { - "a" : [ + "k" : [ "[1.0, 1.0]" ] }, - "keysExamined" : 6, + "keysExamined" : 2, "seeks" : 1, "dupsTested" : 0, "dupsDropped" : 0, "seenInvalidated" : 0 } }, - "ts" : ISODate("2017-08-20T15:39:48.107Z"), + "ts" : ISODate("2017-10-15T01:54:54.507Z"), "client" : "127.0.0.1", "appName" : "MongoDB Shell", "allUsers" : [ ], diff --git a/src/go/tests/doc/out/find_andrii_2.6.12 b/src/go/tests/doc/out/find_andrii_2.6.12 index eca32e6b..f57c1f0e 100644 --- a/src/go/tests/doc/out/find_andrii_2.6.12 +++ b/src/go/tests/doc/out/find_andrii_2.6.12 @@ -46,100 +46,27 @@ }, "ntoreturn" : 100, "ntoskip" : 0, - "nscanned" : 98, - "nscannedObjects" : 98, + "nscanned" : 0, + "nscannedObjects" : 0, "keyUpdates" : 0, "numYield" : 0, "lockStats" : { "timeLockedMicros" : { - "r" : NumberLong(951), + "r" : NumberLong(298), "w" : NumberLong(0) }, "timeAcquiringMicros" : { - "r" : NumberLong(3), - "w" : NumberLong(2) + "r" : NumberLong(5), + "w" : NumberLong(50) } }, "nreturned" : 0, "responseLength" : 20, "millis" : 0, "execStats" : { - "type" : "OR", - "works" : 106, - "yields" : 0, - "unyields" : 0, - "invalidates" : 0, - "advanced" : 0, - "needTime" : 105, - "needFetch" : 0, - "isEOF" : 1, - "dupsTested" : 0, - "dupsDropped" : 0, - "locsForgotten" : 0, - "matchTested_0" : 0, - "matchTested_1" : 0, - "children" : [ - { - "type" : "SORT", - "works" : 53, - "yields" : 0, - "unyields" : 0, - "invalidates" : 0, - "advanced" : 0, - "needTime" : 51, - "needFetch" : 0, - "isEOF" : 1, - "forcedFetches" : 0, - "memUsage" : 0, - "memLimit" : 33554432, - "children" : [ - { - "type" : "COLLSCAN", - "works" : 51, - "yields" : 0, - "unyields" : 0, - "invalidates" : 0, - "advanced" : 0, - "needTime" : 50, - "needFetch" : 0, - "isEOF" : 1, - "docsTested" : 49, - "children" : [ ] - } - ] - }, - { - "type" : "SORT", - "works" : 53, - "yields" : 0, - "unyields" : 0, - "invalidates" : 0, - "advanced" : 0, - "needTime" : 51, - "needFetch" : 0, - "isEOF" : 1, - "forcedFetches" : 0, - "memUsage" : 0, - "memLimit" : 33554432, - "children" : [ - { - "type" : "COLLSCAN", - "works" : 51, - "yields" : 0, - "unyields" : 0, - "invalidates" : 0, - "advanced" : 0, - "needTime" : 50, - "needFetch" : 0, - "isEOF" : 1, - "docsTested" : 49, - "children" : [ ] - } - ] - } - ] + }, - "ts" : ISODate("2017-08-20T15:39:15.616Z"), + "ts" : ISODate("2017-10-15T01:54:10.474Z"), "client" : "127.0.0.1", "allUsers" : [ ], "user" : "" diff --git a/src/go/tests/doc/out/find_andrii_3.0.15 b/src/go/tests/doc/out/find_andrii_3.0.15 index ece88829..b4f9de3b 100644 --- a/src/go/tests/doc/out/find_andrii_3.0.15 +++ b/src/go/tests/doc/out/find_andrii_3.0.15 @@ -47,8 +47,7 @@ "ntoreturn" : 100, "ntoskip" : 0, "nscanned" : 0, - "nscannedObjects" : 98, - "scanAndOrder" : true, + "nscannedObjects" : 0, "keyUpdates" : 0, "writeConflicts" : 0, "numYield" : 0, @@ -78,169 +77,19 @@ "responseLength" : 20, "millis" : 0, "execStats" : { - "stage" : "OR", + "stage" : "EOF", "nReturned" : 0, "executionTimeMillisEstimate" : 0, - "works" : 106, + "works" : 1, "advanced" : 0, - "needTime" : 105, + "needTime" : 0, "needFetch" : 0, "saveState" : 0, "restoreState" : 0, "isEOF" : 1, - "invalidates" : 0, - "dupsTested" : 0, - "dupsDropped" : 0, - "locsForgotten" : 0, - "matchTested_0" : 0, - "matchTested_1" : 0, - "inputStages" : [ - { - "stage" : "SORT", - "nReturned" : 0, - "executionTimeMillisEstimate" : 0, - "works" : 53, - "advanced" : 0, - "needTime" : 51, - "needFetch" : 0, - "saveState" : 0, - "restoreState" : 0, - "isEOF" : 1, - "invalidates" : 0, - "sortPattern" : { - "k" : -1 - }, - "memUsage" : 0, - "memLimit" : 33554432, - "limitAmount" : 100, - "inputStage" : { - "stage" : "COLLSCAN", - "filter" : { - "$and" : [ - { - "$or" : [ - { - "c" : { - "$in" : [ - /^0/, - /^2/, - /^4/, - /^6/ - ] - } - }, - { - "pad" : { - "$in" : [ - /9$/, - /7$/, - /5$/, - /3$/ - ] - } - } - ] - }, - { - "k" : { - "$lt" : 2 - } - }, - { - "k" : { - "$gt" : 1 - } - } - ] - }, - "nReturned" : 0, - "executionTimeMillisEstimate" : 0, - "works" : 51, - "advanced" : 0, - "needTime" : 50, - "needFetch" : 0, - "saveState" : 0, - "restoreState" : 0, - "isEOF" : 1, - "invalidates" : 0, - "direction" : "forward", - "docsExamined" : 49 - } - }, - { - "stage" : "SORT", - "nReturned" : 0, - "executionTimeMillisEstimate" : 0, - "works" : 53, - "advanced" : 0, - "needTime" : 51, - "needFetch" : 0, - "saveState" : 0, - "restoreState" : 0, - "isEOF" : 1, - "invalidates" : 0, - "sortPattern" : { - "k" : -1 - }, - "memUsage" : 0, - "memLimit" : 33554432, - "inputStage" : { - "stage" : "COLLSCAN", - "filter" : { - "$and" : [ - { - "$or" : [ - { - "c" : { - "$in" : [ - /^0/, - /^2/, - /^4/, - /^6/ - ] - } - }, - { - "pad" : { - "$in" : [ - /9$/, - /7$/, - /5$/, - /3$/ - ] - } - } - ] - }, - { - "k" : { - "$lt" : 2 - } - }, - { - "k" : { - "$gt" : 1 - } - } - ] - }, - "nReturned" : 0, - "executionTimeMillisEstimate" : 0, - "works" : 51, - "advanced" : 0, - "needTime" : 50, - "needFetch" : 0, - "saveState" : 0, - "restoreState" : 0, - "isEOF" : 1, - "invalidates" : 0, - "direction" : "forward", - "docsExamined" : 49 - } - } - ] + "invalidates" : 0 }, - "ts" : ISODate("2017-08-20T15:39:21.656Z"), + "ts" : ISODate("2017-10-15T01:54:20.111Z"), "client" : "127.0.0.1", "allUsers" : [ ], "user" : "" diff --git a/src/go/tests/doc/out/find_andrii_3.2.16 b/src/go/tests/doc/out/find_andrii_3.2.16 index 91d6e62a..e567fa74 100644 --- a/src/go/tests/doc/out/find_andrii_3.2.16 +++ b/src/go/tests/doc/out/find_andrii_3.2.16 @@ -48,8 +48,7 @@ } }, "keysExamined" : 0, - "docsExamined" : 49, - "hasSortStage" : true, + "docsExamined" : 0, "cursorExhausted" : true, "keyUpdates" : 0, "writeConflicts" : 0, @@ -76,91 +75,19 @@ "protocol" : "op_command", "millis" : 0, "execStats" : { - "stage" : "SORT", + "stage" : "EOF", "nReturned" : 0, "executionTimeMillisEstimate" : 0, - "works" : 53, + "works" : 0, "advanced" : 0, - "needTime" : 52, + "needTime" : 0, "needYield" : 0, "saveState" : 0, "restoreState" : 0, "isEOF" : 1, - "invalidates" : 0, - "sortPattern" : { - "k" : -1 - }, - "memUsage" : 0, - "memLimit" : 33554432, - "limitAmount" : 100, - "inputStage" : { - "stage" : "SORT_KEY_GENERATOR", - "nReturned" : 0, - "executionTimeMillisEstimate" : 0, - "works" : 52, - "advanced" : 0, - "needTime" : 51, - "needYield" : 0, - "saveState" : 0, - "restoreState" : 0, - "isEOF" : 1, - "invalidates" : 0, - "inputStage" : { - "stage" : "COLLSCAN", - "filter" : { - "$and" : [ - { - "$or" : [ - { - "c" : { - "$in" : [ - /^0/, - /^2/, - /^4/, - /^6/ - ] - } - }, - { - "pad" : { - "$in" : [ - /9$/, - /7$/, - /5$/, - /3$/ - ] - } - } - ] - }, - { - "k" : { - "$lt" : 2 - } - }, - { - "k" : { - "$gt" : 1 - } - } - ] - }, - "nReturned" : 0, - "executionTimeMillisEstimate" : 0, - "works" : 51, - "advanced" : 0, - "needTime" : 50, - "needYield" : 0, - "saveState" : 0, - "restoreState" : 0, - "isEOF" : 1, - "invalidates" : 0, - "direction" : "forward", - "docsExamined" : 49 - } - } + "invalidates" : 0 }, - "ts" : ISODate("2017-08-20T15:39:31.085Z"), + "ts" : ISODate("2017-10-15T01:54:33.358Z"), "client" : "127.0.0.1", "allUsers" : [ ], "user" : "" diff --git a/src/go/tests/doc/out/find_andrii_3.4.7 b/src/go/tests/doc/out/find_andrii_3.4.7 index ba079ebd..ff5b6654 100644 --- a/src/go/tests/doc/out/find_andrii_3.4.7 +++ b/src/go/tests/doc/out/find_andrii_3.4.7 @@ -48,8 +48,7 @@ } }, "keysExamined" : 0, - "docsExamined" : 49, - "hasSortStage" : true, + "docsExamined" : 0, "cursorExhausted" : true, "numYield" : 0, "locks" : { @@ -73,93 +72,21 @@ "responseLength" : 82, "protocol" : "op_command", "millis" : 0, - "planSummary" : "COLLSCAN", + "planSummary" : "EOF", "execStats" : { - "stage" : "SORT", + "stage" : "EOF", "nReturned" : 0, "executionTimeMillisEstimate" : 0, - "works" : 53, + "works" : 0, "advanced" : 0, - "needTime" : 52, + "needTime" : 0, "needYield" : 0, "saveState" : 0, "restoreState" : 0, "isEOF" : 1, - "invalidates" : 0, - "sortPattern" : { - "k" : -1 - }, - "memUsage" : 0, - "memLimit" : 33554432, - "limitAmount" : 100, - "inputStage" : { - "stage" : "SORT_KEY_GENERATOR", - "nReturned" : 0, - "executionTimeMillisEstimate" : 0, - "works" : 52, - "advanced" : 0, - "needTime" : 51, - "needYield" : 0, - "saveState" : 0, - "restoreState" : 0, - "isEOF" : 1, - "invalidates" : 0, - "inputStage" : { - "stage" : "COLLSCAN", - "filter" : { - "$and" : [ - { - "$or" : [ - { - "c" : { - "$in" : [ - /^0/, - /^2/, - /^4/, - /^6/ - ] - } - }, - { - "pad" : { - "$in" : [ - /9$/, - /7$/, - /5$/, - /3$/ - ] - } - } - ] - }, - { - "k" : { - "$lt" : 2 - } - }, - { - "k" : { - "$gt" : 1 - } - } - ] - }, - "nReturned" : 0, - "executionTimeMillisEstimate" : 0, - "works" : 51, - "advanced" : 0, - "needTime" : 50, - "needYield" : 0, - "saveState" : 0, - "restoreState" : 0, - "isEOF" : 1, - "invalidates" : 0, - "direction" : "forward", - "docsExamined" : 49 - } - } + "invalidates" : 0 }, - "ts" : ISODate("2017-08-20T15:39:37.823Z"), + "ts" : ISODate("2017-10-15T01:54:43.922Z"), "client" : "127.0.0.1", "appName" : "MongoDB Shell", "allUsers" : [ ], diff --git a/src/go/tests/doc/out/find_andrii_3.5.11 b/src/go/tests/doc/out/find_andrii_3.5.11 index b2a38573..d5d08a79 100644 --- a/src/go/tests/doc/out/find_andrii_3.5.11 +++ b/src/go/tests/doc/out/find_andrii_3.5.11 @@ -49,8 +49,7 @@ "$db" : "test" }, "keysExamined" : 0, - "docsExamined" : 49, - "hasSortStage" : true, + "docsExamined" : 0, "cursorExhausted" : true, "numYield" : 0, "locks" : { @@ -74,93 +73,21 @@ "responseLength" : 82, "protocol" : "op_msg", "millis" : 0, - "planSummary" : "COLLSCAN", + "planSummary" : "EOF", "execStats" : { - "stage" : "SORT", + "stage" : "EOF", "nReturned" : 0, "executionTimeMillisEstimate" : 0, - "works" : 53, + "works" : 0, "advanced" : 0, - "needTime" : 52, + "needTime" : 0, "needYield" : 0, "saveState" : 0, "restoreState" : 0, "isEOF" : 1, - "invalidates" : 0, - "sortPattern" : { - "k" : -1 - }, - "memUsage" : 0, - "memLimit" : 33554432, - "limitAmount" : 100, - "inputStage" : { - "stage" : "SORT_KEY_GENERATOR", - "nReturned" : 0, - "executionTimeMillisEstimate" : 0, - "works" : 52, - "advanced" : 0, - "needTime" : 51, - "needYield" : 0, - "saveState" : 0, - "restoreState" : 0, - "isEOF" : 1, - "invalidates" : 0, - "inputStage" : { - "stage" : "COLLSCAN", - "filter" : { - "$and" : [ - { - "$or" : [ - { - "c" : { - "$in" : [ - /^0/, - /^2/, - /^4/, - /^6/ - ] - } - }, - { - "pad" : { - "$in" : [ - /9$/, - /7$/, - /5$/, - /3$/ - ] - } - } - ] - }, - { - "k" : { - "$lt" : 2 - } - }, - { - "k" : { - "$gt" : 1 - } - } - ] - }, - "nReturned" : 0, - "executionTimeMillisEstimate" : 0, - "works" : 51, - "advanced" : 0, - "needTime" : 50, - "needYield" : 0, - "saveState" : 0, - "restoreState" : 0, - "isEOF" : 1, - "invalidates" : 0, - "direction" : "forward", - "docsExamined" : 49 - } - } + "invalidates" : 0 }, - "ts" : ISODate("2017-08-20T15:39:48.277Z"), + "ts" : ISODate("2017-10-15T01:54:54.693Z"), "client" : "127.0.0.1", "appName" : "MongoDB Shell", "allUsers" : [ ], diff --git a/src/go/tests/doc/out/find_empty_2.6.12 b/src/go/tests/doc/out/find_empty_2.6.12 index 3d3a4728..06b76808 100644 --- a/src/go/tests/doc/out/find_empty_2.6.12 +++ b/src/go/tests/doc/out/find_empty_2.6.12 @@ -6,37 +6,27 @@ }, "ntoreturn" : 0, "ntoskip" : 0, - "nscanned" : 49, - "nscannedObjects" : 49, + "nscanned" : 0, + "nscannedObjects" : 0, "keyUpdates" : 0, "numYield" : 0, "lockStats" : { "timeLockedMicros" : { - "r" : NumberLong(65), + "r" : NumberLong(189), "w" : NumberLong(0) }, "timeAcquiringMicros" : { - "r" : NumberLong(9), - "w" : NumberLong(2) + "r" : NumberLong(14), + "w" : NumberLong(9) } }, - "nreturned" : 49, - "responseLength" : 1846, + "nreturned" : 0, + "responseLength" : 20, "millis" : 0, "execStats" : { - "type" : "COLLSCAN", - "works" : 51, - "yields" : 0, - "unyields" : 0, - "invalidates" : 0, - "advanced" : 49, - "needTime" : 1, - "needFetch" : 0, - "isEOF" : 1, - "docsTested" : 49, - "children" : [ ] + }, - "ts" : ISODate("2017-08-20T15:39:15.750Z"), + "ts" : ISODate("2017-10-15T01:54:10.630Z"), "client" : "127.0.0.1", "allUsers" : [ ], "user" : "" diff --git a/src/go/tests/doc/out/find_empty_3.0.15 b/src/go/tests/doc/out/find_empty_3.0.15 index 9747461d..4a05a498 100644 --- a/src/go/tests/doc/out/find_empty_3.0.15 +++ b/src/go/tests/doc/out/find_empty_3.0.15 @@ -7,7 +7,7 @@ "ntoreturn" : 0, "ntoskip" : 0, "nscanned" : 0, - "nscannedObjects" : 49, + "nscannedObjects" : 0, "keyUpdates" : 0, "writeConflicts" : 0, "numYield" : 0, @@ -33,28 +33,23 @@ } } }, - "nreturned" : 49, - "responseLength" : 1846, + "nreturned" : 0, + "responseLength" : 20, "millis" : 0, "execStats" : { - "stage" : "COLLSCAN", - "filter" : { - "$and" : [ ] - }, - "nReturned" : 49, + "stage" : "EOF", + "nReturned" : 0, "executionTimeMillisEstimate" : 0, - "works" : 51, - "advanced" : 49, - "needTime" : 1, + "works" : 1, + "advanced" : 0, + "needTime" : 0, "needFetch" : 0, "saveState" : 0, "restoreState" : 0, "isEOF" : 1, - "invalidates" : 0, - "direction" : "forward", - "docsExamined" : 49 + "invalidates" : 0 }, - "ts" : ISODate("2017-08-20T15:39:21.769Z"), + "ts" : ISODate("2017-10-15T01:54:20.246Z"), "client" : "127.0.0.1", "allUsers" : [ ], "user" : "" diff --git a/src/go/tests/doc/out/find_empty_3.2.16 b/src/go/tests/doc/out/find_empty_3.2.16 index 9d953ee0..9e06bc47 100644 --- a/src/go/tests/doc/out/find_empty_3.2.16 +++ b/src/go/tests/doc/out/find_empty_3.2.16 @@ -8,7 +8,7 @@ } }, "keysExamined" : 0, - "docsExamined" : 49, + "docsExamined" : 0, "cursorExhausted" : true, "keyUpdates" : 0, "writeConflicts" : 0, @@ -30,29 +30,24 @@ } } }, - "nreturned" : 49, - "responseLength" : 2112, + "nreturned" : 0, + "responseLength" : 100, "protocol" : "op_command", "millis" : 0, "execStats" : { - "stage" : "COLLSCAN", - "filter" : { - "$and" : [ ] - }, - "nReturned" : 49, + "stage" : "EOF", + "nReturned" : 0, "executionTimeMillisEstimate" : 0, - "works" : 51, - "advanced" : 49, - "needTime" : 1, + "works" : 0, + "advanced" : 0, + "needTime" : 0, "needYield" : 0, "saveState" : 0, "restoreState" : 0, "isEOF" : 1, - "invalidates" : 0, - "direction" : "forward", - "docsExamined" : 49 + "invalidates" : 0 }, - "ts" : ISODate("2017-08-20T15:39:31.294Z"), + "ts" : ISODate("2017-10-15T01:54:33.530Z"), "client" : "127.0.0.1", "allUsers" : [ ], "user" : "" diff --git a/src/go/tests/doc/out/find_empty_3.4.7 b/src/go/tests/doc/out/find_empty_3.4.7 index 09699967..770d2211 100644 --- a/src/go/tests/doc/out/find_empty_3.4.7 +++ b/src/go/tests/doc/out/find_empty_3.4.7 @@ -8,7 +8,7 @@ } }, "keysExamined" : 0, - "docsExamined" : 49, + "docsExamined" : 0, "cursorExhausted" : true, "numYield" : 0, "locks" : { @@ -28,27 +28,25 @@ } } }, - "nreturned" : 49, - "responseLength" : 2094, + "nreturned" : 0, + "responseLength" : 82, "protocol" : "op_command", "millis" : 0, - "planSummary" : "COLLSCAN", + "planSummary" : "EOF", "execStats" : { - "stage" : "COLLSCAN", - "nReturned" : 49, + "stage" : "EOF", + "nReturned" : 0, "executionTimeMillisEstimate" : 0, - "works" : 51, - "advanced" : 49, - "needTime" : 1, + "works" : 0, + "advanced" : 0, + "needTime" : 0, "needYield" : 0, "saveState" : 0, "restoreState" : 0, "isEOF" : 1, - "invalidates" : 0, - "direction" : "forward", - "docsExamined" : 49 + "invalidates" : 0 }, - "ts" : ISODate("2017-08-20T15:39:37.964Z"), + "ts" : ISODate("2017-10-15T01:54:44.129Z"), "client" : "127.0.0.1", "appName" : "MongoDB Shell", "allUsers" : [ ], diff --git a/src/go/tests/doc/out/find_empty_3.5.11 b/src/go/tests/doc/out/find_empty_3.5.11 index 608637f7..a7f5aa4e 100644 --- a/src/go/tests/doc/out/find_empty_3.5.11 +++ b/src/go/tests/doc/out/find_empty_3.5.11 @@ -9,7 +9,7 @@ "$db" : "test" }, "keysExamined" : 0, - "docsExamined" : 49, + "docsExamined" : 0, "cursorExhausted" : true, "numYield" : 0, "locks" : { @@ -29,27 +29,25 @@ } } }, - "nreturned" : 49, - "responseLength" : 2094, + "nreturned" : 0, + "responseLength" : 82, "protocol" : "op_msg", "millis" : 0, - "planSummary" : "COLLSCAN", + "planSummary" : "EOF", "execStats" : { - "stage" : "COLLSCAN", - "nReturned" : 49, + "stage" : "EOF", + "nReturned" : 0, "executionTimeMillisEstimate" : 0, - "works" : 51, - "advanced" : 49, - "needTime" : 1, + "works" : 0, + "advanced" : 0, + "needTime" : 0, "needYield" : 0, "saveState" : 0, "restoreState" : 0, "isEOF" : 1, - "invalidates" : 0, - "direction" : "forward", - "docsExamined" : 49 + "invalidates" : 0 }, - "ts" : ISODate("2017-08-20T15:39:48.429Z"), + "ts" : ISODate("2017-10-15T01:54:54.870Z"), "client" : "127.0.0.1", "appName" : "MongoDB Shell", "allUsers" : [ ], diff --git a/src/go/tests/doc/out/find_with_sort_2.6.12 b/src/go/tests/doc/out/find_with_sort_2.6.12 new file mode 100644 index 00000000..241ed57f --- /dev/null +++ b/src/go/tests/doc/out/find_with_sort_2.6.12 @@ -0,0 +1,102 @@ +{ + "op" : "query", + "ns" : "test.coll", + "query" : { + "query" : { + "c" : 1 + }, + "orderby" : { + "b" : -1 + } + }, + "ntoreturn" : 0, + "ntoskip" : 0, + "nscanned" : 2, + "nscannedObjects" : 2, + "scanAndOrder" : true, + "keyUpdates" : 0, + "numYield" : 0, + "lockStats" : { + "timeLockedMicros" : { + "r" : NumberLong(508), + "w" : NumberLong(0) + }, + "timeAcquiringMicros" : { + "r" : NumberLong(19), + "w" : NumberLong(38) + } + }, + "nreturned" : 2, + "responseLength" : 108, + "millis" : 0, + "execStats" : { + "type" : "SORT", + "works" : 7, + "yields" : 0, + "unyields" : 0, + "invalidates" : 0, + "advanced" : 2, + "needTime" : 3, + "needFetch" : 0, + "isEOF" : 1, + "forcedFetches" : 0, + "memUsage" : 104, + "memLimit" : 33554432, + "children" : [ + { + "type" : "KEEP_MUTATIONS", + "works" : 3, + "yields" : 0, + "unyields" : 0, + "invalidates" : 0, + "advanced" : 2, + "needTime" : 0, + "needFetch" : 0, + "isEOF" : 1, + "children" : [ + { + "type" : "FETCH", + "works" : 3, + "yields" : 0, + "unyields" : 0, + "invalidates" : 0, + "advanced" : 2, + "needTime" : 0, + "needFetch" : 0, + "isEOF" : 1, + "alreadyHasObj" : 0, + "forcedFetches" : 0, + "matchTested" : 0, + "children" : [ + { + "type" : "IXSCAN", + "works" : 3, + "yields" : 0, + "unyields" : 0, + "invalidates" : 0, + "advanced" : 2, + "needTime" : 0, + "needFetch" : 0, + "isEOF" : 1, + "keyPattern" : "{ c: 1.0 }", + "isMultiKey" : 0, + "boundsVerbose" : "field #0['c']: [1.0, 1.0]", + "yieldMovedCursor" : 0, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0, + "matchTested" : 0, + "keysExamined" : 2, + "children" : [ ] + } + ] + } + ] + } + ] + }, + "ts" : ISODate("2017-10-15T01:54:10.817Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/find_with_sort_3.0.15 b/src/go/tests/doc/out/find_with_sort_3.0.15 new file mode 100644 index 00000000..78dd4c31 --- /dev/null +++ b/src/go/tests/doc/out/find_with_sort_3.0.15 @@ -0,0 +1,124 @@ +{ + "op" : "query", + "ns" : "test.coll", + "query" : { + "query" : { + "c" : 1 + }, + "orderby" : { + "b" : -1 + } + }, + "ntoreturn" : 0, + "ntoskip" : 0, + "nscanned" : 2, + "nscannedObjects" : 2, + "scanAndOrder" : true, + "keyUpdates" : 0, + "writeConflicts" : 0, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(2) + } + }, + "MMAPV1Journal" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "R" : NumberLong(1) + } + } + }, + "nreturned" : 2, + "responseLength" : 108, + "millis" : 0, + "execStats" : { + "stage" : "SORT", + "nReturned" : 2, + "executionTimeMillisEstimate" : 0, + "works" : 7, + "advanced" : 2, + "needTime" : 3, + "needFetch" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "sortPattern" : { + "b" : -1 + }, + "memUsage" : 104, + "memLimit" : 33554432, + "inputStage" : { + "stage" : "KEEP_MUTATIONS", + "nReturned" : 2, + "executionTimeMillisEstimate" : 0, + "works" : 3, + "advanced" : 2, + "needTime" : 0, + "needFetch" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "inputStage" : { + "stage" : "FETCH", + "nReturned" : 2, + "executionTimeMillisEstimate" : 0, + "works" : 3, + "advanced" : 2, + "needTime" : 0, + "needFetch" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 2, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 2, + "executionTimeMillisEstimate" : 0, + "works" : 3, + "advanced" : 2, + "needTime" : 0, + "needFetch" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "c" : 1 + }, + "indexName" : "c_1", + "isMultiKey" : false, + "direction" : "forward", + "indexBounds" : { + "c" : [ + "[1.0, 1.0]" + ] + }, + "keysExamined" : 2, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0, + "matchTested" : 0 + } + } + } + }, + "ts" : ISODate("2017-10-15T01:54:20.410Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/find_with_sort_3.2.16 b/src/go/tests/doc/out/find_with_sort_3.2.16 new file mode 100644 index 00000000..7f03c790 --- /dev/null +++ b/src/go/tests/doc/out/find_with_sort_3.2.16 @@ -0,0 +1,123 @@ +{ + "op" : "query", + "ns" : "test.coll", + "query" : { + "find" : "coll", + "filter" : { + "c" : 1 + }, + "sort" : { + "b" : -1 + } + }, + "keysExamined" : 2, + "docsExamined" : 2, + "hasSortStage" : true, + "cursorExhausted" : true, + "keyUpdates" : 0, + "writeConflicts" : 0, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(2) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "r" : NumberLong(1) + } + } + }, + "nreturned" : 2, + "responseLength" : 194, + "protocol" : "op_command", + "millis" : 0, + "execStats" : { + "stage" : "SORT", + "nReturned" : 2, + "executionTimeMillisEstimate" : 0, + "works" : 7, + "advanced" : 2, + "needTime" : 4, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "sortPattern" : { + "b" : -1 + }, + "memUsage" : 104, + "memLimit" : 33554432, + "inputStage" : { + "stage" : "SORT_KEY_GENERATOR", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 4, + "advanced" : 0, + "needTime" : 1, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "inputStage" : { + "stage" : "FETCH", + "nReturned" : 2, + "executionTimeMillisEstimate" : 0, + "works" : 3, + "advanced" : 2, + "needTime" : 0, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 2, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 2, + "executionTimeMillisEstimate" : 0, + "works" : 3, + "advanced" : 2, + "needTime" : 0, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "c" : 1 + }, + "indexName" : "c_1", + "isMultiKey" : false, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 1, + "direction" : "forward", + "indexBounds" : { + "c" : [ + "[1.0, 1.0]" + ] + }, + "keysExamined" : 2, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + } + } + }, + "ts" : ISODate("2017-10-15T01:54:33.762Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/find_with_sort_3.4.7 b/src/go/tests/doc/out/find_with_sort_3.4.7 new file mode 100644 index 00000000..483ff0b2 --- /dev/null +++ b/src/go/tests/doc/out/find_with_sort_3.4.7 @@ -0,0 +1,127 @@ +{ + "op" : "query", + "ns" : "test.coll", + "query" : { + "find" : "coll", + "filter" : { + "c" : 1 + }, + "sort" : { + "b" : -1 + } + }, + "keysExamined" : 2, + "docsExamined" : 2, + "hasSortStage" : true, + "cursorExhausted" : true, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(2) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "r" : NumberLong(1) + } + } + }, + "nreturned" : 2, + "responseLength" : 176, + "protocol" : "op_command", + "millis" : 0, + "planSummary" : "IXSCAN { c: 1 }", + "execStats" : { + "stage" : "SORT", + "nReturned" : 2, + "executionTimeMillisEstimate" : 0, + "works" : 7, + "advanced" : 2, + "needTime" : 4, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "sortPattern" : { + "b" : -1 + }, + "memUsage" : 104, + "memLimit" : 33554432, + "inputStage" : { + "stage" : "SORT_KEY_GENERATOR", + "nReturned" : 2, + "executionTimeMillisEstimate" : 0, + "works" : 4, + "advanced" : 2, + "needTime" : 1, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "inputStage" : { + "stage" : "FETCH", + "nReturned" : 2, + "executionTimeMillisEstimate" : 0, + "works" : 3, + "advanced" : 2, + "needTime" : 0, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 2, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 2, + "executionTimeMillisEstimate" : 0, + "works" : 3, + "advanced" : 2, + "needTime" : 0, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "c" : 1 + }, + "indexName" : "c_1", + "isMultiKey" : false, + "multiKeyPaths" : { + "c" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "c" : [ + "[1.0, 1.0]" + ] + }, + "keysExamined" : 2, + "seeks" : 1, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + } + } + }, + "ts" : ISODate("2017-10-15T01:54:44.423Z"), + "client" : "127.0.0.1", + "appName" : "MongoDB Shell", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/find_with_sort_3.5.11 b/src/go/tests/doc/out/find_with_sort_3.5.11 new file mode 100644 index 00000000..4f9a85cc --- /dev/null +++ b/src/go/tests/doc/out/find_with_sort_3.5.11 @@ -0,0 +1,128 @@ +{ + "op" : "query", + "ns" : "test.coll", + "command" : { + "find" : "coll", + "filter" : { + "c" : 1 + }, + "sort" : { + "b" : -1 + }, + "$db" : "test" + }, + "keysExamined" : 2, + "docsExamined" : 2, + "hasSortStage" : true, + "cursorExhausted" : true, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(2) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "r" : NumberLong(1) + } + } + }, + "nreturned" : 2, + "responseLength" : 176, + "protocol" : "op_msg", + "millis" : 0, + "planSummary" : "IXSCAN { c: 1 }", + "execStats" : { + "stage" : "SORT", + "nReturned" : 2, + "executionTimeMillisEstimate" : 0, + "works" : 7, + "advanced" : 2, + "needTime" : 4, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "sortPattern" : { + "b" : -1 + }, + "memUsage" : 104, + "memLimit" : 33554432, + "inputStage" : { + "stage" : "SORT_KEY_GENERATOR", + "nReturned" : 2, + "executionTimeMillisEstimate" : 0, + "works" : 4, + "advanced" : 2, + "needTime" : 1, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "inputStage" : { + "stage" : "FETCH", + "nReturned" : 2, + "executionTimeMillisEstimate" : 0, + "works" : 3, + "advanced" : 2, + "needTime" : 0, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 2, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 2, + "executionTimeMillisEstimate" : 0, + "works" : 3, + "advanced" : 2, + "needTime" : 0, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "c" : 1 + }, + "indexName" : "c_1", + "isMultiKey" : false, + "multiKeyPaths" : { + "c" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "c" : [ + "[1.0, 1.0]" + ] + }, + "keysExamined" : 2, + "seeks" : 1, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + } + } + }, + "ts" : ISODate("2017-10-15T01:54:55.111Z"), + "client" : "127.0.0.1", + "appName" : "MongoDB Shell", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/findandmodify_2.6.12 b/src/go/tests/doc/out/findandmodify_2.6.12 index ee7a4657..51329dd4 100644 --- a/src/go/tests/doc/out/findandmodify_2.6.12 +++ b/src/go/tests/doc/out/findandmodify_2.6.12 @@ -26,19 +26,19 @@ "lockStats" : { "timeLockedMicros" : { "r" : NumberLong(0), - "w" : NumberLong(155) + "w" : NumberLong(465) }, "timeAcquiringMicros" : { "r" : NumberLong(0), - "w" : NumberLong(5) + "w" : NumberLong(18) } }, "responseLength" : 131, - "millis" : 0, + "millis" : 6, "execStats" : { }, - "ts" : ISODate("2017-08-20T15:39:15.903Z"), + "ts" : ISODate("2017-10-15T01:54:11.011Z"), "client" : "127.0.0.1", "allUsers" : [ ], "user" : "" diff --git a/src/go/tests/doc/out/findandmodify_3.0.15 b/src/go/tests/doc/out/findandmodify_3.0.15 index 8d5a3ea0..86d0d71f 100644 --- a/src/go/tests/doc/out/findandmodify_3.0.15 +++ b/src/go/tests/doc/out/findandmodify_3.0.15 @@ -52,7 +52,7 @@ "execStats" : { }, - "ts" : ISODate("2017-08-20T15:39:21.902Z"), + "ts" : ISODate("2017-10-15T01:54:20.581Z"), "client" : "127.0.0.1", "allUsers" : [ ], "user" : "" diff --git a/src/go/tests/doc/out/findandmodify_3.2.16 b/src/go/tests/doc/out/findandmodify_3.2.16 index 62a5c07e..a418ac52 100644 --- a/src/go/tests/doc/out/findandmodify_3.2.16 +++ b/src/go/tests/doc/out/findandmodify_3.2.16 @@ -44,11 +44,11 @@ }, "responseLength" : 116, "protocol" : "op_command", - "millis" : 0, + "millis" : 1, "execStats" : { }, - "ts" : ISODate("2017-08-20T15:39:31.548Z"), + "ts" : ISODate("2017-10-15T01:54:34.011Z"), "client" : "127.0.0.1", "allUsers" : [ ], "user" : "" diff --git a/src/go/tests/doc/out/findandmodify_3.4.7 b/src/go/tests/doc/out/findandmodify_3.4.7 index 88c74ca4..6a75f883 100644 --- a/src/go/tests/doc/out/findandmodify_3.4.7 +++ b/src/go/tests/doc/out/findandmodify_3.4.7 @@ -44,7 +44,7 @@ }, "responseLength" : 116, "protocol" : "op_command", - "millis" : 0, + "millis" : 1, "planSummary" : "COLLSCAN", "execStats" : { "stage" : "UPDATE", @@ -84,7 +84,7 @@ "docsExamined" : 3 } }, - "ts" : ISODate("2017-08-20T15:39:38.196Z"), + "ts" : ISODate("2017-10-15T01:54:44.656Z"), "client" : "127.0.0.1", "appName" : "MongoDB Shell", "allUsers" : [ ], diff --git a/src/go/tests/doc/out/findandmodify_3.5.11 b/src/go/tests/doc/out/findandmodify_3.5.11 index 93c970ef..728a8f43 100644 --- a/src/go/tests/doc/out/findandmodify_3.5.11 +++ b/src/go/tests/doc/out/findandmodify_3.5.11 @@ -40,7 +40,7 @@ }, "responseLength" : 116, "protocol" : "op_msg", - "millis" : 0, + "millis" : 1, "planSummary" : "COLLSCAN", "execStats" : { "stage" : "UPDATE", @@ -80,7 +80,7 @@ "docsExamined" : 3 } }, - "ts" : ISODate("2017-08-20T15:39:48.636Z"), + "ts" : ISODate("2017-10-15T01:54:55.391Z"), "client" : "127.0.0.1", "appName" : "MongoDB Shell", "allUsers" : [ ], diff --git a/src/go/tests/doc/out/geonear_2.6.12 b/src/go/tests/doc/out/geonear_2.6.12 index 1d63c6e5..d87925c5 100644 --- a/src/go/tests/doc/out/geonear_2.6.12 +++ b/src/go/tests/doc/out/geonear_2.6.12 @@ -16,12 +16,12 @@ "numYield" : 0, "lockStats" : { "timeLockedMicros" : { - "r" : NumberLong(1851), + "r" : NumberLong(1945), "w" : NumberLong(0) }, "timeAcquiringMicros" : { - "r" : NumberLong(3), - "w" : NumberLong(3) + "r" : NumberLong(10), + "w" : NumberLong(10) } }, "responseLength" : 1406, @@ -29,7 +29,7 @@ "execStats" : { }, - "ts" : ISODate("2017-08-20T15:39:16.061Z"), + "ts" : ISODate("2017-10-15T01:54:11.181Z"), "client" : "127.0.0.1", "allUsers" : [ ], "user" : "" diff --git a/src/go/tests/doc/out/geonear_3.0.15 b/src/go/tests/doc/out/geonear_3.0.15 index 236a1e58..234e7389 100644 --- a/src/go/tests/doc/out/geonear_3.0.15 +++ b/src/go/tests/doc/out/geonear_3.0.15 @@ -38,11 +38,11 @@ } }, "responseLength" : 1398, - "millis" : 3, + "millis" : 2, "execStats" : { }, - "ts" : ISODate("2017-08-20T15:39:22.055Z"), + "ts" : ISODate("2017-10-15T01:54:20.751Z"), "client" : "127.0.0.1", "allUsers" : [ ], "user" : "" diff --git a/src/go/tests/doc/out/geonear_3.2.16 b/src/go/tests/doc/out/geonear_3.2.16 index 08279c1b..72c8f711 100644 --- a/src/go/tests/doc/out/geonear_3.2.16 +++ b/src/go/tests/doc/out/geonear_3.2.16 @@ -34,11 +34,11 @@ }, "responseLength" : 1401, "protocol" : "op_command", - "millis" : 8, + "millis" : 10, "execStats" : { }, - "ts" : ISODate("2017-08-20T15:39:31.797Z"), + "ts" : ISODate("2017-10-15T01:54:34.270Z"), "client" : "127.0.0.1", "allUsers" : [ ], "user" : "" diff --git a/src/go/tests/doc/out/geonear_3.4.7 b/src/go/tests/doc/out/geonear_3.4.7 index 574ae61a..7892287e 100644 --- a/src/go/tests/doc/out/geonear_3.4.7 +++ b/src/go/tests/doc/out/geonear_3.4.7 @@ -34,12 +34,12 @@ }, "responseLength" : 1383, "protocol" : "op_command", - "millis" : 11, + "millis" : 13, "planSummary" : "GEO_NEAR_2DSPHERE { loc: \"2dsphere\" }", "execStats" : { "stage" : "LIMIT", "nReturned" : 10, - "executionTimeMillisEstimate" : 0, + "executionTimeMillisEstimate" : 10, "works" : 139, "advanced" : 10, "needTime" : 128, @@ -52,7 +52,7 @@ "inputStage" : { "stage" : "PROJECTION", "nReturned" : 10, - "executionTimeMillisEstimate" : 0, + "executionTimeMillisEstimate" : 10, "works" : 139, "advanced" : 10, "needTime" : 128, @@ -72,7 +72,7 @@ "inputStage" : { "stage" : "GEO_NEAR_2DSPHERE", "nReturned" : 10, - "executionTimeMillisEstimate" : 0, + "executionTimeMillisEstimate" : 10, "works" : 139, "advanced" : 10, "needTime" : 128, @@ -3557,7 +3557,7 @@ } } }, - "ts" : ISODate("2017-08-20T15:39:38.432Z"), + "ts" : ISODate("2017-10-15T01:54:44.873Z"), "client" : "127.0.0.1", "appName" : "MongoDB Shell", "allUsers" : [ ], diff --git a/src/go/tests/doc/out/geonear_3.5.11 b/src/go/tests/doc/out/geonear_3.5.11 index 8d9b532f..57fece10 100644 --- a/src/go/tests/doc/out/geonear_3.5.11 +++ b/src/go/tests/doc/out/geonear_3.5.11 @@ -35,7 +35,7 @@ }, "responseLength" : 1383, "protocol" : "op_msg", - "millis" : 7, + "millis" : 11, "planSummary" : "GEO_NEAR_2DSPHERE { loc: \"2dsphere\" }", "execStats" : { "stage" : "LIMIT", @@ -73,7 +73,7 @@ "inputStage" : { "stage" : "GEO_NEAR_2DSPHERE", "nReturned" : 10, - "executionTimeMillisEstimate" : 10, + "executionTimeMillisEstimate" : 0, "works" : 139, "advanced" : 10, "needTime" : 128, @@ -3558,7 +3558,7 @@ } } }, - "ts" : ISODate("2017-08-20T15:39:48.842Z"), + "ts" : ISODate("2017-10-15T01:54:55.701Z"), "client" : "127.0.0.1", "appName" : "MongoDB Shell", "allUsers" : [ ], diff --git a/src/go/tests/doc/out/getmore_2.6.12 b/src/go/tests/doc/out/getmore_2.6.12 new file mode 100644 index 00000000..d50c6fdc --- /dev/null +++ b/src/go/tests/doc/out/getmore_2.6.12 @@ -0,0 +1,33 @@ +{ + "op" : "getmore", + "ns" : "test.coll", + "query" : { + "a" : { + "$gt" : 0 + } + }, + "cursorid" : 73529665157, + "ntoreturn" : 2, + "keyUpdates" : 0, + "numYield" : 0, + "lockStats" : { + "timeLockedMicros" : { + "r" : NumberLong(29), + "w" : NumberLong(0) + }, + "timeAcquiringMicros" : { + "r" : NumberLong(5), + "w" : NumberLong(4) + } + }, + "nreturned" : 2, + "responseLength" : 86, + "millis" : 0, + "execStats" : { + + }, + "ts" : ISODate("2017-10-15T01:54:11.360Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/getmore_3.0.15 b/src/go/tests/doc/out/getmore_3.0.15 new file mode 100644 index 00000000..59da152c --- /dev/null +++ b/src/go/tests/doc/out/getmore_3.0.15 @@ -0,0 +1,46 @@ +{ + "op" : "getmore", + "ns" : "test.coll", + "query" : { + "a" : { + "$gt" : 0 + } + }, + "cursorid" : 77879406118, + "ntoreturn" : 2, + "keyUpdates" : 0, + "writeConflicts" : 0, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(2) + } + }, + "MMAPV1Journal" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "R" : NumberLong(1) + } + } + }, + "nreturned" : 0, + "responseLength" : 20, + "millis" : 0, + "execStats" : { + + }, + "ts" : ISODate("2017-10-15T01:54:20.995Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/getmore_3.2.16 b/src/go/tests/doc/out/getmore_3.2.16 new file mode 100644 index 00000000..b73ff90c --- /dev/null +++ b/src/go/tests/doc/out/getmore_3.2.16 @@ -0,0 +1,44 @@ +{ + "op" : "getmore", + "ns" : "test.coll", + "query" : { + "getMore" : NumberLong("62137702161"), + "collection" : "coll", + "batchSize" : 2 + }, + "cursorid" : 62137702161, + "keysExamined" : 0, + "docsExamined" : 0, + "cursorExhausted" : true, + "keyUpdates" : 0, + "writeConflicts" : 0, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(2) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "r" : NumberLong(1) + } + } + }, + "nreturned" : 0, + "responseLength" : 81, + "protocol" : "op_command", + "millis" : 0, + "execStats" : { + + }, + "ts" : ISODate("2017-10-15T01:54:34.569Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/getmore_3.4.7 b/src/go/tests/doc/out/getmore_3.4.7 new file mode 100644 index 00000000..b76612a8 --- /dev/null +++ b/src/go/tests/doc/out/getmore_3.4.7 @@ -0,0 +1,103 @@ +{ + "op" : "getmore", + "ns" : "test.coll", + "query" : { + "getMore" : NumberLong("66029137874"), + "collection" : "coll", + "batchSize" : 2 + }, + "originatingCommand" : { + "find" : "coll", + "filter" : { + "a" : { + "$gt" : 0 + } + }, + "batchSize" : 2, + "sort" : { + "a" : 1 + } + }, + "cursorid" : 66029137874, + "keysExamined" : 2, + "docsExamined" : 2, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(2) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "r" : NumberLong(1) + } + } + }, + "nreturned" : 2, + "responseLength" : 153, + "protocol" : "op_command", + "millis" : 0, + "planSummary" : "IXSCAN { a: 1 }", + "execStats" : { + "stage" : "FETCH", + "nReturned" : 8, + "executionTimeMillisEstimate" : 0, + "works" : 8, + "advanced" : 8, + "needTime" : 0, + "needYield" : 0, + "saveState" : 3, + "restoreState" : 3, + "isEOF" : 0, + "invalidates" : 0, + "docsExamined" : 8, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 8, + "executionTimeMillisEstimate" : 0, + "works" : 8, + "advanced" : 8, + "needTime" : 0, + "needYield" : 0, + "saveState" : 3, + "restoreState" : 3, + "isEOF" : 0, + "invalidates" : 0, + "keyPattern" : { + "a" : 1 + }, + "indexName" : "a_1", + "isMultiKey" : false, + "multiKeyPaths" : { + "a" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "a" : [ + "(0.0, inf.0]" + ] + }, + "keysExamined" : 8, + "seeks" : 1, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + "ts" : ISODate("2017-10-15T01:54:45.251Z"), + "client" : "127.0.0.1", + "appName" : "MongoDB Shell", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/getmore_3.5.11 b/src/go/tests/doc/out/getmore_3.5.11 new file mode 100644 index 00000000..6b9e77c8 --- /dev/null +++ b/src/go/tests/doc/out/getmore_3.5.11 @@ -0,0 +1,106 @@ +{ + "op" : "getmore", + "ns" : "test.coll", + "command" : { + "getMore" : NumberLong("62495713089"), + "collection" : "coll", + "batchSize" : 2, + "$db" : "test" + }, + "originatingCommand" : { + "find" : "coll", + "filter" : { + "a" : { + "$gt" : 0 + } + }, + "batchSize" : 2, + "sort" : { + "a" : 1 + }, + "$db" : "test" + }, + "cursorid" : 62495713089, + "keysExamined" : 0, + "docsExamined" : 0, + "cursorExhausted" : true, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(2) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "r" : NumberLong(1) + } + } + }, + "nreturned" : 0, + "responseLength" : 81, + "protocol" : "op_msg", + "millis" : 0, + "planSummary" : "IXSCAN { a: 1 }", + "execStats" : { + "stage" : "FETCH", + "nReturned" : 8, + "executionTimeMillisEstimate" : 0, + "works" : 9, + "advanced" : 8, + "needTime" : 0, + "needYield" : 0, + "saveState" : 4, + "restoreState" : 4, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 8, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 8, + "executionTimeMillisEstimate" : 0, + "works" : 9, + "advanced" : 8, + "needTime" : 0, + "needYield" : 0, + "saveState" : 4, + "restoreState" : 4, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "a" : 1 + }, + "indexName" : "a_1", + "isMultiKey" : false, + "multiKeyPaths" : { + "a" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "a" : [ + "(0.0, inf.0]" + ] + }, + "keysExamined" : 8, + "seeks" : 1, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + "ts" : ISODate("2017-10-15T01:54:56.186Z"), + "client" : "127.0.0.1", + "appName" : "MongoDB Shell", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/group_2.6.12 b/src/go/tests/doc/out/group_2.6.12 index 53de6267..ccc88964 100644 --- a/src/go/tests/doc/out/group_2.6.12 +++ b/src/go/tests/doc/out/group_2.6.12 @@ -21,20 +21,20 @@ "numYield" : 0, "lockStats" : { "timeLockedMicros" : { - "r" : NumberLong(77899), + "r" : NumberLong(36629), "w" : NumberLong(0) }, "timeAcquiringMicros" : { - "r" : NumberLong(3), - "w" : NumberLong(2075) + "r" : NumberLong(6), + "w" : NumberLong(6) } }, "responseLength" : 135, - "millis" : 77, + "millis" : 36, "execStats" : { }, - "ts" : ISODate("2017-08-20T15:39:16.325Z"), + "ts" : ISODate("2017-10-15T01:54:11.599Z"), "client" : "127.0.0.1", "allUsers" : [ ], "user" : "" diff --git a/src/go/tests/doc/out/group_3.0.15 b/src/go/tests/doc/out/group_3.0.15 index 8daf8b7f..3f90e354 100644 --- a/src/go/tests/doc/out/group_3.0.15 +++ b/src/go/tests/doc/out/group_3.0.15 @@ -43,11 +43,11 @@ } }, "responseLength" : 139, - "millis" : 54, + "millis" : 26, "execStats" : { }, - "ts" : ISODate("2017-08-20T15:39:22.271Z"), + "ts" : ISODate("2017-10-15T01:54:21.188Z"), "client" : "127.0.0.1", "allUsers" : [ ], "user" : "" diff --git a/src/go/tests/doc/out/group_3.2.16 b/src/go/tests/doc/out/group_3.2.16 index 44e8ac00..4275f00f 100644 --- a/src/go/tests/doc/out/group_3.2.16 +++ b/src/go/tests/doc/out/group_3.2.16 @@ -39,11 +39,11 @@ }, "responseLength" : 142, "protocol" : "op_command", - "millis" : 74, + "millis" : 31, "execStats" : { }, - "ts" : ISODate("2017-08-20T15:39:32.101Z"), + "ts" : ISODate("2017-10-15T01:54:34.867Z"), "client" : "127.0.0.1", "allUsers" : [ ], "user" : "" diff --git a/src/go/tests/doc/out/group_3.4.7 b/src/go/tests/doc/out/group_3.4.7 index 681a76ac..2604d078 100644 --- a/src/go/tests/doc/out/group_3.4.7 +++ b/src/go/tests/doc/out/group_3.4.7 @@ -41,12 +41,12 @@ }, "responseLength" : 124, "protocol" : "op_command", - "millis" : 77, + "millis" : 31, "planSummary" : "IXSCAN { b: -1 }", "execStats" : { "stage" : "GROUP", "nReturned" : 1, - "executionTimeMillisEstimate" : 75, + "executionTimeMillisEstimate" : 31, "works" : 4, "advanced" : 1, "needTime" : 3, @@ -108,7 +108,7 @@ } } }, - "ts" : ISODate("2017-08-20T15:39:38.886Z"), + "ts" : ISODate("2017-10-15T01:54:45.500Z"), "client" : "127.0.0.1", "appName" : "MongoDB Shell", "allUsers" : [ ], diff --git a/src/go/tests/doc/out/group_3.5.11 b/src/go/tests/doc/out/group_3.5.11 index 4ff8fa94..b79d3224 100644 --- a/src/go/tests/doc/out/group_3.5.11 +++ b/src/go/tests/doc/out/group_3.5.11 @@ -42,12 +42,12 @@ }, "responseLength" : 124, "protocol" : "op_msg", - "millis" : 68, + "millis" : 24, "planSummary" : "IXSCAN { b: -1 }", "execStats" : { "stage" : "GROUP", "nReturned" : 1, - "executionTimeMillisEstimate" : 64, + "executionTimeMillisEstimate" : 25, "works" : 4, "advanced" : 1, "needTime" : 3, @@ -109,7 +109,7 @@ } } }, - "ts" : ISODate("2017-08-20T15:39:49.276Z"), + "ts" : ISODate("2017-10-15T01:54:56.478Z"), "client" : "127.0.0.1", "appName" : "MongoDB Shell", "allUsers" : [ ], diff --git a/src/go/tests/doc/out/insert_2.6.12 b/src/go/tests/doc/out/insert_2.6.12 index 73bd1260..4073f84c 100644 --- a/src/go/tests/doc/out/insert_2.6.12 +++ b/src/go/tests/doc/out/insert_2.6.12 @@ -10,18 +10,18 @@ "lockStats" : { "timeLockedMicros" : { "r" : NumberLong(0), - "w" : NumberLong(90) + "w" : NumberLong(362) }, "timeAcquiringMicros" : { "r" : NumberLong(0), - "w" : NumberLong(4) + "w" : NumberLong(11) } }, "millis" : 0, "execStats" : { }, - "ts" : ISODate("2017-08-20T15:39:16.473Z"), + "ts" : ISODate("2017-10-15T01:54:11.737Z"), "client" : "127.0.0.1", "allUsers" : [ ], "user" : "" diff --git a/src/go/tests/doc/out/insert_3.0.15 b/src/go/tests/doc/out/insert_3.0.15 index f4e6a153..94e5434d 100644 --- a/src/go/tests/doc/out/insert_3.0.15 +++ b/src/go/tests/doc/out/insert_3.0.15 @@ -11,31 +11,37 @@ "locks" : { "Global" : { "acquireCount" : { - "r" : NumberLong(1), - "w" : NumberLong(1) + "r" : NumberLong(2), + "w" : NumberLong(2) } }, "MMAPV1Journal" : { "acquireCount" : { - "w" : NumberLong(2) + "w" : NumberLong(4) } }, "Database" : { "acquireCount" : { - "w" : NumberLong(1) + "w" : NumberLong(1), + "W" : NumberLong(1) } }, "Collection" : { "acquireCount" : { - "W" : NumberLong(1) + "W" : NumberLong(2) + } + }, + "Metadata" : { + "acquireCount" : { + "W" : NumberLong(2) } } }, - "millis" : 0, + "millis" : 4, "execStats" : { }, - "ts" : ISODate("2017-08-20T15:39:22.409Z"), + "ts" : ISODate("2017-10-15T01:54:21.346Z"), "client" : "127.0.0.1", "allUsers" : [ ], "user" : "" diff --git a/src/go/tests/doc/out/insert_3.2.16 b/src/go/tests/doc/out/insert_3.2.16 index 5bd08bd1..e033c994 100644 --- a/src/go/tests/doc/out/insert_3.2.16 +++ b/src/go/tests/doc/out/insert_3.2.16 @@ -17,28 +17,30 @@ "locks" : { "Global" : { "acquireCount" : { - "r" : NumberLong(1), - "w" : NumberLong(1) + "r" : NumberLong(2), + "w" : NumberLong(2) } }, "Database" : { "acquireCount" : { - "w" : NumberLong(1) + "w" : NumberLong(1), + "W" : NumberLong(1) } }, "Collection" : { "acquireCount" : { - "w" : NumberLong(1) + "w" : NumberLong(1), + "W" : NumberLong(1) } } }, "responseLength" : 25, "protocol" : "op_command", - "millis" : 0, + "millis" : 11, "execStats" : { }, - "ts" : ISODate("2017-08-20T15:39:32.303Z"), + "ts" : ISODate("2017-10-15T01:54:35.088Z"), "client" : "127.0.0.1", "allUsers" : [ ], "user" : "" diff --git a/src/go/tests/doc/out/insert_3.4.7 b/src/go/tests/doc/out/insert_3.4.7 index 4e8278af..22d2dfb9 100644 --- a/src/go/tests/doc/out/insert_3.4.7 +++ b/src/go/tests/doc/out/insert_3.4.7 @@ -11,30 +11,31 @@ "ordered" : true }, "ninserted" : 1, - "keysInserted" : 2, + "keysInserted" : 1, "numYield" : 0, "locks" : { "Global" : { "acquireCount" : { - "r" : NumberLong(1), - "w" : NumberLong(1) + "r" : NumberLong(3), + "w" : NumberLong(3) } }, "Database" : { "acquireCount" : { - "w" : NumberLong(1) + "w" : NumberLong(2), + "W" : NumberLong(1) } }, "Collection" : { "acquireCount" : { - "w" : NumberLong(1) + "w" : NumberLong(2) } } }, "responseLength" : 29, "protocol" : "op_command", - "millis" : 0, - "ts" : ISODate("2017-08-20T15:39:39.023Z"), + "millis" : 11, + "ts" : ISODate("2017-10-15T01:54:45.681Z"), "client" : "127.0.0.1", "appName" : "MongoDB Shell", "allUsers" : [ ], diff --git a/src/go/tests/doc/out/insert_3.5.11 b/src/go/tests/doc/out/insert_3.5.11 index b560d170..dc1b8872 100644 --- a/src/go/tests/doc/out/insert_3.5.11 +++ b/src/go/tests/doc/out/insert_3.5.11 @@ -7,30 +7,31 @@ "$db" : "test" }, "ninserted" : 1, - "keysInserted" : 2, + "keysInserted" : 1, "numYield" : 0, "locks" : { "Global" : { "acquireCount" : { - "r" : NumberLong(1), - "w" : NumberLong(1) + "r" : NumberLong(3), + "w" : NumberLong(3) } }, "Database" : { "acquireCount" : { - "w" : NumberLong(1) + "w" : NumberLong(2), + "W" : NumberLong(1) } }, "Collection" : { "acquireCount" : { - "w" : NumberLong(1) + "w" : NumberLong(2) } } }, "responseLength" : 29, "protocol" : "op_msg", - "millis" : 0, - "ts" : ISODate("2017-08-20T15:39:49.440Z"), + "millis" : 11, + "ts" : ISODate("2017-10-15T01:54:56.693Z"), "client" : "127.0.0.1", "appName" : "MongoDB Shell", "allUsers" : [ ], diff --git a/src/go/tests/doc/out/mapreduce_2.6.12 b/src/go/tests/doc/out/mapreduce_2.6.12 index e1978210..41e8a772 100644 --- a/src/go/tests/doc/out/mapreduce_2.6.12 +++ b/src/go/tests/doc/out/mapreduce_2.6.12 @@ -22,20 +22,20 @@ "numYield" : 0, "lockStats" : { "timeLockedMicros" : { - "r" : NumberLong(226), + "r" : NumberLong(650), "w" : NumberLong(0) }, "timeAcquiringMicros" : { - "r" : NumberLong(4), - "w" : NumberLong(13) + "r" : NumberLong(17), + "w" : NumberLong(15) } }, "responseLength" : 233, - "millis" : 33, + "millis" : 29, "execStats" : { }, - "ts" : ISODate("2017-08-20T15:39:16.701Z"), + "ts" : ISODate("2017-10-15T01:54:11.959Z"), "client" : "127.0.0.1", "allUsers" : [ ], "user" : "" diff --git a/src/go/tests/doc/out/mapreduce_3.0.15 b/src/go/tests/doc/out/mapreduce_3.0.15 index 725e50fc..bfd14a96 100644 --- a/src/go/tests/doc/out/mapreduce_3.0.15 +++ b/src/go/tests/doc/out/mapreduce_3.0.15 @@ -49,11 +49,11 @@ } }, "responseLength" : 233, - "millis" : 26, + "millis" : 21, "execStats" : { }, - "ts" : ISODate("2017-08-20T15:39:22.582Z"), + "ts" : ISODate("2017-10-15T01:54:21.559Z"), "client" : "127.0.0.1", "allUsers" : [ ], "user" : "" diff --git a/src/go/tests/doc/out/mapreduce_3.2.16 b/src/go/tests/doc/out/mapreduce_3.2.16 index 44944aaf..b60d4849 100644 --- a/src/go/tests/doc/out/mapreduce_3.2.16 +++ b/src/go/tests/doc/out/mapreduce_3.2.16 @@ -49,11 +49,11 @@ }, "responseLength" : 218, "protocol" : "op_command", - "millis" : 31, + "millis" : 41, "execStats" : { }, - "ts" : ISODate("2017-08-20T15:39:32.572Z"), + "ts" : ISODate("2017-10-15T01:54:35.348Z"), "client" : "127.0.0.1", "allUsers" : [ ], "user" : "" diff --git a/src/go/tests/doc/out/mapreduce_3.4.7 b/src/go/tests/doc/out/mapreduce_3.4.7 index 5e3de99f..8e355963 100644 --- a/src/go/tests/doc/out/mapreduce_3.4.7 +++ b/src/go/tests/doc/out/mapreduce_3.4.7 @@ -20,11 +20,11 @@ }, "keysExamined" : 3, "docsExamined" : 3, - "numYield" : 0, + "numYield" : 1, "locks" : { "Global" : { "acquireCount" : { - "r" : NumberLong(11), + "r" : NumberLong(13), "w" : NumberLong(1) } }, @@ -32,7 +32,7 @@ "acquireCount" : { "r" : NumberLong(3), "w" : NumberLong(1), - "R" : NumberLong(2) + "R" : NumberLong(3) } }, "Collection" : { @@ -49,18 +49,18 @@ }, "responseLength" : 218, "protocol" : "op_command", - "millis" : 43, + "millis" : 21, "planSummary" : "IXSCAN { a: 1 }", "execStats" : { "stage" : "FETCH", "nReturned" : 3, - "executionTimeMillisEstimate" : 0, + "executionTimeMillisEstimate" : 11, "works" : 4, "advanced" : 3, "needTime" : 0, "needYield" : 0, - "saveState" : 0, - "restoreState" : 0, + "saveState" : 1, + "restoreState" : 1, "isEOF" : 1, "invalidates" : 0, "docsExamined" : 3, @@ -68,13 +68,13 @@ "inputStage" : { "stage" : "IXSCAN", "nReturned" : 3, - "executionTimeMillisEstimate" : 0, + "executionTimeMillisEstimate" : 11, "works" : 4, "advanced" : 3, "needTime" : 0, "needYield" : 0, - "saveState" : 0, - "restoreState" : 0, + "saveState" : 1, + "restoreState" : 1, "isEOF" : 1, "invalidates" : 0, "keyPattern" : { @@ -102,7 +102,7 @@ "seenInvalidated" : 0 } }, - "ts" : ISODate("2017-08-20T15:39:39.249Z"), + "ts" : ISODate("2017-10-15T01:54:45.925Z"), "client" : "127.0.0.1", "appName" : "MongoDB Shell", "allUsers" : [ ], diff --git a/src/go/tests/doc/out/mapreduce_3.5.11 b/src/go/tests/doc/out/mapreduce_3.5.11 index 3b9c8f7e..89063fd7 100644 --- a/src/go/tests/doc/out/mapreduce_3.5.11 +++ b/src/go/tests/doc/out/mapreduce_3.5.11 @@ -50,7 +50,7 @@ }, "responseLength" : 218, "protocol" : "op_msg", - "millis" : 35, + "millis" : 26, "planSummary" : "IXSCAN { a: 1 }", "execStats" : { "stage" : "FETCH", @@ -103,7 +103,7 @@ "seenInvalidated" : 0 } }, - "ts" : ISODate("2017-08-20T15:39:49.680Z"), + "ts" : ISODate("2017-10-15T01:54:56.951Z"), "client" : "127.0.0.1", "appName" : "MongoDB Shell", "allUsers" : [ ], diff --git a/src/go/tests/doc/out/update_2.6.12 b/src/go/tests/doc/out/update_2.6.12 index f33f95b6..ce5d69c7 100644 --- a/src/go/tests/doc/out/update_2.6.12 +++ b/src/go/tests/doc/out/update_2.6.12 @@ -16,27 +16,25 @@ }, "nscanned" : 1, "nscannedObjects" : 1, - "moved" : true, - "nmoved" : 1, "nMatched" : 1, "nModified" : 1, - "keyUpdates" : 0, + "keyUpdates" : 1, "numYield" : 0, "lockStats" : { "timeLockedMicros" : { "r" : NumberLong(0), - "w" : NumberLong(285) + "w" : NumberLong(241) }, "timeAcquiringMicros" : { "r" : NumberLong(0), - "w" : NumberLong(4) + "w" : NumberLong(16) } }, "millis" : 0, "execStats" : { }, - "ts" : ISODate("2017-08-20T15:39:16.921Z"), + "ts" : ISODate("2017-10-15T01:54:12.161Z"), "client" : "127.0.0.1", "allUsers" : [ ], "user" : "" diff --git a/src/go/tests/doc/out/update_3.0.15 b/src/go/tests/doc/out/update_3.0.15 index d1e4f3c7..a20162f7 100644 --- a/src/go/tests/doc/out/update_3.0.15 +++ b/src/go/tests/doc/out/update_3.0.15 @@ -16,11 +16,9 @@ }, "nscanned" : 1, "nscannedObjects" : 1, - "moved" : true, - "nmoved" : 1, "nMatched" : 1, "nModified" : 1, - "keyUpdates" : 0, + "keyUpdates" : 1, "writeConflicts" : 0, "numYield" : 0, "locks" : { @@ -50,7 +48,7 @@ "execStats" : { }, - "ts" : ISODate("2017-08-20T15:39:22.788Z"), + "ts" : ISODate("2017-10-15T01:54:21.803Z"), "client" : "127.0.0.1", "allUsers" : [ ], "user" : "" diff --git a/src/go/tests/doc/out/update_3.2.16 b/src/go/tests/doc/out/update_3.2.16 index b049846b..6837faf8 100644 --- a/src/go/tests/doc/out/update_3.2.16 +++ b/src/go/tests/doc/out/update_3.2.16 @@ -39,11 +39,11 @@ } } }, - "millis" : 0, + "millis" : 2, "execStats" : { }, - "ts" : ISODate("2017-08-20T15:39:32.737Z"), + "ts" : ISODate("2017-10-15T01:54:35.583Z"), "client" : "127.0.0.1", "allUsers" : [ ], "user" : "" diff --git a/src/go/tests/doc/out/update_3.4.7 b/src/go/tests/doc/out/update_3.4.7 index c5fe1c47..67a1b06b 100644 --- a/src/go/tests/doc/out/update_3.4.7 +++ b/src/go/tests/doc/out/update_3.4.7 @@ -110,7 +110,7 @@ } } }, - "ts" : ISODate("2017-08-20T15:39:39.434Z"), + "ts" : ISODate("2017-10-15T01:54:46.168Z"), "client" : "127.0.0.1", "appName" : "MongoDB Shell", "allUsers" : [ ], diff --git a/src/go/tests/doc/out/update_3.5.11 b/src/go/tests/doc/out/update_3.5.11 index 2b66b250..e30d0689 100644 --- a/src/go/tests/doc/out/update_3.5.11 +++ b/src/go/tests/doc/out/update_3.5.11 @@ -114,7 +114,7 @@ } } }, - "ts" : ISODate("2017-08-20T15:39:49.855Z"), + "ts" : ISODate("2017-10-15T01:54:57.231Z"), "client" : "127.0.0.1", "appName" : "MongoDB Shell", "allUsers" : [ ], diff --git a/src/go/tests/doc/script/profile/aggregate.js b/src/go/tests/doc/script/profile/aggregate.js index aa1570be..7d8332a3 100644 --- a/src/go/tests/doc/script/profile/aggregate.js +++ b/src/go/tests/doc/script/profile/aggregate.js @@ -1,7 +1,7 @@ -var coll = db.coll +var coll = db.coll; +coll.drop(); -var i; -for (i = 0; i < 10; ++i) { +for (var i = 0; i < 10; ++i) { coll.insert({a: i}); } coll.createIndex({a: 1}); diff --git a/src/go/tests/doc/script/profile/count.js b/src/go/tests/doc/script/profile/count.js index 2fbf6789..c547b787 100644 --- a/src/go/tests/doc/script/profile/count.js +++ b/src/go/tests/doc/script/profile/count.js @@ -1,6 +1,7 @@ -var coll = db.coll +var coll = db.coll; +coll.drop(); -for (i = 0; i < 10; ++i) { +for (var i = 0; i < 10; ++i) { coll.insert({a: i}); } diff --git a/src/go/tests/doc/script/profile/count_with_query.js b/src/go/tests/doc/script/profile/count_with_query.js index 8d0ecb65..589e7ffa 100644 --- a/src/go/tests/doc/script/profile/count_with_query.js +++ b/src/go/tests/doc/script/profile/count_with_query.js @@ -1,6 +1,7 @@ -var coll = db.coll +var coll = db.coll; +coll.drop(); -for (i = 0; i < 10; ++i) { +for (var i = 0; i < 10; ++i) { coll.insert({a: i}); } diff --git a/src/go/tests/doc/script/profile/delete.js b/src/go/tests/doc/script/profile/delete.js index 5ab8155f..5261e123 100644 --- a/src/go/tests/doc/script/profile/delete.js +++ b/src/go/tests/doc/script/profile/delete.js @@ -1,9 +1,9 @@ -var coll = db.coll +var coll = db.coll; +coll.drop(); -for (i = 0; i < 10; ++i) { +for (var i = 0; i < 10; ++i) { coll.insert({a: i, b: i}); } - coll.createIndex({a: 1}); -coll.remove({a: {$gte: 2}, b: {$gte: 2}}, {justOne: true}) +coll.remove({a: {$gte: 2}, b: {$gte: 2}}, {justOne: true}); diff --git a/src/go/tests/doc/script/profile/delete_all.js b/src/go/tests/doc/script/profile/delete_all.js index d612bde4..4f117cc4 100644 --- a/src/go/tests/doc/script/profile/delete_all.js +++ b/src/go/tests/doc/script/profile/delete_all.js @@ -1,9 +1,9 @@ -var coll = db.coll +var coll = db.coll; +coll.drop(); -for (i = 0; i < 10; ++i) { +for (var i = 0; i < 10; ++i) { coll.insert({a: i, b: i}); } - coll.createIndex({a: 1}); -coll.remove({a: {$gte: 2}, b: {$gte: 2}}) +coll.remove({a: {$gte: 2}, b: {$gte: 2}}); diff --git a/src/go/tests/doc/script/profile/distinct.js b/src/go/tests/doc/script/profile/distinct.js index 14ab2299..18b4ab69 100644 --- a/src/go/tests/doc/script/profile/distinct.js +++ b/src/go/tests/doc/script/profile/distinct.js @@ -1,7 +1,7 @@ -var coll = db.coll +var coll = db.coll; +coll.drop(); -var i; -for (i = 0; i < 10; ++i) { +for (var i = 0; i < 10; ++i) { coll.insert({a: i % 5, b: i}); } coll.createIndex({b: 1}); diff --git a/src/go/tests/doc/script/profile/eval.js b/src/go/tests/doc/script/profile/eval.js index fb3c07d9..a34d7db4 100644 --- a/src/go/tests/doc/script/profile/eval.js +++ b/src/go/tests/doc/script/profile/eval.js @@ -1 +1 @@ -db.eval("db") +db.eval("1"); diff --git a/src/go/tests/doc/script/profile/explain.js b/src/go/tests/doc/script/profile/explain.js index fcf81bce..560c71e3 100644 --- a/src/go/tests/doc/script/profile/explain.js +++ b/src/go/tests/doc/script/profile/explain.js @@ -1,3 +1,3 @@ -var coll = db.coll +var coll = db.coll; -coll.find().explain() +coll.find().explain(); diff --git a/src/go/tests/doc/script/profile/find.js b/src/go/tests/doc/script/profile/find.js index e13d79f1..30f0ea82 100644 --- a/src/go/tests/doc/script/profile/find.js +++ b/src/go/tests/doc/script/profile/find.js @@ -1,10 +1,9 @@ -var coll = db.coll +var coll = db.coll; +coll.drop(); -coll.createIndex({a: 1}) - -var i; -for (i = 0; i < 10; ++i) { - coll.insert({a: i % 5}); +for (var i = 0; i < 10; ++i) { + coll.insert({k: i % 5}); } +coll.createIndex({k: 1}); -coll.find({a: 1}).pretty() +coll.find({k: 1}).toArray(); diff --git a/src/go/tests/doc/script/profile/find_andrii.js b/src/go/tests/doc/script/profile/find_andrii.js index f97f1ad0..37e89f56 100644 --- a/src/go/tests/doc/script/profile/find_andrii.js +++ b/src/go/tests/doc/script/profile/find_andrii.js @@ -1,4 +1,7 @@ -db.coll.find({ +var coll = db.coll; +coll.drop(); + +coll.find({ $and: [ { k: { $gt: 1 } @@ -13,8 +16,8 @@ db.coll.find({ }, { pad: { $in: [/9$/, /7$/, /5$/, /3$/] } - }, + } ] } ] -}).sort({ k: -1 }).limit(100); +}).sort({ k: -1 }).limit(100).toArray(); diff --git a/src/go/tests/doc/script/profile/find_empty.js b/src/go/tests/doc/script/profile/find_empty.js index 049122cc..63d62c1c 100644 --- a/src/go/tests/doc/script/profile/find_empty.js +++ b/src/go/tests/doc/script/profile/find_empty.js @@ -1,3 +1,3 @@ -var coll = db.coll +var coll = db.coll; -coll.find() +coll.find().toArray(); diff --git a/src/go/tests/doc/script/profile/find_with_sort.js b/src/go/tests/doc/script/profile/find_with_sort.js new file mode 100644 index 00000000..4beed84a --- /dev/null +++ b/src/go/tests/doc/script/profile/find_with_sort.js @@ -0,0 +1,9 @@ +var coll = db.coll; +coll.drop(); + +for (var i = 0; i < 10; ++i) { + coll.insert({c: i % 5, b: i}); +} +coll.createIndex({c: 1}); + +coll.find({c: 1}).sort({ b: -1 }).toArray(); diff --git a/src/go/tests/doc/script/profile/findandmodify.js b/src/go/tests/doc/script/profile/findandmodify.js index 7b8f8086..47500631 100644 --- a/src/go/tests/doc/script/profile/findandmodify.js +++ b/src/go/tests/doc/script/profile/findandmodify.js @@ -1,4 +1,4 @@ -var coll = db.coll +var coll = db.coll; coll.drop(); for (var i = 0; i < 3; i++) { diff --git a/src/go/tests/doc/script/profile/geonear.js b/src/go/tests/doc/script/profile/geonear.js index 714a2438..66f49dff 100644 --- a/src/go/tests/doc/script/profile/geonear.js +++ b/src/go/tests/doc/script/profile/geonear.js @@ -1,8 +1,7 @@ -var coll = db.coll +var coll = db.coll; coll.drop(); -var i; -for (i = 0; i < 10; ++i) { +for (var i = 0; i < 10; ++i) { coll.insert({a: i, loc: {type: "Point", coordinates: [i, i]}}); } coll.createIndex({loc: "2dsphere"}); diff --git a/src/go/tests/doc/script/profile/getmore.js b/src/go/tests/doc/script/profile/getmore.js new file mode 100644 index 00000000..611f12ad --- /dev/null +++ b/src/go/tests/doc/script/profile/getmore.js @@ -0,0 +1,14 @@ +var coll = db.coll; +coll.drop(); + +coll.createIndex({a: 1}); + +for (var i = 0; i < 10; ++i) { + coll.insert({a: i % 5}); +} + +var cursor = coll.find({a: {$gt: 0}}).sort({a: 1}).batchSize(2); +cursor.next(); // Perform initial query and consume first of 2 docs returned. +cursor.next(); // Consume second of 2 docs from initial query. +cursor.next(); // getMore performed, leaving open cursor. +cursor.itcount(); // Exhaust the cursor. diff --git a/src/go/tests/doc/script/profile/group.js b/src/go/tests/doc/script/profile/group.js index a15d8426..5a79c0f0 100644 --- a/src/go/tests/doc/script/profile/group.js +++ b/src/go/tests/doc/script/profile/group.js @@ -1,8 +1,7 @@ -var coll = db.coll +var coll = db.coll; coll.drop(); -var i; -for (i = 0; i < 10; ++i) { +for (var i = 0; i < 10; ++i) { coll.insert({a: i, b: i % 5}); } coll.createIndex({b: -1}); diff --git a/src/go/tests/doc/script/profile/insert.js b/src/go/tests/doc/script/profile/insert.js index 5293c99f..f9720216 100644 --- a/src/go/tests/doc/script/profile/insert.js +++ b/src/go/tests/doc/script/profile/insert.js @@ -1,4 +1,5 @@ -var coll = db.coll +var coll = db.coll; +coll.drop(); var doc = {_id: 1}; var result = coll.insert(doc); diff --git a/src/go/tests/doc/script/profile/mapreduce.js b/src/go/tests/doc/script/profile/mapreduce.js index 80ebd00a..902d24f1 100644 --- a/src/go/tests/doc/script/profile/mapreduce.js +++ b/src/go/tests/doc/script/profile/mapreduce.js @@ -1,4 +1,4 @@ -var coll = db.coll +var coll = db.coll; coll.drop(); var mapFunction = function() { @@ -9,7 +9,6 @@ var reduceFunction = function(a, b) { return Array.sum(b); }; -coll.drop(); for (var i = 0; i < 3; i++) { coll.insert({a: i, b: i}); } diff --git a/src/go/tests/doc/script/profile/update.js b/src/go/tests/doc/script/profile/update.js index 13e04a53..50586bf4 100644 --- a/src/go/tests/doc/script/profile/update.js +++ b/src/go/tests/doc/script/profile/update.js @@ -1,7 +1,7 @@ -var coll = db.coll +var coll = db.coll; +coll.drop(); -var i; -for (i = 0; i < 10; ++i) { +for (var i = 0; i < 10; ++i) { coll.insert({a: i}); } coll.createIndex({a: 1}); diff --git a/src/go/tests/expect/available_metrics/available_metrics b/src/go/tests/expect/available_metrics/available_metrics index c512073d..db9bf2fc 100755 --- a/src/go/tests/expect/available_metrics/available_metrics +++ b/src/go/tests/expect/available_metrics/available_metrics @@ -5,11 +5,11 @@ "ResponseLength": 385 }, "3.0.15": { - "Millis": 2, + "Millis": 0, "ResponseLength": 385 }, "3.2.16": { - "Millis": 2, + "Millis": 0, "ResponseLength": 388 }, "3.4.7": { @@ -63,12 +63,12 @@ "ResponseLength": 47 }, "3.4.7": { - "DocsExamined": 0, + "DocsExamined": 10, "Millis": 0, "ResponseLength": 29 }, "3.5.11": { - "DocsExamined": 0, + "DocsExamined": 10, "Millis": 0, "ResponseLength": 29 } @@ -84,12 +84,12 @@ "Millis": 1 }, "3.4.7": { - "DocsExamined": 4, + "DocsExamined": 1, "Millis": 0 }, "3.5.11": { - "DocsExamined": 4, - "Millis": 0 + "DocsExamined": 1, + "Millis": 1 } }, "delete_all": { @@ -97,69 +97,69 @@ "Millis": 0 }, "3.0.15": { - "Millis": 1 + "Millis": 0 }, "3.2.16": { - "Millis": 0 + "Millis": 1 }, "3.4.7": { - "DocsExamined": 39, - "Millis": 0 + "DocsExamined": 8, + "Millis": 1 }, "3.5.11": { - "DocsExamined": 39, - "Millis": 0 + "DocsExamined": 8, + "Millis": 1 } }, "distinct": { "2.6.12": { "Millis": 0, - "ResponseLength": 254 + "ResponseLength": 199 }, "3.0.15": { "Millis": 0, - "ResponseLength": 261 + "ResponseLength": 206 }, "3.2.16": { "Millis": 0, - "ResponseLength": 264 + "ResponseLength": 209 }, "3.4.7": { - "DocsExamined": 10, + "DocsExamined": 5, "Millis": 0, - "ResponseLength": 145 + "ResponseLength": 90 }, "3.5.11": { - "DocsExamined": 10, + "DocsExamined": 5, "Millis": 0, - "ResponseLength": 145 + "ResponseLength": 90 } }, "eval": { "2.6.12": { - "Millis": 65, - "ResponseLength": 108 + "Millis": 43, + "ResponseLength": 53 }, "3.0.15": { - "Millis": 35, - "ResponseLength": 108 + "Millis": 37, + "ResponseLength": 53 }, "3.2.16": { - "Millis": 88, - "ResponseLength": 93 + "Millis": 56, + "ResponseLength": 38 }, "3.4.7": { - "Millis": 91, - "ResponseLength": 93 + "Millis": 48, + "ResponseLength": 38 }, "3.5.11": { - "Millis": 47, - "ResponseLength": 93 + "Millis": 40, + "ResponseLength": 38 } }, "explain": { "2.6.12": { - "NscannedObjects": 44, + "NscannedObjects": 10, "Millis": 0, "Nreturned": 1, "ResponseLength": 583 @@ -183,63 +183,63 @@ }, "find": { "2.6.12": { - "NscannedObjects": 6, + "NscannedObjects": 2, "Millis": 0, - "Nreturned": 6, - "ResponseLength": 251 + "Nreturned": 2, + "ResponseLength": 86 }, "3.0.15": { - "NscannedObjects": 6, + "NscannedObjects": 2, "Millis": 0, - "Nreturned": 6, - "ResponseLength": 251 + "Nreturned": 2, + "ResponseLength": 86 }, "3.2.16": { - "DocsExamined": 6, - "Millis": 0, - "Nreturned": 6, - "ResponseLength": 349 + "DocsExamined": 2, + "Millis": 1, + "Nreturned": 2, + "ResponseLength": 172 }, "3.4.7": { - "DocsExamined": 6, + "DocsExamined": 2, "Millis": 0, - "Nreturned": 6, - "ResponseLength": 331 + "Nreturned": 2, + "ResponseLength": 154 }, "3.5.11": { - "DocsExamined": 6, - "Millis": 1, - "Nreturned": 6, - "ResponseLength": 331 + "DocsExamined": 2, + "Millis": 0, + "Nreturned": 2, + "ResponseLength": 154 } }, "find_andrii": { "2.6.12": { - "NscannedObjects": 98, + "NscannedObjects": 0, "Millis": 0, "Nreturned": 0, "ResponseLength": 20 }, "3.0.15": { - "NscannedObjects": 98, + "NscannedObjects": 0, "Millis": 0, "Nreturned": 0, "ResponseLength": 20 }, "3.2.16": { - "DocsExamined": 49, + "DocsExamined": 0, "Millis": 0, "Nreturned": 0, "ResponseLength": 100 }, "3.4.7": { - "DocsExamined": 49, + "DocsExamined": 0, "Millis": 0, "Nreturned": 0, "ResponseLength": 82 }, "3.5.11": { - "DocsExamined": 49, + "DocsExamined": 0, "Millis": 0, "Nreturned": 0, "ResponseLength": 82 @@ -247,40 +247,40 @@ }, "find_empty": { "2.6.12": { - "NscannedObjects": 49, + "NscannedObjects": 0, "Millis": 0, - "Nreturned": 49, - "ResponseLength": 1846 + "Nreturned": 0, + "ResponseLength": 20 }, "3.0.15": { - "NscannedObjects": 49, + "NscannedObjects": 0, "Millis": 0, - "Nreturned": 49, - "ResponseLength": 1846 + "Nreturned": 0, + "ResponseLength": 20 }, "3.2.16": { - "DocsExamined": 49, + "DocsExamined": 0, "Millis": 0, - "Nreturned": 49, - "ResponseLength": 2112 + "Nreturned": 0, + "ResponseLength": 100 }, "3.4.7": { - "DocsExamined": 49, + "DocsExamined": 0, "Millis": 0, - "Nreturned": 49, - "ResponseLength": 2094 + "Nreturned": 0, + "ResponseLength": 82 }, "3.5.11": { - "DocsExamined": 49, + "DocsExamined": 0, "Millis": 0, - "Nreturned": 49, - "ResponseLength": 2094 + "Nreturned": 0, + "ResponseLength": 82 } }, "findandmodify": { "2.6.12": { "NscannedObjects": 1, - "Millis": 0, + "Millis": 6, "ResponseLength": 131 }, "3.0.15": { @@ -290,17 +290,17 @@ }, "3.2.16": { "DocsExamined": 3, - "Millis": 0, + "Millis": 1, "ResponseLength": 116 }, "3.4.7": { "DocsExamined": 3, - "Millis": 0, + "Millis": 1, "ResponseLength": 116 }, "3.5.11": { "DocsExamined": 3, - "Millis": 0, + "Millis": 1, "ResponseLength": 116 } }, @@ -310,45 +310,45 @@ "ResponseLength": 1406 }, "3.0.15": { - "Millis": 3, + "Millis": 2, "ResponseLength": 1398 }, "3.2.16": { - "Millis": 8, + "Millis": 10, "ResponseLength": 1401 }, "3.4.7": { "DocsExamined": 10, - "Millis": 11, + "Millis": 13, "ResponseLength": 1383 }, "3.5.11": { "DocsExamined": 10, - "Millis": 7, + "Millis": 11, "ResponseLength": 1383 } }, "group": { "2.6.12": { - "Millis": 77, + "Millis": 36, "ResponseLength": 135 }, "3.0.15": { - "Millis": 54, + "Millis": 26, "ResponseLength": 139 }, "3.2.16": { - "Millis": 74, + "Millis": 31, "ResponseLength": 142 }, "3.4.7": { "DocsExamined": 2, - "Millis": 77, + "Millis": 31, "ResponseLength": 124 }, "3.5.11": { "DocsExamined": 2, - "Millis": 68, + "Millis": 24, "ResponseLength": 124 } }, @@ -357,42 +357,42 @@ "Millis": 0 }, "3.0.15": { - "Millis": 0 + "Millis": 4 }, "3.2.16": { - "Millis": 0, + "Millis": 11, "ResponseLength": 25 }, "3.4.7": { - "Millis": 0, + "Millis": 11, "ResponseLength": 29 }, "3.5.11": { - "Millis": 0, + "Millis": 11, "ResponseLength": 29 } }, "mapreduce": { "2.6.12": { - "Millis": 33, + "Millis": 29, "ResponseLength": 233 }, "3.0.15": { - "Millis": 26, + "Millis": 21, "ResponseLength": 233 }, "3.2.16": { - "Millis": 31, + "Millis": 41, "ResponseLength": 218 }, "3.4.7": { "DocsExamined": 3, - "Millis": 43, + "Millis": 21, "ResponseLength": 218 }, "3.5.11": { "DocsExamined": 3, - "Millis": 35, + "Millis": 26, "ResponseLength": 218 } }, @@ -407,7 +407,7 @@ }, "3.2.16": { "DocsExamined": 1, - "Millis": 0 + "Millis": 2 }, "3.4.7": { "DocsExamined": 1, diff --git a/src/go/tests/expect/stats_all/sum.json b/src/go/tests/expect/stats_all/sum.json index 25e060f5..86d17d30 100755 --- a/src/go/tests/expect/stats_all/sum.json +++ b/src/go/tests/expect/stats_all/sum.json @@ -5,8 +5,8 @@ "Operation": "AGGREGATE", "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"aggregate\":\"coll\",\"pipeline\":[{\"$match\":{\"a\":{\"$gte\":2}}}],\"cursor\":{}}}\n", "Fingerprint": "AGGREGATE coll a", - "FirstSeen": "2017-08-20T15:39:14.658Z", - "LastSeen": "2017-08-20T15:39:47.203Z", + "FirstSeen": "2017-10-15T01:54:08.661Z", + "LastSeen": "2017-10-15T01:54:52.564Z", "TableScan": false, "Count": 5, "BlockedTime": null, @@ -27,8 +27,8 @@ ], "QueryTime": [ 0, - 2, - 2, + 0, + 0, 0, 2 ], @@ -46,8 +46,8 @@ "Operation": "COUNT", "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"count\":\"coll\",\"query\":{},\"fields\":{}}}\n", "Fingerprint": "COUNT coll", - "FirstSeen": "2017-08-20T15:39:14.823Z", - "LastSeen": "2017-08-20T15:39:47.396Z", + "FirstSeen": "2017-10-15T01:54:08.889Z", + "LastSeen": "2017-10-15T01:54:52.844Z", "TableScan": false, "Count": 5, "BlockedTime": null, @@ -87,49 +87,8 @@ "Operation": "COUNT", "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"count\":\"coll\",\"query\":{\"a\":{\"$gt\":5}},\"fields\":{}}}\n", "Fingerprint": "COUNT coll a", - "FirstSeen": "2017-08-20T15:39:14.971Z", - "LastSeen": "2017-08-20T15:39:47.573Z", - "TableScan": false, - "Count": 5, - "BlockedTime": null, - "LockTime": null, - "NReturned": [ - 0, - 0, - 0, - 0, - 0 - ], - "NScanned": [ - 0, - 0, - 0, - 0, - 0 - ], - "QueryTime": [ - 0, - 0, - 0, - 0, - 0 - ], - "ResponseLength": [ - 48, - 44, - 47, - 29, - 29 - ] - }, - { - "ID": "e4122a58c99ab0a4020ce7d195c5a8cb", - "Namespace": "test.coll", - "Operation": "DISTINCT", - "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"distinct\":\"coll\",\"key\":\"a\",\"query\":{\"b\":{\"$gte\":5}}}}\n", - "Fingerprint": "DISTINCT coll a,b", - "FirstSeen": "2017-08-20T15:39:15.323Z", - "LastSeen": "2017-08-20T15:39:47.927Z", + "FirstSeen": "2017-10-15T01:54:09.039Z", + "LastSeen": "2017-10-15T01:54:53.078Z", "TableScan": false, "Count": 5, "BlockedTime": null, @@ -156,21 +115,62 @@ 0 ], "ResponseLength": [ - 254, - 261, - 264, - 145, - 145 + 48, + 44, + 47, + 29, + 29 + ] + }, + { + "ID": "e4122a58c99ab0a4020ce7d195c5a8cb", + "Namespace": "test.coll", + "Operation": "DISTINCT", + "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"distinct\":\"coll\",\"key\":\"a\",\"query\":{\"b\":{\"$gte\":5}}}}\n", + "Fingerprint": "DISTINCT coll a,b", + "FirstSeen": "2017-10-15T01:54:09.687Z", + "LastSeen": "2017-10-15T01:54:53.874Z", + "TableScan": false, + "Count": 5, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0, + 0, + 0, + 0, + 0 + ], + "NScanned": [ + 0, + 0, + 0, + 5, + 5 + ], + "QueryTime": [ + 0, + 0, + 0, + 0, + 0 + ], + "ResponseLength": [ + 199, + 206, + 209, + 90, + 90 ] }, { "ID": "a6782ae38ef891d5506341a4b0ab2747", "Namespace": "test", "Operation": "EVAL", - "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"$eval\":\"db\"}}\n", + "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"$eval\":\"1\"}}\n", "Fingerprint": "EVAL", - "FirstSeen": "2017-09-05T19:39:24.522Z", - "LastSeen": "2017-09-05T19:40:00.171Z", + "FirstSeen": "2017-10-15T01:54:09.89Z", + "LastSeen": "2017-10-15T01:54:54.085Z", "TableScan": false, "Count": 5, "BlockedTime": null, @@ -190,18 +190,18 @@ 0 ], "QueryTime": [ - 65, - 35, - 88, - 91, - 47 + 43, + 37, + 56, + 48, + 40 ], "ResponseLength": [ - 108, - 108, - 93, - 93, - 93 + 53, + 53, + 38, + 38, + 38 ] }, { @@ -210,8 +210,8 @@ "Operation": "EXPLAIN", "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"query\":{\"query\":{},\"$explain\":true}}\n", "Fingerprint": "EXPLAIN", - "FirstSeen": "2017-09-05T19:39:24.666Z", - "LastSeen": "2017-09-05T19:40:00.433Z", + "FirstSeen": "2017-10-15T01:54:10.058Z", + "LastSeen": "2017-10-15T01:54:54.257Z", "TableScan": false, "Count": 5, "BlockedTime": null, @@ -224,7 +224,7 @@ 0 ], "NScanned": [ - 44, + 10, 0, 0, 0, @@ -251,8 +251,8 @@ "Operation": "FINDANDMODIFY", "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"findandmodify\":\"coll\",\"query\":{\"a\":2},\"update\":{\"$inc\":{\"b\":1}}},\"updateobj\":{\"$inc\":{\"b\":1}}}\n", "Fingerprint": "FINDANDMODIFY coll a", - "FirstSeen": "2017-08-20T15:39:15.903Z", - "LastSeen": "2017-08-20T15:39:48.636Z", + "FirstSeen": "2017-10-15T01:54:11.011Z", + "LastSeen": "2017-10-15T01:54:55.391Z", "TableScan": false, "Count": 5, "BlockedTime": null, @@ -272,11 +272,11 @@ 3 ], "QueryTime": [ + 6, 0, - 0, - 0, - 0, - 0 + 1, + 1, + 1 ], "ResponseLength": [ 131, @@ -292,90 +292,8 @@ "Operation": "FIND", "Query": "{\"ns\":\"test.coll\",\"op\":\"query\"}\n", "Fingerprint": "FIND coll", - "FirstSeen": "2017-08-20T15:39:15.75Z", - "LastSeen": "2017-08-20T15:39:48.429Z", - "TableScan": false, - "Count": 5, - "BlockedTime": null, - "LockTime": null, - "NReturned": [ - 49, - 49, - 49, - 49, - 49 - ], - "NScanned": [ - 49, - 49, - 49, - 49, - 49 - ], - "QueryTime": [ - 0, - 0, - 0, - 0, - 0 - ], - "ResponseLength": [ - 1846, - 1846, - 2112, - 2094, - 2094 - ] - }, - { - "ID": "fe0bf975a044fe47fd32b835ceba612d", - "Namespace": "test.coll", - "Operation": "FIND", - "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"query\":{\"a\":1}}\n", - "Fingerprint": "FIND coll a", - "FirstSeen": "2017-08-20T15:39:15.457Z", - "LastSeen": "2017-08-20T15:39:48.107Z", - "TableScan": false, - "Count": 5, - "BlockedTime": null, - "LockTime": null, - "NReturned": [ - 6, - 6, - 6, - 6, - 6 - ], - "NScanned": [ - 6, - 6, - 6, - 6, - 6 - ], - "QueryTime": [ - 0, - 0, - 0, - 0, - 1 - ], - "ResponseLength": [ - 251, - 251, - 349, - 331, - 331 - ] - }, - { - "ID": "02104210d67fe680273784d833f86831", - "Namespace": "test.coll", - "Operation": "FIND", - "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"query\":{\"query\":{\"$and\":[{\"k\":{\"$gt\":1}},{\"k\":{\"$lt\":2}},{\"$or\":[{\"c\":{\"$in\":[\"/^0/\",\"/^2/\",\"/^4/\",\"/^6/\"]}},{\"pad\":{\"$in\":[\"/9$/\",\"/7$/\",\"/5$/\",\"/3$/\"]}}]}]},\"orderby\":{\"k\":-1}}}\n", - "Fingerprint": "FIND coll c,k,pad", - "FirstSeen": "2017-08-20T15:39:15.616Z", - "LastSeen": "2017-08-20T15:39:48.277Z", + "FirstSeen": "2017-10-15T01:54:10.63Z", + "LastSeen": "2017-10-15T01:54:54.87Z", "TableScan": false, "Count": 5, "BlockedTime": null, @@ -388,11 +306,11 @@ 0 ], "NScanned": [ - 98, - 98, - 49, - 49, - 49 + 0, + 0, + 0, + 0, + 0 ], "QueryTime": [ 0, @@ -409,14 +327,137 @@ 82 ] }, + { + "ID": "20fe80188ec82c9d3c3dcf3f4817f8f9", + "Namespace": "test.coll", + "Operation": "FIND", + "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"query\":{\"query\":{\"c\":1},\"orderby\":{\"b\":-1}}}\n", + "Fingerprint": "FIND coll b,c", + "FirstSeen": "2017-10-15T01:54:10.817Z", + "LastSeen": "2017-10-15T01:54:55.111Z", + "TableScan": false, + "Count": 5, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 2, + 2, + 2, + 2, + 2 + ], + "NScanned": [ + 2, + 2, + 2, + 2, + 2 + ], + "QueryTime": [ + 0, + 0, + 0, + 0, + 0 + ], + "ResponseLength": [ + 108, + 108, + 194, + 176, + 176 + ] + }, + { + "ID": "02104210d67fe680273784d833f86831", + "Namespace": "test.coll", + "Operation": "FIND", + "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"query\":{\"query\":{\"$and\":[{\"k\":{\"$gt\":1}},{\"k\":{\"$lt\":2}},{\"$or\":[{\"c\":{\"$in\":[\"/^0/\",\"/^2/\",\"/^4/\",\"/^6/\"]}},{\"pad\":{\"$in\":[\"/9$/\",\"/7$/\",\"/5$/\",\"/3$/\"]}}]}]},\"orderby\":{\"k\":-1}}}\n", + "Fingerprint": "FIND coll c,k,pad", + "FirstSeen": "2017-10-15T01:54:10.474Z", + "LastSeen": "2017-10-15T01:54:54.693Z", + "TableScan": false, + "Count": 5, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0, + 0, + 0, + 0, + 0 + ], + "NScanned": [ + 0, + 0, + 0, + 0, + 0 + ], + "QueryTime": [ + 0, + 0, + 0, + 0, + 0 + ], + "ResponseLength": [ + 20, + 20, + 100, + 82, + 82 + ] + }, + { + "ID": "5efe4738d807c74b3980de76c37a0870", + "Namespace": "test.coll", + "Operation": "FIND", + "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"query\":{\"k\":1}}\n", + "Fingerprint": "FIND coll k", + "FirstSeen": "2017-10-15T01:54:10.277Z", + "LastSeen": "2017-10-15T01:54:54.507Z", + "TableScan": false, + "Count": 5, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 2, + 2, + 2, + 2, + 2 + ], + "NScanned": [ + 2, + 2, + 2, + 2, + 2 + ], + "QueryTime": [ + 0, + 0, + 1, + 0, + 0 + ], + "ResponseLength": [ + 86, + 86, + 172, + 154, + 154 + ] + }, { "ID": "c70403cbd55ffbb07f08c0cb77a24b19", "Namespace": "test.coll", "Operation": "GEONEAR", "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"geoNear\":\"coll\",\"near\":{\"type\":\"Point\",\"coordinates\":[1,1]},\"spherical\":true}}\n", "Fingerprint": "GEONEAR coll", - "FirstSeen": "2017-08-20T15:39:16.061Z", - "LastSeen": "2017-08-20T15:39:48.842Z", + "FirstSeen": "2017-10-15T01:54:11.181Z", + "LastSeen": "2017-10-15T01:54:55.701Z", "TableScan": false, "Count": 5, "BlockedTime": null, @@ -437,10 +478,10 @@ ], "QueryTime": [ 1, - 3, - 8, - 11, - 7 + 2, + 10, + 13, + 11 ], "ResponseLength": [ 1406, @@ -450,14 +491,55 @@ 1383 ] }, + { + "ID": "db759bfd83441deecc71382323041ce6", + "Namespace": "test.coll", + "Operation": "GETMORE", + "Query": "{\"ns\":\"test.coll\",\"op\":\"getmore\",\"query\":{\"a\":{\"$gt\":0}}}\n", + "Fingerprint": "GETMORE coll", + "FirstSeen": "2017-10-15T01:54:11.36Z", + "LastSeen": "2017-10-15T01:54:56.186Z", + "TableScan": false, + "Count": 5, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 2, + 0, + 0, + 2, + 0 + ], + "NScanned": [ + 0, + 0, + 0, + 2, + 0 + ], + "QueryTime": [ + 0, + 0, + 0, + 0, + 0 + ], + "ResponseLength": [ + 86, + 20, + 81, + 153, + 81 + ] + }, { "ID": "ca8bb19386488570447f5753741fb494", "Namespace": "test.coll", "Operation": "GROUP", "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"group\":{\"key\":{\"a\":1,\"b\":1},\"cond\":{\"b\":3},\"initial\":{},\"ns\":\"coll\",\"$reduce\":\"\"}}}\n", "Fingerprint": "GROUP coll a,b", - "FirstSeen": "2017-08-20T15:39:16.325Z", - "LastSeen": "2017-08-20T15:39:49.276Z", + "FirstSeen": "2017-10-15T01:54:11.599Z", + "LastSeen": "2017-10-15T01:54:56.478Z", "TableScan": false, "Count": 5, "BlockedTime": null, @@ -477,11 +559,11 @@ 2 ], "QueryTime": [ - 77, - 54, - 74, - 77, - 68 + 36, + 26, + 31, + 31, + 24 ], "ResponseLength": [ 135, @@ -497,8 +579,8 @@ "Operation": "INSERT", "Query": "{\"ns\":\"test.coll\",\"op\":\"insert\",\"query\":{\"_id\":1}}\n", "Fingerprint": "INSERT coll", - "FirstSeen": "2017-08-20T15:39:16.473Z", - "LastSeen": "2017-08-20T15:39:49.44Z", + "FirstSeen": "2017-10-15T01:54:11.737Z", + "LastSeen": "2017-10-15T01:54:56.693Z", "TableScan": false, "Count": 5, "BlockedTime": null, @@ -519,10 +601,10 @@ ], "QueryTime": [ 0, - 0, - 0, - 0, - 0 + 4, + 11, + 11, + 11 ], "ResponseLength": [ 0, @@ -538,8 +620,8 @@ "Operation": "MAPREDUCE", "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"mapreduce\":\"coll\",\"map\":\"\",\"reduce\":\"\",\"query\":{\"a\":{\"$gte\":0}},\"out\":{\"inline\":1}}}\n", "Fingerprint": "MAPREDUCE coll a", - "FirstSeen": "2017-08-20T15:39:16.701Z", - "LastSeen": "2017-08-20T15:39:49.68Z", + "FirstSeen": "2017-10-15T01:54:11.959Z", + "LastSeen": "2017-10-15T01:54:56.951Z", "TableScan": false, "Count": 5, "BlockedTime": null, @@ -559,11 +641,11 @@ 3 ], "QueryTime": [ - 33, - 26, - 31, - 43, - 35 + 29, + 21, + 41, + 21, + 26 ], "ResponseLength": [ 233, @@ -579,8 +661,8 @@ "Operation": "REMOVE", "Query": "{\"ns\":\"test.coll\",\"op\":\"remove\",\"query\":{\"a\":{\"$gte\":2},\"b\":{\"$gte\":2}}}\n", "Fingerprint": "REMOVE coll a,b", - "FirstSeen": "2017-08-20T15:39:15.126Z", - "LastSeen": "2017-08-30T10:55:19.142Z", + "FirstSeen": "2017-10-15T01:54:09.246Z", + "LastSeen": "2017-10-15T01:54:53.615Z", "TableScan": false, "Count": 10, "BlockedTime": null, @@ -601,25 +683,25 @@ 0, 0, 0, - 4, - 4, + 1, + 1, 0, 0, 0, - 39, - 39 + 8, + 8 ], "QueryTime": [ 0, 0, 1, 0, - 0, - 0, 1, 0, 0, - 0 + 1, + 1, + 1 ], "ResponseLength": [ 0, @@ -640,8 +722,8 @@ "Operation": "UPDATE", "Query": "{\"ns\":\"test.coll\",\"op\":\"update\",\"query\":{\"a\":{\"$gte\":2}},\"updateobj\":{\"$set\":{\"c\":1},\"$inc\":{\"a\":-10}}}\n", "Fingerprint": "UPDATE coll a", - "FirstSeen": "2017-08-20T15:39:16.921Z", - "LastSeen": "2017-08-20T15:39:49.855Z", + "FirstSeen": "2017-10-15T01:54:12.161Z", + "LastSeen": "2017-10-15T01:54:57.231Z", "TableScan": false, "Count": 5, "BlockedTime": null, @@ -663,7 +745,7 @@ "QueryTime": [ 0, 0, - 0, + 2, 0, 0 ], diff --git a/src/go/tests/expect/stats_single/aggregate_2.6.12 b/src/go/tests/expect/stats_single/aggregate_2.6.12 index 124f954a..d64f3360 100755 --- a/src/go/tests/expect/stats_single/aggregate_2.6.12 +++ b/src/go/tests/expect/stats_single/aggregate_2.6.12 @@ -5,8 +5,8 @@ "Operation": "AGGREGATE", "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"aggregate\":\"coll\",\"pipeline\":[{\"$match\":{\"a\":{\"$gte\":2}}}],\"cursor\":{}}}\n", "Fingerprint": "AGGREGATE coll a", - "FirstSeen": "2017-08-20T15:39:14.658Z", - "LastSeen": "2017-08-20T15:39:14.658Z", + "FirstSeen": "2017-10-15T01:54:08.661Z", + "LastSeen": "2017-10-15T01:54:08.661Z", "TableScan": false, "Count": 1, "BlockedTime": null, diff --git a/src/go/tests/expect/stats_single/aggregate_3.0.15 b/src/go/tests/expect/stats_single/aggregate_3.0.15 index c1cbac26..bd727fed 100755 --- a/src/go/tests/expect/stats_single/aggregate_3.0.15 +++ b/src/go/tests/expect/stats_single/aggregate_3.0.15 @@ -5,8 +5,8 @@ "Operation": "AGGREGATE", "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"aggregate\":\"coll\",\"pipeline\":[{\"$match\":{\"a\":{\"$gte\":2}}}],\"cursor\":{}}}\n", "Fingerprint": "AGGREGATE coll a", - "FirstSeen": "2017-08-20T15:39:20.858Z", - "LastSeen": "2017-08-20T15:39:20.858Z", + "FirstSeen": "2017-10-15T01:54:18.509Z", + "LastSeen": "2017-10-15T01:54:18.509Z", "TableScan": false, "Count": 1, "BlockedTime": null, @@ -18,7 +18,7 @@ 0 ], "QueryTime": [ - 2 + 0 ], "ResponseLength": [ 385 diff --git a/src/go/tests/expect/stats_single/aggregate_3.2.16 b/src/go/tests/expect/stats_single/aggregate_3.2.16 index 363c2d50..7e85bb5c 100755 --- a/src/go/tests/expect/stats_single/aggregate_3.2.16 +++ b/src/go/tests/expect/stats_single/aggregate_3.2.16 @@ -5,8 +5,8 @@ "Operation": "AGGREGATE", "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"aggregate\":\"coll\",\"pipeline\":[{\"$match\":{\"a\":{\"$gte\":2}}}],\"cursor\":{}}}\n", "Fingerprint": "AGGREGATE coll a", - "FirstSeen": "2017-08-20T15:39:29.915Z", - "LastSeen": "2017-08-20T15:39:29.915Z", + "FirstSeen": "2017-10-15T01:54:31.293Z", + "LastSeen": "2017-10-15T01:54:31.293Z", "TableScan": false, "Count": 1, "BlockedTime": null, @@ -18,7 +18,7 @@ 0 ], "QueryTime": [ - 2 + 0 ], "ResponseLength": [ 388 diff --git a/src/go/tests/expect/stats_single/aggregate_3.4.7 b/src/go/tests/expect/stats_single/aggregate_3.4.7 index 266dfdfd..f71f3dfb 100755 --- a/src/go/tests/expect/stats_single/aggregate_3.4.7 +++ b/src/go/tests/expect/stats_single/aggregate_3.4.7 @@ -5,8 +5,8 @@ "Operation": "AGGREGATE", "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"aggregate\":\"coll\",\"pipeline\":[{\"$match\":{\"a\":{\"$gte\":2}}}],\"cursor\":{}}}\n", "Fingerprint": "AGGREGATE coll a", - "FirstSeen": "2017-08-20T15:39:36.711Z", - "LastSeen": "2017-08-20T15:39:36.711Z", + "FirstSeen": "2017-10-15T01:54:41.948Z", + "LastSeen": "2017-10-15T01:54:41.948Z", "TableScan": false, "Count": 1, "BlockedTime": null, diff --git a/src/go/tests/expect/stats_single/aggregate_3.5.11 b/src/go/tests/expect/stats_single/aggregate_3.5.11 index 3f7369e7..45275f1e 100755 --- a/src/go/tests/expect/stats_single/aggregate_3.5.11 +++ b/src/go/tests/expect/stats_single/aggregate_3.5.11 @@ -5,8 +5,8 @@ "Operation": "AGGREGATE", "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"aggregate\":\"coll\",\"pipeline\":[{\"$match\":{\"a\":{\"$gte\":2}}}],\"cursor\":{},\"$db\":\"test\"}}\n", "Fingerprint": "AGGREGATE coll a", - "FirstSeen": "2017-08-20T15:39:47.203Z", - "LastSeen": "2017-08-20T15:39:47.203Z", + "FirstSeen": "2017-10-15T01:54:52.564Z", + "LastSeen": "2017-10-15T01:54:52.564Z", "TableScan": false, "Count": 1, "BlockedTime": null, diff --git a/src/go/tests/expect/stats_single/count_2.6.12 b/src/go/tests/expect/stats_single/count_2.6.12 index 0880b743..12a31dcb 100755 --- a/src/go/tests/expect/stats_single/count_2.6.12 +++ b/src/go/tests/expect/stats_single/count_2.6.12 @@ -5,8 +5,8 @@ "Operation": "COUNT", "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"count\":\"coll\",\"query\":{},\"fields\":{}}}\n", "Fingerprint": "COUNT coll", - "FirstSeen": "2017-08-20T15:39:14.823Z", - "LastSeen": "2017-08-20T15:39:14.823Z", + "FirstSeen": "2017-10-15T01:54:08.889Z", + "LastSeen": "2017-10-15T01:54:08.889Z", "TableScan": false, "Count": 1, "BlockedTime": null, diff --git a/src/go/tests/expect/stats_single/count_3.0.15 b/src/go/tests/expect/stats_single/count_3.0.15 index 54257535..3c772bd5 100755 --- a/src/go/tests/expect/stats_single/count_3.0.15 +++ b/src/go/tests/expect/stats_single/count_3.0.15 @@ -5,8 +5,8 @@ "Operation": "COUNT", "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"count\":\"coll\",\"query\":{},\"fields\":{}}}\n", "Fingerprint": "COUNT coll", - "FirstSeen": "2017-08-20T15:39:20.982Z", - "LastSeen": "2017-08-20T15:39:20.982Z", + "FirstSeen": "2017-10-15T01:54:18.673Z", + "LastSeen": "2017-10-15T01:54:18.673Z", "TableScan": false, "Count": 1, "BlockedTime": null, diff --git a/src/go/tests/expect/stats_single/count_3.2.16 b/src/go/tests/expect/stats_single/count_3.2.16 index 1a2173f4..f4cf1838 100755 --- a/src/go/tests/expect/stats_single/count_3.2.16 +++ b/src/go/tests/expect/stats_single/count_3.2.16 @@ -5,8 +5,8 @@ "Operation": "COUNT", "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"count\":\"coll\",\"query\":{},\"fields\":{}}}\n", "Fingerprint": "COUNT coll", - "FirstSeen": "2017-08-20T15:39:30.094Z", - "LastSeen": "2017-08-20T15:39:30.094Z", + "FirstSeen": "2017-10-15T01:54:31.529Z", + "LastSeen": "2017-10-15T01:54:31.529Z", "TableScan": false, "Count": 1, "BlockedTime": null, diff --git a/src/go/tests/expect/stats_single/count_3.4.7 b/src/go/tests/expect/stats_single/count_3.4.7 index 67e5e652..867ddd21 100755 --- a/src/go/tests/expect/stats_single/count_3.4.7 +++ b/src/go/tests/expect/stats_single/count_3.4.7 @@ -5,8 +5,8 @@ "Operation": "COUNT", "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"count\":\"coll\",\"query\":{},\"fields\":{}}}\n", "Fingerprint": "COUNT coll", - "FirstSeen": "2017-08-20T15:39:36.897Z", - "LastSeen": "2017-08-20T15:39:36.897Z", + "FirstSeen": "2017-10-15T01:54:42.157Z", + "LastSeen": "2017-10-15T01:54:42.157Z", "TableScan": false, "Count": 1, "BlockedTime": null, diff --git a/src/go/tests/expect/stats_single/count_3.5.11 b/src/go/tests/expect/stats_single/count_3.5.11 index 97b3b320..a12b11fa 100755 --- a/src/go/tests/expect/stats_single/count_3.5.11 +++ b/src/go/tests/expect/stats_single/count_3.5.11 @@ -5,8 +5,8 @@ "Operation": "COUNT", "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"count\":\"coll\",\"query\":{},\"fields\":{},\"$db\":\"test\"}}\n", "Fingerprint": "COUNT coll", - "FirstSeen": "2017-08-20T15:39:47.396Z", - "LastSeen": "2017-08-20T15:39:47.396Z", + "FirstSeen": "2017-10-15T01:54:52.844Z", + "LastSeen": "2017-10-15T01:54:52.844Z", "TableScan": false, "Count": 1, "BlockedTime": null, diff --git a/src/go/tests/expect/stats_single/count_with_query_2.6.12 b/src/go/tests/expect/stats_single/count_with_query_2.6.12 index e01cedac..54e52d62 100755 --- a/src/go/tests/expect/stats_single/count_with_query_2.6.12 +++ b/src/go/tests/expect/stats_single/count_with_query_2.6.12 @@ -5,8 +5,8 @@ "Operation": "COUNT", "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"count\":\"coll\",\"query\":{\"a\":{\"$gt\":5}},\"fields\":{}}}\n", "Fingerprint": "COUNT coll a", - "FirstSeen": "2017-08-20T15:39:14.971Z", - "LastSeen": "2017-08-20T15:39:14.971Z", + "FirstSeen": "2017-10-15T01:54:09.039Z", + "LastSeen": "2017-10-15T01:54:09.039Z", "TableScan": false, "Count": 1, "BlockedTime": null, diff --git a/src/go/tests/expect/stats_single/count_with_query_3.0.15 b/src/go/tests/expect/stats_single/count_with_query_3.0.15 index 97f6f4bb..7d1e1d81 100755 --- a/src/go/tests/expect/stats_single/count_with_query_3.0.15 +++ b/src/go/tests/expect/stats_single/count_with_query_3.0.15 @@ -5,8 +5,8 @@ "Operation": "COUNT", "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"count\":\"coll\",\"query\":{\"a\":{\"$gt\":5}},\"fields\":{}}}\n", "Fingerprint": "COUNT coll a", - "FirstSeen": "2017-08-20T15:39:21.124Z", - "LastSeen": "2017-08-20T15:39:21.124Z", + "FirstSeen": "2017-10-15T01:54:18.838Z", + "LastSeen": "2017-10-15T01:54:18.838Z", "TableScan": false, "Count": 1, "BlockedTime": null, diff --git a/src/go/tests/expect/stats_single/count_with_query_3.2.16 b/src/go/tests/expect/stats_single/count_with_query_3.2.16 index a8509d69..e6cbb692 100755 --- a/src/go/tests/expect/stats_single/count_with_query_3.2.16 +++ b/src/go/tests/expect/stats_single/count_with_query_3.2.16 @@ -5,8 +5,8 @@ "Operation": "COUNT", "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"count\":\"coll\",\"query\":{\"a\":{\"$gt\":5}},\"fields\":{}}}\n", "Fingerprint": "COUNT coll a", - "FirstSeen": "2017-08-20T15:39:30.251Z", - "LastSeen": "2017-08-20T15:39:30.251Z", + "FirstSeen": "2017-10-15T01:54:31.756Z", + "LastSeen": "2017-10-15T01:54:31.756Z", "TableScan": false, "Count": 1, "BlockedTime": null, diff --git a/src/go/tests/expect/stats_single/count_with_query_3.4.7 b/src/go/tests/expect/stats_single/count_with_query_3.4.7 index a95352d5..5c8ced90 100755 --- a/src/go/tests/expect/stats_single/count_with_query_3.4.7 +++ b/src/go/tests/expect/stats_single/count_with_query_3.4.7 @@ -5,8 +5,8 @@ "Operation": "COUNT", "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"count\":\"coll\",\"query\":{\"a\":{\"$gt\":5}},\"fields\":{}}}\n", "Fingerprint": "COUNT coll a", - "FirstSeen": "2017-08-20T15:39:37.077Z", - "LastSeen": "2017-08-20T15:39:37.077Z", + "FirstSeen": "2017-10-15T01:54:42.35Z", + "LastSeen": "2017-10-15T01:54:42.35Z", "TableScan": false, "Count": 1, "BlockedTime": null, @@ -15,7 +15,7 @@ 0 ], "NScanned": [ - 0 + 10 ], "QueryTime": [ 0 diff --git a/src/go/tests/expect/stats_single/count_with_query_3.5.11 b/src/go/tests/expect/stats_single/count_with_query_3.5.11 index a91ee1fc..8a9523a4 100755 --- a/src/go/tests/expect/stats_single/count_with_query_3.5.11 +++ b/src/go/tests/expect/stats_single/count_with_query_3.5.11 @@ -5,8 +5,8 @@ "Operation": "COUNT", "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"count\":\"coll\",\"query\":{\"a\":{\"$gt\":5}},\"fields\":{},\"$db\":\"test\"}}\n", "Fingerprint": "COUNT coll a", - "FirstSeen": "2017-08-20T15:39:47.573Z", - "LastSeen": "2017-08-20T15:39:47.573Z", + "FirstSeen": "2017-10-15T01:54:53.078Z", + "LastSeen": "2017-10-15T01:54:53.078Z", "TableScan": false, "Count": 1, "BlockedTime": null, @@ -15,7 +15,7 @@ 0 ], "NScanned": [ - 0 + 10 ], "QueryTime": [ 0 diff --git a/src/go/tests/expect/stats_single/delete_2.6.12 b/src/go/tests/expect/stats_single/delete_2.6.12 index 05e3cbcf..d4cf7929 100755 --- a/src/go/tests/expect/stats_single/delete_2.6.12 +++ b/src/go/tests/expect/stats_single/delete_2.6.12 @@ -5,8 +5,8 @@ "Operation": "REMOVE", "Query": "{\"ns\":\"test.coll\",\"op\":\"remove\",\"query\":{\"a\":{\"$gte\":2},\"b\":{\"$gte\":2}}}\n", "Fingerprint": "REMOVE coll a,b", - "FirstSeen": "2017-08-20T15:39:15.126Z", - "LastSeen": "2017-08-20T15:39:15.126Z", + "FirstSeen": "2017-10-15T01:54:09.246Z", + "LastSeen": "2017-10-15T01:54:09.246Z", "TableScan": false, "Count": 1, "BlockedTime": null, diff --git a/src/go/tests/expect/stats_single/delete_3.0.15 b/src/go/tests/expect/stats_single/delete_3.0.15 index ee4236c0..58f2cbf9 100755 --- a/src/go/tests/expect/stats_single/delete_3.0.15 +++ b/src/go/tests/expect/stats_single/delete_3.0.15 @@ -5,8 +5,8 @@ "Operation": "REMOVE", "Query": "{\"ns\":\"test.coll\",\"op\":\"remove\",\"query\":{\"a\":{\"$gte\":2},\"b\":{\"$gte\":2}}}\n", "Fingerprint": "REMOVE coll a,b", - "FirstSeen": "2017-08-20T15:39:21.265Z", - "LastSeen": "2017-08-20T15:39:21.265Z", + "FirstSeen": "2017-10-15T01:54:19.034Z", + "LastSeen": "2017-10-15T01:54:19.034Z", "TableScan": false, "Count": 1, "BlockedTime": null, diff --git a/src/go/tests/expect/stats_single/delete_3.2.16 b/src/go/tests/expect/stats_single/delete_3.2.16 index b38ca7b7..adcfc5c1 100755 --- a/src/go/tests/expect/stats_single/delete_3.2.16 +++ b/src/go/tests/expect/stats_single/delete_3.2.16 @@ -5,8 +5,8 @@ "Operation": "REMOVE", "Query": "{\"ns\":\"test.coll\",\"op\":\"remove\",\"query\":{\"a\":{\"$gte\":2},\"b\":{\"$gte\":2}}}\n", "Fingerprint": "REMOVE coll a,b", - "FirstSeen": "2017-08-20T15:39:30.543Z", - "LastSeen": "2017-08-20T15:39:30.543Z", + "FirstSeen": "2017-10-15T01:54:32.02Z", + "LastSeen": "2017-10-15T01:54:32.02Z", "TableScan": false, "Count": 1, "BlockedTime": null, diff --git a/src/go/tests/expect/stats_single/delete_3.4.7 b/src/go/tests/expect/stats_single/delete_3.4.7 index ad373395..35449aa5 100755 --- a/src/go/tests/expect/stats_single/delete_3.4.7 +++ b/src/go/tests/expect/stats_single/delete_3.4.7 @@ -5,8 +5,8 @@ "Operation": "REMOVE", "Query": "{\"ns\":\"test.coll\",\"op\":\"remove\",\"query\":{\"a\":{\"$gte\":2},\"b\":{\"$gte\":2}}}\n", "Fingerprint": "REMOVE coll a,b", - "FirstSeen": "2017-08-20T15:39:37.279Z", - "LastSeen": "2017-08-20T15:39:37.279Z", + "FirstSeen": "2017-10-15T01:54:42.612Z", + "LastSeen": "2017-10-15T01:54:42.612Z", "TableScan": false, "Count": 1, "BlockedTime": null, @@ -15,7 +15,7 @@ 0 ], "NScanned": [ - 4 + 1 ], "QueryTime": [ 0 diff --git a/src/go/tests/expect/stats_single/delete_3.5.11 b/src/go/tests/expect/stats_single/delete_3.5.11 index 9f2b0511..fb21b711 100755 --- a/src/go/tests/expect/stats_single/delete_3.5.11 +++ b/src/go/tests/expect/stats_single/delete_3.5.11 @@ -5,8 +5,8 @@ "Operation": "REMOVE", "Query": "{\"ns\":\"test.coll\",\"op\":\"remove\",\"command\":{\"q\":{\"a\":{\"$gte\":2},\"b\":{\"$gte\":2}},\"limit\":1}}\n", "Fingerprint": "REMOVE coll a,b", - "FirstSeen": "2017-08-20T15:39:47.745Z", - "LastSeen": "2017-08-20T15:39:47.745Z", + "FirstSeen": "2017-10-15T01:54:53.333Z", + "LastSeen": "2017-10-15T01:54:53.333Z", "TableScan": false, "Count": 1, "BlockedTime": null, @@ -15,10 +15,10 @@ 0 ], "NScanned": [ - 4 + 1 ], "QueryTime": [ - 0 + 1 ], "ResponseLength": [ 0 diff --git a/src/go/tests/expect/stats_single/delete_all_2.6.12 b/src/go/tests/expect/stats_single/delete_all_2.6.12 index d5138f09..2d739353 100755 --- a/src/go/tests/expect/stats_single/delete_all_2.6.12 +++ b/src/go/tests/expect/stats_single/delete_all_2.6.12 @@ -5,8 +5,8 @@ "Operation": "REMOVE", "Query": "{\"ns\":\"test.coll\",\"op\":\"remove\",\"query\":{\"a\":{\"$gte\":2},\"b\":{\"$gte\":2}}}\n", "Fingerprint": "REMOVE coll a,b", - "FirstSeen": "2017-08-30T10:54:45.348Z", - "LastSeen": "2017-08-30T10:54:45.348Z", + "FirstSeen": "2017-10-15T01:54:09.463Z", + "LastSeen": "2017-10-15T01:54:09.463Z", "TableScan": false, "Count": 1, "BlockedTime": null, diff --git a/src/go/tests/expect/stats_single/delete_all_3.0.15 b/src/go/tests/expect/stats_single/delete_all_3.0.15 index 24ec050f..53995300 100755 --- a/src/go/tests/expect/stats_single/delete_all_3.0.15 +++ b/src/go/tests/expect/stats_single/delete_all_3.0.15 @@ -5,8 +5,8 @@ "Operation": "REMOVE", "Query": "{\"ns\":\"test.coll\",\"op\":\"remove\",\"query\":{\"a\":{\"$gte\":2},\"b\":{\"$gte\":2}}}\n", "Fingerprint": "REMOVE coll a,b", - "FirstSeen": "2017-08-30T10:54:52.821Z", - "LastSeen": "2017-08-30T10:54:52.821Z", + "FirstSeen": "2017-10-15T01:54:19.206Z", + "LastSeen": "2017-10-15T01:54:19.206Z", "TableScan": false, "Count": 1, "BlockedTime": null, @@ -18,7 +18,7 @@ 0 ], "QueryTime": [ - 1 + 0 ], "ResponseLength": [ 0 diff --git a/src/go/tests/expect/stats_single/delete_all_3.2.16 b/src/go/tests/expect/stats_single/delete_all_3.2.16 index be1f7b48..52b42285 100755 --- a/src/go/tests/expect/stats_single/delete_all_3.2.16 +++ b/src/go/tests/expect/stats_single/delete_all_3.2.16 @@ -5,8 +5,8 @@ "Operation": "REMOVE", "Query": "{\"ns\":\"test.coll\",\"op\":\"remove\",\"query\":{\"a\":{\"$gte\":2},\"b\":{\"$gte\":2}}}\n", "Fingerprint": "REMOVE coll a,b", - "FirstSeen": "2017-08-30T10:55:02.238Z", - "LastSeen": "2017-08-30T10:55:02.238Z", + "FirstSeen": "2017-10-15T01:54:32.281Z", + "LastSeen": "2017-10-15T01:54:32.281Z", "TableScan": false, "Count": 1, "BlockedTime": null, @@ -18,7 +18,7 @@ 0 ], "QueryTime": [ - 0 + 1 ], "ResponseLength": [ 0 diff --git a/src/go/tests/expect/stats_single/delete_all_3.4.7 b/src/go/tests/expect/stats_single/delete_all_3.4.7 index 466971bd..86ca7924 100755 --- a/src/go/tests/expect/stats_single/delete_all_3.4.7 +++ b/src/go/tests/expect/stats_single/delete_all_3.4.7 @@ -5,8 +5,8 @@ "Operation": "REMOVE", "Query": "{\"ns\":\"test.coll\",\"op\":\"remove\",\"query\":{\"a\":{\"$gte\":2},\"b\":{\"$gte\":2}}}\n", "Fingerprint": "REMOVE coll a,b", - "FirstSeen": "2017-08-30T10:55:09.833Z", - "LastSeen": "2017-08-30T10:55:09.833Z", + "FirstSeen": "2017-10-15T01:54:42.82Z", + "LastSeen": "2017-10-15T01:54:42.82Z", "TableScan": false, "Count": 1, "BlockedTime": null, @@ -15,10 +15,10 @@ 0 ], "NScanned": [ - 39 + 8 ], "QueryTime": [ - 0 + 1 ], "ResponseLength": [ 0 diff --git a/src/go/tests/expect/stats_single/delete_all_3.5.11 b/src/go/tests/expect/stats_single/delete_all_3.5.11 index 54be6162..ee49d55d 100755 --- a/src/go/tests/expect/stats_single/delete_all_3.5.11 +++ b/src/go/tests/expect/stats_single/delete_all_3.5.11 @@ -5,8 +5,8 @@ "Operation": "REMOVE", "Query": "{\"ns\":\"test.coll\",\"op\":\"remove\",\"command\":{\"q\":{\"a\":{\"$gte\":2},\"b\":{\"$gte\":2}},\"limit\":0}}\n", "Fingerprint": "REMOVE coll a,b", - "FirstSeen": "2017-08-30T10:55:19.142Z", - "LastSeen": "2017-08-30T10:55:19.142Z", + "FirstSeen": "2017-10-15T01:54:53.615Z", + "LastSeen": "2017-10-15T01:54:53.615Z", "TableScan": false, "Count": 1, "BlockedTime": null, @@ -15,10 +15,10 @@ 0 ], "NScanned": [ - 39 + 8 ], "QueryTime": [ - 0 + 1 ], "ResponseLength": [ 0 diff --git a/src/go/tests/expect/stats_single/distinct_2.6.12 b/src/go/tests/expect/stats_single/distinct_2.6.12 index 92247985..f2e3106b 100755 --- a/src/go/tests/expect/stats_single/distinct_2.6.12 +++ b/src/go/tests/expect/stats_single/distinct_2.6.12 @@ -5,8 +5,8 @@ "Operation": "DISTINCT", "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"distinct\":\"coll\",\"key\":\"a\",\"query\":{\"b\":{\"$gte\":5}}}}\n", "Fingerprint": "DISTINCT coll a,b", - "FirstSeen": "2017-08-20T15:39:15.323Z", - "LastSeen": "2017-08-20T15:39:15.323Z", + "FirstSeen": "2017-10-15T01:54:09.687Z", + "LastSeen": "2017-10-15T01:54:09.687Z", "TableScan": false, "Count": 1, "BlockedTime": null, @@ -21,7 +21,7 @@ 0 ], "ResponseLength": [ - 254 + 199 ] } ] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/distinct_3.0.15 b/src/go/tests/expect/stats_single/distinct_3.0.15 index 87e55c38..281541e3 100755 --- a/src/go/tests/expect/stats_single/distinct_3.0.15 +++ b/src/go/tests/expect/stats_single/distinct_3.0.15 @@ -5,8 +5,8 @@ "Operation": "DISTINCT", "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"distinct\":\"coll\",\"key\":\"a\",\"query\":{\"b\":{\"$gte\":5}}}}\n", "Fingerprint": "DISTINCT coll a,b", - "FirstSeen": "2017-08-20T15:39:21.392Z", - "LastSeen": "2017-08-20T15:39:21.392Z", + "FirstSeen": "2017-10-15T01:54:19.38Z", + "LastSeen": "2017-10-15T01:54:19.38Z", "TableScan": false, "Count": 1, "BlockedTime": null, @@ -21,7 +21,7 @@ 0 ], "ResponseLength": [ - 261 + 206 ] } ] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/distinct_3.2.16 b/src/go/tests/expect/stats_single/distinct_3.2.16 index bead6771..9ea9a80d 100755 --- a/src/go/tests/expect/stats_single/distinct_3.2.16 +++ b/src/go/tests/expect/stats_single/distinct_3.2.16 @@ -5,8 +5,8 @@ "Operation": "DISTINCT", "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"distinct\":\"coll\",\"key\":\"a\",\"query\":{\"b\":{\"$gte\":5}}}}\n", "Fingerprint": "DISTINCT coll a,b", - "FirstSeen": "2017-08-20T15:39:30.748Z", - "LastSeen": "2017-08-20T15:39:30.748Z", + "FirstSeen": "2017-10-15T01:54:32.523Z", + "LastSeen": "2017-10-15T01:54:32.523Z", "TableScan": false, "Count": 1, "BlockedTime": null, @@ -21,7 +21,7 @@ 0 ], "ResponseLength": [ - 264 + 209 ] } ] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/distinct_3.4.7 b/src/go/tests/expect/stats_single/distinct_3.4.7 index 6bea585a..92c16a2a 100755 --- a/src/go/tests/expect/stats_single/distinct_3.4.7 +++ b/src/go/tests/expect/stats_single/distinct_3.4.7 @@ -5,8 +5,8 @@ "Operation": "DISTINCT", "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"distinct\":\"coll\",\"key\":\"a\",\"query\":{\"b\":{\"$gte\":5}}}}\n", "Fingerprint": "DISTINCT coll a,b", - "FirstSeen": "2017-08-20T15:39:37.511Z", - "LastSeen": "2017-08-20T15:39:37.511Z", + "FirstSeen": "2017-10-15T01:54:43.048Z", + "LastSeen": "2017-10-15T01:54:43.048Z", "TableScan": false, "Count": 1, "BlockedTime": null, @@ -15,13 +15,13 @@ 0 ], "NScanned": [ - 10 + 5 ], "QueryTime": [ 0 ], "ResponseLength": [ - 145 + 90 ] } ] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/distinct_3.5.11 b/src/go/tests/expect/stats_single/distinct_3.5.11 index 77458131..f8d9e57b 100755 --- a/src/go/tests/expect/stats_single/distinct_3.5.11 +++ b/src/go/tests/expect/stats_single/distinct_3.5.11 @@ -5,8 +5,8 @@ "Operation": "DISTINCT", "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"distinct\":\"coll\",\"key\":\"a\",\"query\":{\"b\":{\"$gte\":5}},\"$db\":\"test\"}}\n", "Fingerprint": "DISTINCT coll a,b", - "FirstSeen": "2017-08-20T15:39:47.927Z", - "LastSeen": "2017-08-20T15:39:47.927Z", + "FirstSeen": "2017-10-15T01:54:53.874Z", + "LastSeen": "2017-10-15T01:54:53.874Z", "TableScan": false, "Count": 1, "BlockedTime": null, @@ -15,13 +15,13 @@ 0 ], "NScanned": [ - 10 + 5 ], "QueryTime": [ 0 ], "ResponseLength": [ - 145 + 90 ] } ] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/eval_2.6.12 b/src/go/tests/expect/stats_single/eval_2.6.12 index d69d5bda..af410ea5 100755 --- a/src/go/tests/expect/stats_single/eval_2.6.12 +++ b/src/go/tests/expect/stats_single/eval_2.6.12 @@ -3,10 +3,10 @@ "ID": "a6782ae38ef891d5506341a4b0ab2747", "Namespace": "test", "Operation": "EVAL", - "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"$eval\":\"db\"}}\n", + "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"$eval\":\"1\"}}\n", "Fingerprint": "EVAL", - "FirstSeen": "2017-09-05T19:39:24.522Z", - "LastSeen": "2017-09-05T19:39:24.522Z", + "FirstSeen": "2017-10-15T01:54:09.89Z", + "LastSeen": "2017-10-15T01:54:09.89Z", "TableScan": false, "Count": 1, "BlockedTime": null, @@ -18,10 +18,10 @@ 0 ], "QueryTime": [ - 65 + 43 ], "ResponseLength": [ - 108 + 53 ] } ] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/eval_3.0.15 b/src/go/tests/expect/stats_single/eval_3.0.15 index b4898132..93735c33 100755 --- a/src/go/tests/expect/stats_single/eval_3.0.15 +++ b/src/go/tests/expect/stats_single/eval_3.0.15 @@ -3,10 +3,10 @@ "ID": "a6782ae38ef891d5506341a4b0ab2747", "Namespace": "test", "Operation": "EVAL", - "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"$eval\":\"db\"}}\n", + "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"$eval\":\"1\"}}\n", "Fingerprint": "EVAL", - "FirstSeen": "2017-09-05T19:39:32.054Z", - "LastSeen": "2017-09-05T19:39:32.054Z", + "FirstSeen": "2017-10-15T01:54:19.572Z", + "LastSeen": "2017-10-15T01:54:19.572Z", "TableScan": false, "Count": 1, "BlockedTime": null, @@ -18,10 +18,10 @@ 0 ], "QueryTime": [ - 35 + 37 ], "ResponseLength": [ - 108 + 53 ] } ] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/eval_3.2.16 b/src/go/tests/expect/stats_single/eval_3.2.16 index 4f7ab133..7564171f 100755 --- a/src/go/tests/expect/stats_single/eval_3.2.16 +++ b/src/go/tests/expect/stats_single/eval_3.2.16 @@ -3,10 +3,10 @@ "ID": "a6782ae38ef891d5506341a4b0ab2747", "Namespace": "test", "Operation": "EVAL", - "Query": "{\"ns\":\"test\",\"op\":\"command\",\"command\":{\"$eval\":\"db\"}}\n", + "Query": "{\"ns\":\"test\",\"op\":\"command\",\"command\":{\"$eval\":\"1\"}}\n", "Fingerprint": "EVAL", - "FirstSeen": "2017-09-05T19:39:41.581Z", - "LastSeen": "2017-09-05T19:39:41.581Z", + "FirstSeen": "2017-10-15T01:54:32.759Z", + "LastSeen": "2017-10-15T01:54:32.759Z", "TableScan": false, "Count": 1, "BlockedTime": null, @@ -18,10 +18,10 @@ 0 ], "QueryTime": [ - 88 + 56 ], "ResponseLength": [ - 93 + 38 ] } ] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/eval_3.4.7 b/src/go/tests/expect/stats_single/eval_3.4.7 index 9bb7311e..da0361ef 100755 --- a/src/go/tests/expect/stats_single/eval_3.4.7 +++ b/src/go/tests/expect/stats_single/eval_3.4.7 @@ -3,10 +3,10 @@ "ID": "a6782ae38ef891d5506341a4b0ab2747", "Namespace": "test", "Operation": "EVAL", - "Query": "{\"ns\":\"test\",\"op\":\"command\",\"command\":{\"$eval\":\"db\"}}\n", + "Query": "{\"ns\":\"test\",\"op\":\"command\",\"command\":{\"$eval\":\"1\"}}\n", "Fingerprint": "EVAL", - "FirstSeen": "2017-09-05T19:39:48.888Z", - "LastSeen": "2017-09-05T19:39:48.888Z", + "FirstSeen": "2017-10-15T01:54:43.273Z", + "LastSeen": "2017-10-15T01:54:43.273Z", "TableScan": false, "Count": 1, "BlockedTime": null, @@ -18,10 +18,10 @@ 0 ], "QueryTime": [ - 91 + 48 ], "ResponseLength": [ - 93 + 38 ] } ] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/eval_3.5.11 b/src/go/tests/expect/stats_single/eval_3.5.11 index 235e1f93..b0e5e433 100755 --- a/src/go/tests/expect/stats_single/eval_3.5.11 +++ b/src/go/tests/expect/stats_single/eval_3.5.11 @@ -3,10 +3,10 @@ "ID": "a6782ae38ef891d5506341a4b0ab2747", "Namespace": "test", "Operation": "EVAL", - "Query": "{\"ns\":\"test\",\"op\":\"command\",\"command\":{\"$eval\":\"db\",\"$db\":\"test\"}}\n", + "Query": "{\"ns\":\"test\",\"op\":\"command\",\"command\":{\"$eval\":\"1\",\"$db\":\"test\"}}\n", "Fingerprint": "EVAL", - "FirstSeen": "2017-09-05T19:40:00.171Z", - "LastSeen": "2017-09-05T19:40:00.171Z", + "FirstSeen": "2017-10-15T01:54:54.085Z", + "LastSeen": "2017-10-15T01:54:54.085Z", "TableScan": false, "Count": 1, "BlockedTime": null, @@ -18,10 +18,10 @@ 0 ], "QueryTime": [ - 47 + 40 ], "ResponseLength": [ - 93 + 38 ] } ] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/explain_2.6.12 b/src/go/tests/expect/stats_single/explain_2.6.12 index 2c9c05b1..bbd5d938 100755 --- a/src/go/tests/expect/stats_single/explain_2.6.12 +++ b/src/go/tests/expect/stats_single/explain_2.6.12 @@ -5,8 +5,8 @@ "Operation": "EXPLAIN", "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"query\":{\"query\":{},\"$explain\":true}}\n", "Fingerprint": "EXPLAIN", - "FirstSeen": "2017-09-05T19:39:24.666Z", - "LastSeen": "2017-09-05T19:39:24.666Z", + "FirstSeen": "2017-10-15T01:54:10.058Z", + "LastSeen": "2017-10-15T01:54:10.058Z", "TableScan": false, "Count": 1, "BlockedTime": null, @@ -15,7 +15,7 @@ 1 ], "NScanned": [ - 44 + 10 ], "QueryTime": [ 0 diff --git a/src/go/tests/expect/stats_single/explain_3.0.15 b/src/go/tests/expect/stats_single/explain_3.0.15 index 53767691..48bc0d34 100755 --- a/src/go/tests/expect/stats_single/explain_3.0.15 +++ b/src/go/tests/expect/stats_single/explain_3.0.15 @@ -5,8 +5,8 @@ "Operation": "EXPLAIN", "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"explain\":{\"find\":\"coll\",\"filter\":{},\"options\":{}},\"verbosity\":\"queryPlanner\"}}\n", "Fingerprint": "EXPLAIN", - "FirstSeen": "2017-09-05T19:39:32.21Z", - "LastSeen": "2017-09-05T19:39:32.21Z", + "FirstSeen": "2017-10-15T01:54:19.722Z", + "LastSeen": "2017-10-15T01:54:19.722Z", "TableScan": false, "Count": 1, "BlockedTime": null, diff --git a/src/go/tests/expect/stats_single/explain_3.2.16 b/src/go/tests/expect/stats_single/explain_3.2.16 index 7a68ab4f..a271a1e6 100755 --- a/src/go/tests/expect/stats_single/explain_3.2.16 +++ b/src/go/tests/expect/stats_single/explain_3.2.16 @@ -5,8 +5,8 @@ "Operation": "EXPLAIN", "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"explain\":{\"find\":\"coll\",\"filter\":{}},\"verbosity\":\"queryPlanner\"}}\n", "Fingerprint": "EXPLAIN", - "FirstSeen": "2017-09-05T19:39:41.753Z", - "LastSeen": "2017-09-05T19:39:41.753Z", + "FirstSeen": "2017-10-15T01:54:32.931Z", + "LastSeen": "2017-10-15T01:54:32.931Z", "TableScan": false, "Count": 1, "BlockedTime": null, diff --git a/src/go/tests/expect/stats_single/explain_3.4.7 b/src/go/tests/expect/stats_single/explain_3.4.7 index 99384bf8..518b15fa 100755 --- a/src/go/tests/expect/stats_single/explain_3.4.7 +++ b/src/go/tests/expect/stats_single/explain_3.4.7 @@ -5,8 +5,8 @@ "Operation": "EXPLAIN", "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"explain\":{\"find\":\"coll\",\"filter\":{}},\"verbosity\":\"queryPlanner\"}}\n", "Fingerprint": "EXPLAIN", - "FirstSeen": "2017-09-05T19:39:49.065Z", - "LastSeen": "2017-09-05T19:39:49.065Z", + "FirstSeen": "2017-10-15T01:54:43.427Z", + "LastSeen": "2017-10-15T01:54:43.427Z", "TableScan": false, "Count": 1, "BlockedTime": null, diff --git a/src/go/tests/expect/stats_single/explain_3.5.11 b/src/go/tests/expect/stats_single/explain_3.5.11 index 3d211be2..9d80c538 100755 --- a/src/go/tests/expect/stats_single/explain_3.5.11 +++ b/src/go/tests/expect/stats_single/explain_3.5.11 @@ -5,8 +5,8 @@ "Operation": "EXPLAIN", "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"explain\":{\"find\":\"coll\",\"filter\":{}},\"verbosity\":\"queryPlanner\",\"$db\":\"test\"}}\n", "Fingerprint": "EXPLAIN", - "FirstSeen": "2017-09-05T19:40:00.433Z", - "LastSeen": "2017-09-05T19:40:00.433Z", + "FirstSeen": "2017-10-15T01:54:54.257Z", + "LastSeen": "2017-10-15T01:54:54.257Z", "TableScan": false, "Count": 1, "BlockedTime": null, diff --git a/src/go/tests/expect/stats_single/find_2.6.12 b/src/go/tests/expect/stats_single/find_2.6.12 index 993d644e..63f5f9ed 100755 --- a/src/go/tests/expect/stats_single/find_2.6.12 +++ b/src/go/tests/expect/stats_single/find_2.6.12 @@ -1,27 +1,27 @@ [ { - "ID": "fe0bf975a044fe47fd32b835ceba612d", + "ID": "5efe4738d807c74b3980de76c37a0870", "Namespace": "test.coll", "Operation": "FIND", - "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"query\":{\"a\":1}}\n", - "Fingerprint": "FIND coll a", - "FirstSeen": "2017-08-20T15:39:15.457Z", - "LastSeen": "2017-08-20T15:39:15.457Z", + "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"query\":{\"k\":1}}\n", + "Fingerprint": "FIND coll k", + "FirstSeen": "2017-10-15T01:54:10.277Z", + "LastSeen": "2017-10-15T01:54:10.277Z", "TableScan": false, "Count": 1, "BlockedTime": null, "LockTime": null, "NReturned": [ - 6 + 2 ], "NScanned": [ - 6 + 2 ], "QueryTime": [ 0 ], "ResponseLength": [ - 251 + 86 ] } ] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/find_3.0.15 b/src/go/tests/expect/stats_single/find_3.0.15 index ccd6a0aa..7e7b4507 100755 --- a/src/go/tests/expect/stats_single/find_3.0.15 +++ b/src/go/tests/expect/stats_single/find_3.0.15 @@ -1,27 +1,27 @@ [ { - "ID": "fe0bf975a044fe47fd32b835ceba612d", + "ID": "5efe4738d807c74b3980de76c37a0870", "Namespace": "test.coll", "Operation": "FIND", - "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"query\":{\"a\":1}}\n", - "Fingerprint": "FIND coll a", - "FirstSeen": "2017-08-20T15:39:21.515Z", - "LastSeen": "2017-08-20T15:39:21.515Z", + "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"query\":{\"k\":1}}\n", + "Fingerprint": "FIND coll k", + "FirstSeen": "2017-10-15T01:54:19.953Z", + "LastSeen": "2017-10-15T01:54:19.953Z", "TableScan": false, "Count": 1, "BlockedTime": null, "LockTime": null, "NReturned": [ - 6 + 2 ], "NScanned": [ - 6 + 2 ], "QueryTime": [ 0 ], "ResponseLength": [ - 251 + 86 ] } ] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/find_3.2.16 b/src/go/tests/expect/stats_single/find_3.2.16 index 102722d1..df47999c 100755 --- a/src/go/tests/expect/stats_single/find_3.2.16 +++ b/src/go/tests/expect/stats_single/find_3.2.16 @@ -1,27 +1,27 @@ [ { - "ID": "fe0bf975a044fe47fd32b835ceba612d", + "ID": "5efe4738d807c74b3980de76c37a0870", "Namespace": "test.coll", "Operation": "FIND", - "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"query\":{\"find\":\"coll\",\"filter\":{\"a\":1}}}\n", - "Fingerprint": "FIND coll a", - "FirstSeen": "2017-08-20T15:39:30.913Z", - "LastSeen": "2017-08-20T15:39:30.913Z", + "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"query\":{\"find\":\"coll\",\"filter\":{\"k\":1}}}\n", + "Fingerprint": "FIND coll k", + "FirstSeen": "2017-10-15T01:54:33.179Z", + "LastSeen": "2017-10-15T01:54:33.179Z", "TableScan": false, "Count": 1, "BlockedTime": null, "LockTime": null, "NReturned": [ - 6 + 2 ], "NScanned": [ - 6 + 2 ], "QueryTime": [ - 0 + 1 ], "ResponseLength": [ - 349 + 172 ] } ] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/find_3.4.7 b/src/go/tests/expect/stats_single/find_3.4.7 index b1d083a2..d641eb93 100755 --- a/src/go/tests/expect/stats_single/find_3.4.7 +++ b/src/go/tests/expect/stats_single/find_3.4.7 @@ -1,27 +1,27 @@ [ { - "ID": "fe0bf975a044fe47fd32b835ceba612d", + "ID": "5efe4738d807c74b3980de76c37a0870", "Namespace": "test.coll", "Operation": "FIND", - "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"query\":{\"find\":\"coll\",\"filter\":{\"a\":1}}}\n", - "Fingerprint": "FIND coll a", - "FirstSeen": "2017-08-20T15:39:37.66Z", - "LastSeen": "2017-08-20T15:39:37.66Z", + "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"query\":{\"find\":\"coll\",\"filter\":{\"k\":1}}}\n", + "Fingerprint": "FIND coll k", + "FirstSeen": "2017-10-15T01:54:43.713Z", + "LastSeen": "2017-10-15T01:54:43.713Z", "TableScan": false, "Count": 1, "BlockedTime": null, "LockTime": null, "NReturned": [ - 6 + 2 ], "NScanned": [ - 6 + 2 ], "QueryTime": [ 0 ], "ResponseLength": [ - 331 + 154 ] } ] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/find_3.5.11 b/src/go/tests/expect/stats_single/find_3.5.11 index 6445658e..2a1a004e 100755 --- a/src/go/tests/expect/stats_single/find_3.5.11 +++ b/src/go/tests/expect/stats_single/find_3.5.11 @@ -1,27 +1,27 @@ [ { - "ID": "fe0bf975a044fe47fd32b835ceba612d", + "ID": "5efe4738d807c74b3980de76c37a0870", "Namespace": "test.coll", "Operation": "FIND", - "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"command\":{\"find\":\"coll\",\"filter\":{\"a\":1},\"$db\":\"test\"}}\n", - "Fingerprint": "FIND coll a", - "FirstSeen": "2017-08-20T15:39:48.107Z", - "LastSeen": "2017-08-20T15:39:48.107Z", + "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"command\":{\"find\":\"coll\",\"filter\":{\"k\":1},\"$db\":\"test\"}}\n", + "Fingerprint": "FIND coll k", + "FirstSeen": "2017-10-15T01:54:54.507Z", + "LastSeen": "2017-10-15T01:54:54.507Z", "TableScan": false, "Count": 1, "BlockedTime": null, "LockTime": null, "NReturned": [ - 6 + 2 ], "NScanned": [ - 6 + 2 ], "QueryTime": [ - 1 + 0 ], "ResponseLength": [ - 331 + 154 ] } ] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/find_andrii_2.6.12 b/src/go/tests/expect/stats_single/find_andrii_2.6.12 index cfd29fb4..aeda265e 100755 --- a/src/go/tests/expect/stats_single/find_andrii_2.6.12 +++ b/src/go/tests/expect/stats_single/find_andrii_2.6.12 @@ -5,8 +5,8 @@ "Operation": "FIND", "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"query\":{\"query\":{\"$and\":[{\"k\":{\"$gt\":1}},{\"k\":{\"$lt\":2}},{\"$or\":[{\"c\":{\"$in\":[\"/^0/\",\"/^2/\",\"/^4/\",\"/^6/\"]}},{\"pad\":{\"$in\":[\"/9$/\",\"/7$/\",\"/5$/\",\"/3$/\"]}}]}]},\"orderby\":{\"k\":-1}}}\n", "Fingerprint": "FIND coll c,k,pad", - "FirstSeen": "2017-08-20T15:39:15.616Z", - "LastSeen": "2017-08-20T15:39:15.616Z", + "FirstSeen": "2017-10-15T01:54:10.474Z", + "LastSeen": "2017-10-15T01:54:10.474Z", "TableScan": false, "Count": 1, "BlockedTime": null, @@ -15,7 +15,7 @@ 0 ], "NScanned": [ - 98 + 0 ], "QueryTime": [ 0 diff --git a/src/go/tests/expect/stats_single/find_andrii_3.0.15 b/src/go/tests/expect/stats_single/find_andrii_3.0.15 index 995e9a39..f7cba294 100755 --- a/src/go/tests/expect/stats_single/find_andrii_3.0.15 +++ b/src/go/tests/expect/stats_single/find_andrii_3.0.15 @@ -5,8 +5,8 @@ "Operation": "FIND", "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"query\":{\"query\":{\"$and\":[{\"k\":{\"$gt\":1}},{\"k\":{\"$lt\":2}},{\"$or\":[{\"c\":{\"$in\":[\"/^0/\",\"/^2/\",\"/^4/\",\"/^6/\"]}},{\"pad\":{\"$in\":[\"/9$/\",\"/7$/\",\"/5$/\",\"/3$/\"]}}]}]},\"orderby\":{\"k\":-1}}}\n", "Fingerprint": "FIND coll c,k,pad", - "FirstSeen": "2017-08-20T15:39:21.656Z", - "LastSeen": "2017-08-20T15:39:21.656Z", + "FirstSeen": "2017-10-15T01:54:20.111Z", + "LastSeen": "2017-10-15T01:54:20.111Z", "TableScan": false, "Count": 1, "BlockedTime": null, @@ -15,7 +15,7 @@ 0 ], "NScanned": [ - 98 + 0 ], "QueryTime": [ 0 diff --git a/src/go/tests/expect/stats_single/find_andrii_3.2.16 b/src/go/tests/expect/stats_single/find_andrii_3.2.16 index f94b22f3..00826af3 100755 --- a/src/go/tests/expect/stats_single/find_andrii_3.2.16 +++ b/src/go/tests/expect/stats_single/find_andrii_3.2.16 @@ -5,8 +5,8 @@ "Operation": "FIND", "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"query\":{\"find\":\"coll\",\"filter\":{\"$and\":[{\"k\":{\"$gt\":1}},{\"k\":{\"$lt\":2}},{\"$or\":[{\"c\":{\"$in\":[\"/^0/\",\"/^2/\",\"/^4/\",\"/^6/\"]}},{\"pad\":{\"$in\":[\"/9$/\",\"/7$/\",\"/5$/\",\"/3$/\"]}}]}]},\"limit\":100,\"singleBatch\":false,\"sort\":{\"k\":-1}}}\n", "Fingerprint": "FIND coll c,k,pad", - "FirstSeen": "2017-08-20T15:39:31.085Z", - "LastSeen": "2017-08-20T15:39:31.085Z", + "FirstSeen": "2017-10-15T01:54:33.358Z", + "LastSeen": "2017-10-15T01:54:33.358Z", "TableScan": false, "Count": 1, "BlockedTime": null, @@ -15,7 +15,7 @@ 0 ], "NScanned": [ - 49 + 0 ], "QueryTime": [ 0 diff --git a/src/go/tests/expect/stats_single/find_andrii_3.4.7 b/src/go/tests/expect/stats_single/find_andrii_3.4.7 index 64ff6779..d109b603 100755 --- a/src/go/tests/expect/stats_single/find_andrii_3.4.7 +++ b/src/go/tests/expect/stats_single/find_andrii_3.4.7 @@ -5,8 +5,8 @@ "Operation": "FIND", "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"query\":{\"find\":\"coll\",\"filter\":{\"$and\":[{\"k\":{\"$gt\":1}},{\"k\":{\"$lt\":2}},{\"$or\":[{\"c\":{\"$in\":[\"/^0/\",\"/^2/\",\"/^4/\",\"/^6/\"]}},{\"pad\":{\"$in\":[\"/9$/\",\"/7$/\",\"/5$/\",\"/3$/\"]}}]}]},\"limit\":100,\"singleBatch\":false,\"sort\":{\"k\":-1}}}\n", "Fingerprint": "FIND coll c,k,pad", - "FirstSeen": "2017-08-20T15:39:37.823Z", - "LastSeen": "2017-08-20T15:39:37.823Z", + "FirstSeen": "2017-10-15T01:54:43.922Z", + "LastSeen": "2017-10-15T01:54:43.922Z", "TableScan": false, "Count": 1, "BlockedTime": null, @@ -15,7 +15,7 @@ 0 ], "NScanned": [ - 49 + 0 ], "QueryTime": [ 0 diff --git a/src/go/tests/expect/stats_single/find_andrii_3.5.11 b/src/go/tests/expect/stats_single/find_andrii_3.5.11 index b453f124..57a9d35a 100755 --- a/src/go/tests/expect/stats_single/find_andrii_3.5.11 +++ b/src/go/tests/expect/stats_single/find_andrii_3.5.11 @@ -5,8 +5,8 @@ "Operation": "FIND", "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"command\":{\"find\":\"coll\",\"filter\":{\"$and\":[{\"k\":{\"$gt\":1}},{\"k\":{\"$lt\":2}},{\"$or\":[{\"c\":{\"$in\":[\"/^0/\",\"/^2/\",\"/^4/\",\"/^6/\"]}},{\"pad\":{\"$in\":[\"/9$/\",\"/7$/\",\"/5$/\",\"/3$/\"]}}]}]},\"limit\":100,\"singleBatch\":false,\"sort\":{\"k\":-1},\"$db\":\"test\"}}\n", "Fingerprint": "FIND coll c,k,pad", - "FirstSeen": "2017-08-20T15:39:48.277Z", - "LastSeen": "2017-08-20T15:39:48.277Z", + "FirstSeen": "2017-10-15T01:54:54.693Z", + "LastSeen": "2017-10-15T01:54:54.693Z", "TableScan": false, "Count": 1, "BlockedTime": null, @@ -15,7 +15,7 @@ 0 ], "NScanned": [ - 49 + 0 ], "QueryTime": [ 0 diff --git a/src/go/tests/expect/stats_single/find_empty_2.6.12 b/src/go/tests/expect/stats_single/find_empty_2.6.12 index 991e94de..8d2f5c99 100755 --- a/src/go/tests/expect/stats_single/find_empty_2.6.12 +++ b/src/go/tests/expect/stats_single/find_empty_2.6.12 @@ -5,23 +5,23 @@ "Operation": "FIND", "Query": "{\"ns\":\"test.coll\",\"op\":\"query\"}\n", "Fingerprint": "FIND coll", - "FirstSeen": "2017-08-20T15:39:15.75Z", - "LastSeen": "2017-08-20T15:39:15.75Z", + "FirstSeen": "2017-10-15T01:54:10.63Z", + "LastSeen": "2017-10-15T01:54:10.63Z", "TableScan": false, "Count": 1, "BlockedTime": null, "LockTime": null, "NReturned": [ - 49 + 0 ], "NScanned": [ - 49 + 0 ], "QueryTime": [ 0 ], "ResponseLength": [ - 1846 + 20 ] } ] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/find_empty_3.0.15 b/src/go/tests/expect/stats_single/find_empty_3.0.15 index 87e78532..adad3b50 100755 --- a/src/go/tests/expect/stats_single/find_empty_3.0.15 +++ b/src/go/tests/expect/stats_single/find_empty_3.0.15 @@ -5,23 +5,23 @@ "Operation": "FIND", "Query": "{\"ns\":\"test.coll\",\"op\":\"query\"}\n", "Fingerprint": "FIND coll", - "FirstSeen": "2017-08-20T15:39:21.769Z", - "LastSeen": "2017-08-20T15:39:21.769Z", + "FirstSeen": "2017-10-15T01:54:20.246Z", + "LastSeen": "2017-10-15T01:54:20.246Z", "TableScan": false, "Count": 1, "BlockedTime": null, "LockTime": null, "NReturned": [ - 49 + 0 ], "NScanned": [ - 49 + 0 ], "QueryTime": [ 0 ], "ResponseLength": [ - 1846 + 20 ] } ] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/find_empty_3.2.16 b/src/go/tests/expect/stats_single/find_empty_3.2.16 index 36e18e2c..f4308c9b 100755 --- a/src/go/tests/expect/stats_single/find_empty_3.2.16 +++ b/src/go/tests/expect/stats_single/find_empty_3.2.16 @@ -5,23 +5,23 @@ "Operation": "FIND", "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"query\":{\"find\":\"coll\",\"filter\":{}}}\n", "Fingerprint": "FIND coll", - "FirstSeen": "2017-08-20T15:39:31.294Z", - "LastSeen": "2017-08-20T15:39:31.294Z", + "FirstSeen": "2017-10-15T01:54:33.53Z", + "LastSeen": "2017-10-15T01:54:33.53Z", "TableScan": false, "Count": 1, "BlockedTime": null, "LockTime": null, "NReturned": [ - 49 + 0 ], "NScanned": [ - 49 + 0 ], "QueryTime": [ 0 ], "ResponseLength": [ - 2112 + 100 ] } ] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/find_empty_3.4.7 b/src/go/tests/expect/stats_single/find_empty_3.4.7 index c8b897fc..6c9a2caf 100755 --- a/src/go/tests/expect/stats_single/find_empty_3.4.7 +++ b/src/go/tests/expect/stats_single/find_empty_3.4.7 @@ -5,23 +5,23 @@ "Operation": "FIND", "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"query\":{\"find\":\"coll\",\"filter\":{}}}\n", "Fingerprint": "FIND coll", - "FirstSeen": "2017-08-20T15:39:37.964Z", - "LastSeen": "2017-08-20T15:39:37.964Z", + "FirstSeen": "2017-10-15T01:54:44.129Z", + "LastSeen": "2017-10-15T01:54:44.129Z", "TableScan": false, "Count": 1, "BlockedTime": null, "LockTime": null, "NReturned": [ - 49 + 0 ], "NScanned": [ - 49 + 0 ], "QueryTime": [ 0 ], "ResponseLength": [ - 2094 + 82 ] } ] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/find_empty_3.5.11 b/src/go/tests/expect/stats_single/find_empty_3.5.11 index 423b5ba9..937152ea 100755 --- a/src/go/tests/expect/stats_single/find_empty_3.5.11 +++ b/src/go/tests/expect/stats_single/find_empty_3.5.11 @@ -5,23 +5,23 @@ "Operation": "FIND", "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"command\":{\"find\":\"coll\",\"filter\":{},\"$db\":\"test\"}}\n", "Fingerprint": "FIND coll", - "FirstSeen": "2017-08-20T15:39:48.429Z", - "LastSeen": "2017-08-20T15:39:48.429Z", + "FirstSeen": "2017-10-15T01:54:54.87Z", + "LastSeen": "2017-10-15T01:54:54.87Z", "TableScan": false, "Count": 1, "BlockedTime": null, "LockTime": null, "NReturned": [ - 49 + 0 ], "NScanned": [ - 49 + 0 ], "QueryTime": [ 0 ], "ResponseLength": [ - 2094 + 82 ] } ] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/find_with_sort_2.6.12 b/src/go/tests/expect/stats_single/find_with_sort_2.6.12 new file mode 100755 index 00000000..71dbb104 --- /dev/null +++ b/src/go/tests/expect/stats_single/find_with_sort_2.6.12 @@ -0,0 +1,27 @@ +[ + { + "ID": "20fe80188ec82c9d3c3dcf3f4817f8f9", + "Namespace": "test.coll", + "Operation": "FIND", + "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"query\":{\"query\":{\"c\":1},\"orderby\":{\"b\":-1}}}\n", + "Fingerprint": "FIND coll b,c", + "FirstSeen": "2017-10-15T01:54:10.817Z", + "LastSeen": "2017-10-15T01:54:10.817Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 2 + ], + "NScanned": [ + 2 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 108 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/find_with_sort_3.0.15 b/src/go/tests/expect/stats_single/find_with_sort_3.0.15 new file mode 100755 index 00000000..47318d5e --- /dev/null +++ b/src/go/tests/expect/stats_single/find_with_sort_3.0.15 @@ -0,0 +1,27 @@ +[ + { + "ID": "20fe80188ec82c9d3c3dcf3f4817f8f9", + "Namespace": "test.coll", + "Operation": "FIND", + "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"query\":{\"query\":{\"c\":1},\"orderby\":{\"b\":-1}}}\n", + "Fingerprint": "FIND coll b,c", + "FirstSeen": "2017-10-15T01:54:20.41Z", + "LastSeen": "2017-10-15T01:54:20.41Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 2 + ], + "NScanned": [ + 2 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 108 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/find_with_sort_3.2.16 b/src/go/tests/expect/stats_single/find_with_sort_3.2.16 new file mode 100755 index 00000000..c1df885f --- /dev/null +++ b/src/go/tests/expect/stats_single/find_with_sort_3.2.16 @@ -0,0 +1,27 @@ +[ + { + "ID": "20fe80188ec82c9d3c3dcf3f4817f8f9", + "Namespace": "test.coll", + "Operation": "FIND", + "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"query\":{\"find\":\"coll\",\"filter\":{\"c\":1},\"sort\":{\"b\":-1}}}\n", + "Fingerprint": "FIND coll b,c", + "FirstSeen": "2017-10-15T01:54:33.762Z", + "LastSeen": "2017-10-15T01:54:33.762Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 2 + ], + "NScanned": [ + 2 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 194 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/find_with_sort_3.4.7 b/src/go/tests/expect/stats_single/find_with_sort_3.4.7 new file mode 100755 index 00000000..36fb38f9 --- /dev/null +++ b/src/go/tests/expect/stats_single/find_with_sort_3.4.7 @@ -0,0 +1,27 @@ +[ + { + "ID": "20fe80188ec82c9d3c3dcf3f4817f8f9", + "Namespace": "test.coll", + "Operation": "FIND", + "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"query\":{\"find\":\"coll\",\"filter\":{\"c\":1},\"sort\":{\"b\":-1}}}\n", + "Fingerprint": "FIND coll b,c", + "FirstSeen": "2017-10-15T01:54:44.423Z", + "LastSeen": "2017-10-15T01:54:44.423Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 2 + ], + "NScanned": [ + 2 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 176 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/find_with_sort_3.5.11 b/src/go/tests/expect/stats_single/find_with_sort_3.5.11 new file mode 100755 index 00000000..736491a6 --- /dev/null +++ b/src/go/tests/expect/stats_single/find_with_sort_3.5.11 @@ -0,0 +1,27 @@ +[ + { + "ID": "20fe80188ec82c9d3c3dcf3f4817f8f9", + "Namespace": "test.coll", + "Operation": "FIND", + "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"command\":{\"find\":\"coll\",\"filter\":{\"c\":1},\"sort\":{\"b\":-1},\"$db\":\"test\"}}\n", + "Fingerprint": "FIND coll b,c", + "FirstSeen": "2017-10-15T01:54:55.111Z", + "LastSeen": "2017-10-15T01:54:55.111Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 2 + ], + "NScanned": [ + 2 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 176 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/findandmodify_2.6.12 b/src/go/tests/expect/stats_single/findandmodify_2.6.12 index 62d1328d..595cbc6c 100755 --- a/src/go/tests/expect/stats_single/findandmodify_2.6.12 +++ b/src/go/tests/expect/stats_single/findandmodify_2.6.12 @@ -5,8 +5,8 @@ "Operation": "FINDANDMODIFY", "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"findandmodify\":\"coll\",\"query\":{\"a\":2},\"update\":{\"$inc\":{\"b\":1}}},\"updateobj\":{\"$inc\":{\"b\":1}}}\n", "Fingerprint": "FINDANDMODIFY coll a", - "FirstSeen": "2017-08-20T15:39:15.903Z", - "LastSeen": "2017-08-20T15:39:15.903Z", + "FirstSeen": "2017-10-15T01:54:11.011Z", + "LastSeen": "2017-10-15T01:54:11.011Z", "TableScan": false, "Count": 1, "BlockedTime": null, @@ -18,7 +18,7 @@ 1 ], "QueryTime": [ - 0 + 6 ], "ResponseLength": [ 131 diff --git a/src/go/tests/expect/stats_single/findandmodify_3.0.15 b/src/go/tests/expect/stats_single/findandmodify_3.0.15 index 3eacc879..c8b17bf8 100755 --- a/src/go/tests/expect/stats_single/findandmodify_3.0.15 +++ b/src/go/tests/expect/stats_single/findandmodify_3.0.15 @@ -5,8 +5,8 @@ "Operation": "FINDANDMODIFY", "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"findandmodify\":\"coll\",\"query\":{\"a\":2},\"update\":{\"$inc\":{\"b\":1}}},\"updateobj\":{\"$inc\":{\"b\":1}}}\n", "Fingerprint": "FINDANDMODIFY coll a", - "FirstSeen": "2017-08-20T15:39:21.902Z", - "LastSeen": "2017-08-20T15:39:21.902Z", + "FirstSeen": "2017-10-15T01:54:20.581Z", + "LastSeen": "2017-10-15T01:54:20.581Z", "TableScan": false, "Count": 1, "BlockedTime": null, diff --git a/src/go/tests/expect/stats_single/findandmodify_3.2.16 b/src/go/tests/expect/stats_single/findandmodify_3.2.16 index ef71024c..ca6e28c0 100755 --- a/src/go/tests/expect/stats_single/findandmodify_3.2.16 +++ b/src/go/tests/expect/stats_single/findandmodify_3.2.16 @@ -5,8 +5,8 @@ "Operation": "FINDANDMODIFY", "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"findandmodify\":\"coll\",\"query\":{\"a\":2},\"update\":{\"$inc\":{\"b\":1}}},\"updateobj\":{\"$inc\":{\"b\":1}}}\n", "Fingerprint": "FINDANDMODIFY coll a", - "FirstSeen": "2017-08-20T15:39:31.548Z", - "LastSeen": "2017-08-20T15:39:31.548Z", + "FirstSeen": "2017-10-15T01:54:34.011Z", + "LastSeen": "2017-10-15T01:54:34.011Z", "TableScan": false, "Count": 1, "BlockedTime": null, @@ -18,7 +18,7 @@ 3 ], "QueryTime": [ - 0 + 1 ], "ResponseLength": [ 116 diff --git a/src/go/tests/expect/stats_single/findandmodify_3.4.7 b/src/go/tests/expect/stats_single/findandmodify_3.4.7 index f351fd0e..d81c37a1 100755 --- a/src/go/tests/expect/stats_single/findandmodify_3.4.7 +++ b/src/go/tests/expect/stats_single/findandmodify_3.4.7 @@ -5,8 +5,8 @@ "Operation": "FINDANDMODIFY", "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"findandmodify\":\"coll\",\"query\":{\"a\":2},\"update\":{\"$inc\":{\"b\":1}}},\"updateobj\":{\"$inc\":{\"b\":1}}}\n", "Fingerprint": "FINDANDMODIFY coll a", - "FirstSeen": "2017-08-20T15:39:38.196Z", - "LastSeen": "2017-08-20T15:39:38.196Z", + "FirstSeen": "2017-10-15T01:54:44.656Z", + "LastSeen": "2017-10-15T01:54:44.656Z", "TableScan": false, "Count": 1, "BlockedTime": null, @@ -18,7 +18,7 @@ 3 ], "QueryTime": [ - 0 + 1 ], "ResponseLength": [ 116 diff --git a/src/go/tests/expect/stats_single/findandmodify_3.5.11 b/src/go/tests/expect/stats_single/findandmodify_3.5.11 index ea893ea5..12858348 100755 --- a/src/go/tests/expect/stats_single/findandmodify_3.5.11 +++ b/src/go/tests/expect/stats_single/findandmodify_3.5.11 @@ -5,8 +5,8 @@ "Operation": "FINDANDMODIFY", "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"findandmodify\":\"coll\",\"query\":{\"a\":2},\"update\":{\"$inc\":{\"b\":1}},\"$db\":\"test\"}}\n", "Fingerprint": "FINDANDMODIFY coll a", - "FirstSeen": "2017-08-20T15:39:48.636Z", - "LastSeen": "2017-08-20T15:39:48.636Z", + "FirstSeen": "2017-10-15T01:54:55.391Z", + "LastSeen": "2017-10-15T01:54:55.391Z", "TableScan": false, "Count": 1, "BlockedTime": null, @@ -18,7 +18,7 @@ 3 ], "QueryTime": [ - 0 + 1 ], "ResponseLength": [ 116 diff --git a/src/go/tests/expect/stats_single/geonear_2.6.12 b/src/go/tests/expect/stats_single/geonear_2.6.12 index 1a7524ee..cc9e30be 100755 --- a/src/go/tests/expect/stats_single/geonear_2.6.12 +++ b/src/go/tests/expect/stats_single/geonear_2.6.12 @@ -5,8 +5,8 @@ "Operation": "GEONEAR", "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"geoNear\":\"coll\",\"near\":{\"type\":\"Point\",\"coordinates\":[1,1]},\"spherical\":true}}\n", "Fingerprint": "GEONEAR coll", - "FirstSeen": "2017-08-20T15:39:16.061Z", - "LastSeen": "2017-08-20T15:39:16.061Z", + "FirstSeen": "2017-10-15T01:54:11.181Z", + "LastSeen": "2017-10-15T01:54:11.181Z", "TableScan": false, "Count": 1, "BlockedTime": null, diff --git a/src/go/tests/expect/stats_single/geonear_3.0.15 b/src/go/tests/expect/stats_single/geonear_3.0.15 index 9ffa1ebf..d9c6f994 100755 --- a/src/go/tests/expect/stats_single/geonear_3.0.15 +++ b/src/go/tests/expect/stats_single/geonear_3.0.15 @@ -5,8 +5,8 @@ "Operation": "GEONEAR", "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"geoNear\":\"coll\",\"near\":{\"type\":\"Point\",\"coordinates\":[1,1]},\"spherical\":true}}\n", "Fingerprint": "GEONEAR coll", - "FirstSeen": "2017-08-20T15:39:22.055Z", - "LastSeen": "2017-08-20T15:39:22.055Z", + "FirstSeen": "2017-10-15T01:54:20.751Z", + "LastSeen": "2017-10-15T01:54:20.751Z", "TableScan": false, "Count": 1, "BlockedTime": null, @@ -18,7 +18,7 @@ 0 ], "QueryTime": [ - 3 + 2 ], "ResponseLength": [ 1398 diff --git a/src/go/tests/expect/stats_single/geonear_3.2.16 b/src/go/tests/expect/stats_single/geonear_3.2.16 index 71ee8e92..f312b472 100755 --- a/src/go/tests/expect/stats_single/geonear_3.2.16 +++ b/src/go/tests/expect/stats_single/geonear_3.2.16 @@ -5,8 +5,8 @@ "Operation": "GEONEAR", "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"geoNear\":\"coll\",\"near\":{\"type\":\"Point\",\"coordinates\":[1,1]},\"spherical\":true}}\n", "Fingerprint": "GEONEAR coll", - "FirstSeen": "2017-08-20T15:39:31.797Z", - "LastSeen": "2017-08-20T15:39:31.797Z", + "FirstSeen": "2017-10-15T01:54:34.27Z", + "LastSeen": "2017-10-15T01:54:34.27Z", "TableScan": false, "Count": 1, "BlockedTime": null, @@ -18,7 +18,7 @@ 0 ], "QueryTime": [ - 8 + 10 ], "ResponseLength": [ 1401 diff --git a/src/go/tests/expect/stats_single/geonear_3.4.7 b/src/go/tests/expect/stats_single/geonear_3.4.7 index 31383313..6e1dd370 100755 --- a/src/go/tests/expect/stats_single/geonear_3.4.7 +++ b/src/go/tests/expect/stats_single/geonear_3.4.7 @@ -5,8 +5,8 @@ "Operation": "GEONEAR", "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"geoNear\":\"coll\",\"near\":{\"type\":\"Point\",\"coordinates\":[1,1]},\"spherical\":true}}\n", "Fingerprint": "GEONEAR coll", - "FirstSeen": "2017-08-20T15:39:38.432Z", - "LastSeen": "2017-08-20T15:39:38.432Z", + "FirstSeen": "2017-10-15T01:54:44.873Z", + "LastSeen": "2017-10-15T01:54:44.873Z", "TableScan": false, "Count": 1, "BlockedTime": null, @@ -18,7 +18,7 @@ 10 ], "QueryTime": [ - 11 + 13 ], "ResponseLength": [ 1383 diff --git a/src/go/tests/expect/stats_single/geonear_3.5.11 b/src/go/tests/expect/stats_single/geonear_3.5.11 index 2e633102..0798c825 100755 --- a/src/go/tests/expect/stats_single/geonear_3.5.11 +++ b/src/go/tests/expect/stats_single/geonear_3.5.11 @@ -5,8 +5,8 @@ "Operation": "GEONEAR", "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"geoNear\":\"coll\",\"near\":{\"type\":\"Point\",\"coordinates\":[1,1]},\"spherical\":true,\"$db\":\"test\"}}\n", "Fingerprint": "GEONEAR coll", - "FirstSeen": "2017-08-20T15:39:48.842Z", - "LastSeen": "2017-08-20T15:39:48.842Z", + "FirstSeen": "2017-10-15T01:54:55.701Z", + "LastSeen": "2017-10-15T01:54:55.701Z", "TableScan": false, "Count": 1, "BlockedTime": null, @@ -18,7 +18,7 @@ 10 ], "QueryTime": [ - 7 + 11 ], "ResponseLength": [ 1383 diff --git a/src/go/tests/expect/stats_single/getmore_2.6.12 b/src/go/tests/expect/stats_single/getmore_2.6.12 new file mode 100755 index 00000000..317b24ab --- /dev/null +++ b/src/go/tests/expect/stats_single/getmore_2.6.12 @@ -0,0 +1,27 @@ +[ + { + "ID": "db759bfd83441deecc71382323041ce6", + "Namespace": "test.coll", + "Operation": "GETMORE", + "Query": "{\"ns\":\"test.coll\",\"op\":\"getmore\",\"query\":{\"a\":{\"$gt\":0}}}\n", + "Fingerprint": "GETMORE coll", + "FirstSeen": "2017-10-15T01:54:11.36Z", + "LastSeen": "2017-10-15T01:54:11.36Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 2 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 86 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/getmore_3.0.15 b/src/go/tests/expect/stats_single/getmore_3.0.15 new file mode 100755 index 00000000..58571ebe --- /dev/null +++ b/src/go/tests/expect/stats_single/getmore_3.0.15 @@ -0,0 +1,27 @@ +[ + { + "ID": "db759bfd83441deecc71382323041ce6", + "Namespace": "test.coll", + "Operation": "GETMORE", + "Query": "{\"ns\":\"test.coll\",\"op\":\"getmore\",\"query\":{\"a\":{\"$gt\":0}}}\n", + "Fingerprint": "GETMORE coll", + "FirstSeen": "2017-10-15T01:54:20.995Z", + "LastSeen": "2017-10-15T01:54:20.995Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 20 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/getmore_3.2.16 b/src/go/tests/expect/stats_single/getmore_3.2.16 new file mode 100755 index 00000000..0524524a --- /dev/null +++ b/src/go/tests/expect/stats_single/getmore_3.2.16 @@ -0,0 +1,27 @@ +[ + { + "ID": "db759bfd83441deecc71382323041ce6", + "Namespace": "test.coll", + "Operation": "GETMORE", + "Query": "{\"ns\":\"test.coll\",\"op\":\"getmore\",\"query\":{\"getMore\":\"62137702161\",\"collection\":\"coll\",\"batchSize\":2}}\n", + "Fingerprint": "GETMORE coll", + "FirstSeen": "2017-10-15T01:54:34.569Z", + "LastSeen": "2017-10-15T01:54:34.569Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 81 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/getmore_3.4.7 b/src/go/tests/expect/stats_single/getmore_3.4.7 new file mode 100755 index 00000000..3c572e12 --- /dev/null +++ b/src/go/tests/expect/stats_single/getmore_3.4.7 @@ -0,0 +1,27 @@ +[ + { + "ID": "db759bfd83441deecc71382323041ce6", + "Namespace": "test.coll", + "Operation": "GETMORE", + "Query": "{\"ns\":\"test.coll\",\"op\":\"getmore\",\"query\":{\"getMore\":\"66029137874\",\"collection\":\"coll\",\"batchSize\":2},\"originatingCommand\":{\"find\":\"coll\",\"filter\":{\"a\":{\"$gt\":0}},\"batchSize\":2,\"sort\":{\"a\":1}}}\n", + "Fingerprint": "GETMORE coll", + "FirstSeen": "2017-10-15T01:54:45.251Z", + "LastSeen": "2017-10-15T01:54:45.251Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 2 + ], + "NScanned": [ + 2 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 153 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/getmore_3.5.11 b/src/go/tests/expect/stats_single/getmore_3.5.11 new file mode 100755 index 00000000..66551a8a --- /dev/null +++ b/src/go/tests/expect/stats_single/getmore_3.5.11 @@ -0,0 +1,27 @@ +[ + { + "ID": "db759bfd83441deecc71382323041ce6", + "Namespace": "test.coll", + "Operation": "GETMORE", + "Query": "{\"ns\":\"test.coll\",\"op\":\"getmore\",\"command\":{\"getMore\":\"62495713089\",\"collection\":\"coll\",\"batchSize\":2,\"$db\":\"test\"},\"originatingCommand\":{\"find\":\"coll\",\"filter\":{\"a\":{\"$gt\":0}},\"batchSize\":2,\"sort\":{\"a\":1},\"$db\":\"test\"}}\n", + "Fingerprint": "GETMORE coll", + "FirstSeen": "2017-10-15T01:54:56.186Z", + "LastSeen": "2017-10-15T01:54:56.186Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 81 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/group_2.6.12 b/src/go/tests/expect/stats_single/group_2.6.12 index 8c8ebe95..03e19b99 100755 --- a/src/go/tests/expect/stats_single/group_2.6.12 +++ b/src/go/tests/expect/stats_single/group_2.6.12 @@ -5,8 +5,8 @@ "Operation": "GROUP", "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"group\":{\"key\":{\"a\":1,\"b\":1},\"cond\":{\"b\":3},\"initial\":{},\"ns\":\"coll\",\"$reduce\":\"\"}}}\n", "Fingerprint": "GROUP coll a,b", - "FirstSeen": "2017-08-20T15:39:16.325Z", - "LastSeen": "2017-08-20T15:39:16.325Z", + "FirstSeen": "2017-10-15T01:54:11.599Z", + "LastSeen": "2017-10-15T01:54:11.599Z", "TableScan": false, "Count": 1, "BlockedTime": null, @@ -18,7 +18,7 @@ 0 ], "QueryTime": [ - 77 + 36 ], "ResponseLength": [ 135 diff --git a/src/go/tests/expect/stats_single/group_3.0.15 b/src/go/tests/expect/stats_single/group_3.0.15 index 8739ac60..60387fad 100755 --- a/src/go/tests/expect/stats_single/group_3.0.15 +++ b/src/go/tests/expect/stats_single/group_3.0.15 @@ -5,8 +5,8 @@ "Operation": "GROUP", "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"group\":{\"key\":{\"a\":1,\"b\":1},\"cond\":{\"b\":3},\"initial\":{},\"ns\":\"coll\",\"$reduce\":\"\"}}}\n", "Fingerprint": "GROUP coll a,b", - "FirstSeen": "2017-08-20T15:39:22.271Z", - "LastSeen": "2017-08-20T15:39:22.271Z", + "FirstSeen": "2017-10-15T01:54:21.188Z", + "LastSeen": "2017-10-15T01:54:21.188Z", "TableScan": false, "Count": 1, "BlockedTime": null, @@ -18,7 +18,7 @@ 0 ], "QueryTime": [ - 54 + 26 ], "ResponseLength": [ 139 diff --git a/src/go/tests/expect/stats_single/group_3.2.16 b/src/go/tests/expect/stats_single/group_3.2.16 index 575c0fc2..4a813772 100755 --- a/src/go/tests/expect/stats_single/group_3.2.16 +++ b/src/go/tests/expect/stats_single/group_3.2.16 @@ -5,8 +5,8 @@ "Operation": "GROUP", "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"group\":{\"key\":{\"a\":1,\"b\":1},\"cond\":{\"b\":3},\"initial\":{},\"ns\":\"coll\",\"$reduce\":\"\"}}}\n", "Fingerprint": "GROUP coll a,b", - "FirstSeen": "2017-08-20T15:39:32.101Z", - "LastSeen": "2017-08-20T15:39:32.101Z", + "FirstSeen": "2017-10-15T01:54:34.867Z", + "LastSeen": "2017-10-15T01:54:34.867Z", "TableScan": false, "Count": 1, "BlockedTime": null, @@ -18,7 +18,7 @@ 0 ], "QueryTime": [ - 74 + 31 ], "ResponseLength": [ 142 diff --git a/src/go/tests/expect/stats_single/group_3.4.7 b/src/go/tests/expect/stats_single/group_3.4.7 index efc8b21a..00408d13 100755 --- a/src/go/tests/expect/stats_single/group_3.4.7 +++ b/src/go/tests/expect/stats_single/group_3.4.7 @@ -5,8 +5,8 @@ "Operation": "GROUP", "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"group\":{\"key\":{\"a\":1,\"b\":1},\"cond\":{\"b\":3},\"initial\":{},\"ns\":\"coll\",\"$reduce\":{\"code\":\"function () {}\"}}}}\n", "Fingerprint": "GROUP coll a,b", - "FirstSeen": "2017-08-20T15:39:38.886Z", - "LastSeen": "2017-08-20T15:39:38.886Z", + "FirstSeen": "2017-10-15T01:54:45.5Z", + "LastSeen": "2017-10-15T01:54:45.5Z", "TableScan": false, "Count": 1, "BlockedTime": null, @@ -18,7 +18,7 @@ 2 ], "QueryTime": [ - 77 + 31 ], "ResponseLength": [ 124 diff --git a/src/go/tests/expect/stats_single/group_3.5.11 b/src/go/tests/expect/stats_single/group_3.5.11 index 7557127d..48c2970e 100755 --- a/src/go/tests/expect/stats_single/group_3.5.11 +++ b/src/go/tests/expect/stats_single/group_3.5.11 @@ -5,8 +5,8 @@ "Operation": "GROUP", "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"group\":{\"key\":{\"a\":1,\"b\":1},\"cond\":{\"b\":3},\"initial\":{},\"ns\":\"coll\",\"$reduce\":{\"code\":\"function () {}\"}},\"$db\":\"test\"}}\n", "Fingerprint": "GROUP coll a,b", - "FirstSeen": "2017-08-20T15:39:49.276Z", - "LastSeen": "2017-08-20T15:39:49.276Z", + "FirstSeen": "2017-10-15T01:54:56.478Z", + "LastSeen": "2017-10-15T01:54:56.478Z", "TableScan": false, "Count": 1, "BlockedTime": null, @@ -18,7 +18,7 @@ 2 ], "QueryTime": [ - 68 + 24 ], "ResponseLength": [ 124 diff --git a/src/go/tests/expect/stats_single/insert_2.6.12 b/src/go/tests/expect/stats_single/insert_2.6.12 index b22129d6..821f4847 100755 --- a/src/go/tests/expect/stats_single/insert_2.6.12 +++ b/src/go/tests/expect/stats_single/insert_2.6.12 @@ -5,8 +5,8 @@ "Operation": "INSERT", "Query": "{\"ns\":\"test.coll\",\"op\":\"insert\",\"query\":{\"_id\":1}}\n", "Fingerprint": "INSERT coll", - "FirstSeen": "2017-08-20T15:39:16.473Z", - "LastSeen": "2017-08-20T15:39:16.473Z", + "FirstSeen": "2017-10-15T01:54:11.737Z", + "LastSeen": "2017-10-15T01:54:11.737Z", "TableScan": false, "Count": 1, "BlockedTime": null, diff --git a/src/go/tests/expect/stats_single/insert_3.0.15 b/src/go/tests/expect/stats_single/insert_3.0.15 index 4bd31117..23cda336 100755 --- a/src/go/tests/expect/stats_single/insert_3.0.15 +++ b/src/go/tests/expect/stats_single/insert_3.0.15 @@ -5,8 +5,8 @@ "Operation": "INSERT", "Query": "{\"ns\":\"test.coll\",\"op\":\"insert\",\"query\":{\"_id\":1}}\n", "Fingerprint": "INSERT coll", - "FirstSeen": "2017-08-20T15:39:22.409Z", - "LastSeen": "2017-08-20T15:39:22.409Z", + "FirstSeen": "2017-10-15T01:54:21.346Z", + "LastSeen": "2017-10-15T01:54:21.346Z", "TableScan": false, "Count": 1, "BlockedTime": null, @@ -18,7 +18,7 @@ 0 ], "QueryTime": [ - 0 + 4 ], "ResponseLength": [ 0 diff --git a/src/go/tests/expect/stats_single/insert_3.2.16 b/src/go/tests/expect/stats_single/insert_3.2.16 index 8a9c8fbd..296b8be2 100755 --- a/src/go/tests/expect/stats_single/insert_3.2.16 +++ b/src/go/tests/expect/stats_single/insert_3.2.16 @@ -5,8 +5,8 @@ "Operation": "INSERT", "Query": "{\"ns\":\"test.coll\",\"op\":\"insert\",\"query\":{\"insert\":\"coll\",\"documents\":[{\"_id\":1}],\"ordered\":true}}\n", "Fingerprint": "INSERT coll", - "FirstSeen": "2017-08-20T15:39:32.303Z", - "LastSeen": "2017-08-20T15:39:32.303Z", + "FirstSeen": "2017-10-15T01:54:35.088Z", + "LastSeen": "2017-10-15T01:54:35.088Z", "TableScan": false, "Count": 1, "BlockedTime": null, @@ -18,7 +18,7 @@ 0 ], "QueryTime": [ - 0 + 11 ], "ResponseLength": [ 25 diff --git a/src/go/tests/expect/stats_single/insert_3.4.7 b/src/go/tests/expect/stats_single/insert_3.4.7 index b9b96883..4049f3d3 100755 --- a/src/go/tests/expect/stats_single/insert_3.4.7 +++ b/src/go/tests/expect/stats_single/insert_3.4.7 @@ -5,8 +5,8 @@ "Operation": "INSERT", "Query": "{\"ns\":\"test.coll\",\"op\":\"insert\",\"query\":{\"insert\":\"coll\",\"documents\":[{\"_id\":1}],\"ordered\":true}}\n", "Fingerprint": "INSERT coll", - "FirstSeen": "2017-08-20T15:39:39.023Z", - "LastSeen": "2017-08-20T15:39:39.023Z", + "FirstSeen": "2017-10-15T01:54:45.681Z", + "LastSeen": "2017-10-15T01:54:45.681Z", "TableScan": false, "Count": 1, "BlockedTime": null, @@ -18,7 +18,7 @@ 0 ], "QueryTime": [ - 0 + 11 ], "ResponseLength": [ 29 diff --git a/src/go/tests/expect/stats_single/insert_3.5.11 b/src/go/tests/expect/stats_single/insert_3.5.11 index 883aab28..3e856227 100755 --- a/src/go/tests/expect/stats_single/insert_3.5.11 +++ b/src/go/tests/expect/stats_single/insert_3.5.11 @@ -5,8 +5,8 @@ "Operation": "INSERT", "Query": "{\"ns\":\"test.coll\",\"op\":\"insert\",\"command\":{\"insert\":\"coll\",\"ordered\":true,\"$db\":\"test\"}}\n", "Fingerprint": "INSERT coll", - "FirstSeen": "2017-08-20T15:39:49.44Z", - "LastSeen": "2017-08-20T15:39:49.44Z", + "FirstSeen": "2017-10-15T01:54:56.693Z", + "LastSeen": "2017-10-15T01:54:56.693Z", "TableScan": false, "Count": 1, "BlockedTime": null, @@ -18,7 +18,7 @@ 0 ], "QueryTime": [ - 0 + 11 ], "ResponseLength": [ 29 diff --git a/src/go/tests/expect/stats_single/mapreduce_2.6.12 b/src/go/tests/expect/stats_single/mapreduce_2.6.12 index 6fb663ec..aa6e82a1 100755 --- a/src/go/tests/expect/stats_single/mapreduce_2.6.12 +++ b/src/go/tests/expect/stats_single/mapreduce_2.6.12 @@ -5,8 +5,8 @@ "Operation": "MAPREDUCE", "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"mapreduce\":\"coll\",\"map\":\"\",\"reduce\":\"\",\"query\":{\"a\":{\"$gte\":0}},\"out\":{\"inline\":1}}}\n", "Fingerprint": "MAPREDUCE coll a", - "FirstSeen": "2017-08-20T15:39:16.701Z", - "LastSeen": "2017-08-20T15:39:16.701Z", + "FirstSeen": "2017-10-15T01:54:11.959Z", + "LastSeen": "2017-10-15T01:54:11.959Z", "TableScan": false, "Count": 1, "BlockedTime": null, @@ -18,7 +18,7 @@ 0 ], "QueryTime": [ - 33 + 29 ], "ResponseLength": [ 233 diff --git a/src/go/tests/expect/stats_single/mapreduce_3.0.15 b/src/go/tests/expect/stats_single/mapreduce_3.0.15 index 6e511a93..808098d4 100755 --- a/src/go/tests/expect/stats_single/mapreduce_3.0.15 +++ b/src/go/tests/expect/stats_single/mapreduce_3.0.15 @@ -5,8 +5,8 @@ "Operation": "MAPREDUCE", "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"mapreduce\":\"coll\",\"map\":\"\",\"reduce\":\"\",\"query\":{\"a\":{\"$gte\":0}},\"out\":{\"inline\":1}}}\n", "Fingerprint": "MAPREDUCE coll a", - "FirstSeen": "2017-08-20T15:39:22.582Z", - "LastSeen": "2017-08-20T15:39:22.582Z", + "FirstSeen": "2017-10-15T01:54:21.559Z", + "LastSeen": "2017-10-15T01:54:21.559Z", "TableScan": false, "Count": 1, "BlockedTime": null, @@ -18,7 +18,7 @@ 0 ], "QueryTime": [ - 26 + 21 ], "ResponseLength": [ 233 diff --git a/src/go/tests/expect/stats_single/mapreduce_3.2.16 b/src/go/tests/expect/stats_single/mapreduce_3.2.16 index c4da8735..ed6c0364 100755 --- a/src/go/tests/expect/stats_single/mapreduce_3.2.16 +++ b/src/go/tests/expect/stats_single/mapreduce_3.2.16 @@ -5,8 +5,8 @@ "Operation": "MAPREDUCE", "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"mapreduce\":\"coll\",\"map\":\"\",\"reduce\":\"\",\"query\":{\"a\":{\"$gte\":0}},\"out\":{\"inline\":1}}}\n", "Fingerprint": "MAPREDUCE coll a", - "FirstSeen": "2017-08-20T15:39:32.572Z", - "LastSeen": "2017-08-20T15:39:32.572Z", + "FirstSeen": "2017-10-15T01:54:35.348Z", + "LastSeen": "2017-10-15T01:54:35.348Z", "TableScan": false, "Count": 1, "BlockedTime": null, @@ -18,7 +18,7 @@ 0 ], "QueryTime": [ - 31 + 41 ], "ResponseLength": [ 218 diff --git a/src/go/tests/expect/stats_single/mapreduce_3.4.7 b/src/go/tests/expect/stats_single/mapreduce_3.4.7 index b49e4a28..5a80d7ba 100755 --- a/src/go/tests/expect/stats_single/mapreduce_3.4.7 +++ b/src/go/tests/expect/stats_single/mapreduce_3.4.7 @@ -5,8 +5,8 @@ "Operation": "MAPREDUCE", "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"mapreduce\":\"coll\",\"map\":{\"code\":\"function () {\\n emit(this.a, this.b);\\n}\"},\"reduce\":{\"code\":\"function (a, b) {\\n return Array.sum(b);\\n}\"},\"query\":{\"a\":{\"$gte\":0}},\"out\":{\"inline\":1}}}\n", "Fingerprint": "MAPREDUCE coll a", - "FirstSeen": "2017-08-20T15:39:39.249Z", - "LastSeen": "2017-08-20T15:39:39.249Z", + "FirstSeen": "2017-10-15T01:54:45.925Z", + "LastSeen": "2017-10-15T01:54:45.925Z", "TableScan": false, "Count": 1, "BlockedTime": null, @@ -18,7 +18,7 @@ 3 ], "QueryTime": [ - 43 + 21 ], "ResponseLength": [ 218 diff --git a/src/go/tests/expect/stats_single/mapreduce_3.5.11 b/src/go/tests/expect/stats_single/mapreduce_3.5.11 index b1d0f7da..a682b8f0 100755 --- a/src/go/tests/expect/stats_single/mapreduce_3.5.11 +++ b/src/go/tests/expect/stats_single/mapreduce_3.5.11 @@ -5,8 +5,8 @@ "Operation": "MAPREDUCE", "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"mapreduce\":\"coll\",\"map\":{\"code\":\"function () {\\n emit(this.a, this.b);\\n}\"},\"reduce\":{\"code\":\"function (a, b) {\\n return Array.sum(b);\\n}\"},\"query\":{\"a\":{\"$gte\":0}},\"out\":{\"inline\":1},\"$db\":\"test\"}}\n", "Fingerprint": "MAPREDUCE coll a", - "FirstSeen": "2017-08-20T15:39:49.68Z", - "LastSeen": "2017-08-20T15:39:49.68Z", + "FirstSeen": "2017-10-15T01:54:56.951Z", + "LastSeen": "2017-10-15T01:54:56.951Z", "TableScan": false, "Count": 1, "BlockedTime": null, @@ -18,7 +18,7 @@ 3 ], "QueryTime": [ - 35 + 26 ], "ResponseLength": [ 218 diff --git a/src/go/tests/expect/stats_single/update_2.6.12 b/src/go/tests/expect/stats_single/update_2.6.12 index 37b6e372..4611f1e0 100755 --- a/src/go/tests/expect/stats_single/update_2.6.12 +++ b/src/go/tests/expect/stats_single/update_2.6.12 @@ -5,8 +5,8 @@ "Operation": "UPDATE", "Query": "{\"ns\":\"test.coll\",\"op\":\"update\",\"query\":{\"a\":{\"$gte\":2}},\"updateobj\":{\"$set\":{\"c\":1},\"$inc\":{\"a\":-10}}}\n", "Fingerprint": "UPDATE coll a", - "FirstSeen": "2017-08-20T15:39:16.921Z", - "LastSeen": "2017-08-20T15:39:16.921Z", + "FirstSeen": "2017-10-15T01:54:12.161Z", + "LastSeen": "2017-10-15T01:54:12.161Z", "TableScan": false, "Count": 1, "BlockedTime": null, diff --git a/src/go/tests/expect/stats_single/update_3.0.15 b/src/go/tests/expect/stats_single/update_3.0.15 index 24c232fb..65af65f5 100755 --- a/src/go/tests/expect/stats_single/update_3.0.15 +++ b/src/go/tests/expect/stats_single/update_3.0.15 @@ -5,8 +5,8 @@ "Operation": "UPDATE", "Query": "{\"ns\":\"test.coll\",\"op\":\"update\",\"query\":{\"a\":{\"$gte\":2}},\"updateobj\":{\"$set\":{\"c\":1},\"$inc\":{\"a\":-10}}}\n", "Fingerprint": "UPDATE coll a", - "FirstSeen": "2017-08-20T15:39:22.788Z", - "LastSeen": "2017-08-20T15:39:22.788Z", + "FirstSeen": "2017-10-15T01:54:21.803Z", + "LastSeen": "2017-10-15T01:54:21.803Z", "TableScan": false, "Count": 1, "BlockedTime": null, diff --git a/src/go/tests/expect/stats_single/update_3.2.16 b/src/go/tests/expect/stats_single/update_3.2.16 index dad030bc..f92d8e95 100755 --- a/src/go/tests/expect/stats_single/update_3.2.16 +++ b/src/go/tests/expect/stats_single/update_3.2.16 @@ -5,8 +5,8 @@ "Operation": "UPDATE", "Query": "{\"ns\":\"test.coll\",\"op\":\"update\",\"query\":{\"a\":{\"$gte\":2}},\"updateobj\":{\"$set\":{\"c\":1},\"$inc\":{\"a\":-10}}}\n", "Fingerprint": "UPDATE coll a", - "FirstSeen": "2017-08-20T15:39:32.737Z", - "LastSeen": "2017-08-20T15:39:32.737Z", + "FirstSeen": "2017-10-15T01:54:35.583Z", + "LastSeen": "2017-10-15T01:54:35.583Z", "TableScan": false, "Count": 1, "BlockedTime": null, @@ -18,7 +18,7 @@ 1 ], "QueryTime": [ - 0 + 2 ], "ResponseLength": [ 0 diff --git a/src/go/tests/expect/stats_single/update_3.4.7 b/src/go/tests/expect/stats_single/update_3.4.7 index f0d5f8d9..1a144d52 100755 --- a/src/go/tests/expect/stats_single/update_3.4.7 +++ b/src/go/tests/expect/stats_single/update_3.4.7 @@ -5,8 +5,8 @@ "Operation": "UPDATE", "Query": "{\"ns\":\"test.coll\",\"op\":\"update\",\"query\":{\"a\":{\"$gte\":2}},\"updateobj\":{\"$set\":{\"c\":1},\"$inc\":{\"a\":-10}}}\n", "Fingerprint": "UPDATE coll a", - "FirstSeen": "2017-08-20T15:39:39.434Z", - "LastSeen": "2017-08-20T15:39:39.434Z", + "FirstSeen": "2017-10-15T01:54:46.168Z", + "LastSeen": "2017-10-15T01:54:46.168Z", "TableScan": false, "Count": 1, "BlockedTime": null, diff --git a/src/go/tests/expect/stats_single/update_3.5.11 b/src/go/tests/expect/stats_single/update_3.5.11 index 06acdb1a..43387e92 100755 --- a/src/go/tests/expect/stats_single/update_3.5.11 +++ b/src/go/tests/expect/stats_single/update_3.5.11 @@ -5,8 +5,8 @@ "Operation": "UPDATE", "Query": "{\"ns\":\"test.coll\",\"op\":\"update\",\"command\":{\"q\":{\"a\":{\"$gte\":2}},\"u\":{\"$set\":{\"c\":1},\"$inc\":{\"a\":-10}},\"multi\":false,\"upsert\":false}}\n", "Fingerprint": "UPDATE coll a", - "FirstSeen": "2017-08-20T15:39:49.855Z", - "LastSeen": "2017-08-20T15:39:49.855Z", + "FirstSeen": "2017-10-15T01:54:57.231Z", + "LastSeen": "2017-10-15T01:54:57.231Z", "TableScan": false, "Count": 1, "BlockedTime": null, From fb86972f9ada285112af05ba9bda66355b7bca4d Mon Sep 17 00:00:00 2001 From: Kamil Dziedzic Date: Sun, 15 Oct 2017 04:40:34 +0200 Subject: [PATCH 100/104] fix bugs --- src/go/mongolib/explain/explain_test.go | 2 +- src/go/mongolib/proto/system.profile.go | 13 ++++++++++++- src/go/pt-mongodb-query-digest/main_test.go | 5 ++--- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/go/mongolib/explain/explain_test.go b/src/go/mongolib/explain/explain_test.go index 47bc9d28..70ecfa92 100644 --- a/src/go/mongolib/explain/explain_test.go +++ b/src/go/mongolib/explain/explain_test.go @@ -109,7 +109,7 @@ func TestExplain(t *testing.T) { for _, v := range versions { // For versions < 3.4 parsing "getmore" is not supported and returns error if ok, _ := Constraint("< 3.4", v); ok { - expectError["getmore_"+v] = "Cannot explain cmd: getMore" + expectError["getmore_"+v] = "Explain failed due to unknown command: getmore" } } diff --git a/src/go/mongolib/proto/system.profile.go b/src/go/mongolib/proto/system.profile.go index 6b2784ac..979d7b43 100644 --- a/src/go/mongolib/proto/system.profile.go +++ b/src/go/mongolib/proto/system.profile.go @@ -224,9 +224,20 @@ func (self ExampleQuery) ExplainCmd() bson.D { case "getmore": if self.OriginatingCommand.Len() > 0 { cmd = self.OriginatingCommand + for i := range cmd { + // drop $db param as it is not supported in MongoDB 3.0 + if cmd[i].Name == "$db" { + if len(cmd)-1 == i { + cmd = cmd[:i] + } else { + cmd = append(cmd[:i], cmd[i+1:]...) + } + break + } + } } else { cmd = BsonD{ - {Name: "getMore", Value: ""}, + {Name: "getmore", Value: ""}, } } case "command": diff --git a/src/go/pt-mongodb-query-digest/main_test.go b/src/go/pt-mongodb-query-digest/main_test.go index a2f76f39..f1260176 100644 --- a/src/go/pt-mongodb-query-digest/main_test.go +++ b/src/go/pt-mongodb-query-digest/main_test.go @@ -413,8 +413,7 @@ func testAllOperationsTemplate(t *testing.T, data Data) { }, } - ndocs := "165" - expected := `Profiler is disabled for the "test" database but there are ` + ndocs + ` documents in the system.profile collection. + expected := `Profiler is disabled for the "test" database but there are \s*[0-9]+ documents in the system.profile collection. Using those documents for the stats pt-mongodb-query-digest .+ Host: ` + data.url + ` @@ -425,7 +424,7 @@ Skipping profiled queries on these collections: \[system\.profile\] # Ratio [0-9\.]+ \(docs scanned/returned\) # Attribute pct total min max avg 95% stddev median # ================== === ======== ======== ======== ======== ======== ======= ======== -# Count \(docs\) ` + ndocs + `\s +# Count \(docs\) (\s*[0-9]+)\s # Exec Time ms (\s*[0-9]+){8}\s # Docs Scanned (\s*[0-9\.]+){8}\s # Docs Returned (\s*[0-9\.]+){8}\s From b5c2b40ca1ecf6667a19af5a4be4335d6e66e1cb Mon Sep 17 00:00:00 2001 From: Carlos Salguero Date: Wed, 25 Oct 2017 11:14:44 -0300 Subject: [PATCH 101/104] PT-211 Fixed pt-mext Rsa_public_key line issue --- bin/pt-mext | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/pt-mext b/bin/pt-mext index 8281b40b..12d8deee 100755 --- a/bin/pt-mext +++ b/bin/pt-mext @@ -574,7 +574,7 @@ NUM=1; # Split the output on empty lines and put each into a different file; eliminate # lines that don't have "real" content. -$EXT_ARGV | sed '/| Rsa/, /END PUBLIC KEY-----/d' | grep -v '^ |' | grep -v '+' | grep -v Variable_name | sed 's/|//g' \ +$EXT_ARGV | grep -v "| Rsa_public_key *|.*|$" | sed '/| Rsa/, /END PUBLIC KEY-----/d' | grep -v '^ |' | grep -v '+' | grep -v Variable_name | sed 's/|//g' \ | while read line; do if [ "$line" = "" ]; then NUM=$(($NUM + 1)) @@ -804,7 +804,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA. =head1 VERSION -pt-mext 3.0.4 +pt-mext 3.0.5 =cut From 2b4b0375e18fb76707255afbd852949c234f26e3 Mon Sep 17 00:00:00 2001 From: Carlos Salguero Date: Tue, 31 Oct 2017 15:41:08 -0300 Subject: [PATCH 102/104] PT-139 Added --channel to pt-table-checksum --- bin/pt-table-checksum | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/bin/pt-table-checksum b/bin/pt-table-checksum index 3e86931c..481a5670 100755 --- a/bin/pt-table-checksum +++ b/bin/pt-table-checksum @@ -12150,6 +12150,18 @@ group: Connection Prompt for a password when connecting to MySQL. +=item --channel + +type: string + +Channel name used when connected to a server using replication channels. +Suppose you have two masters, master_a at port 12345, master_b at port 1236 and +a slave connected to both masters using channels chan_master_a and chan_master_b. +If you want to run pt-table-sync to syncronize the slave against master_a, pt-table-sync +won't be able to determine what's the correct master since SHOW SLAVE STATUS +will return 2 rows. In this case, you can use --channel=chan_master_a to specify +the channel name to use in the SHOW SLAVE STATUS command. + =item --[no]check-binlog-format default: yes From 4d1ab843f19c0e9cc10e72204e81a9ed24dd0a80 Mon Sep 17 00:00:00 2001 From: Carlos Salguero Date: Tue, 31 Oct 2017 16:27:13 -0300 Subject: [PATCH 103/104] PT-139 Passing channel param to the masterslave lib --- bin/pt-table-checksum | 1 + 1 file changed, 1 insertion(+) diff --git a/bin/pt-table-checksum b/bin/pt-table-checksum index 481a5670..789e33ed 100755 --- a/bin/pt-table-checksum +++ b/bin/pt-table-checksum @@ -9502,6 +9502,7 @@ sub main { OptionParser => $o, DSNParser => $dp, Quoter => $q, + channel => $o->get('channel') ); my $slaves = []; # all slaves (that we can find) From 9440e98393f08eb521e7a172aaae1e1d54320d46 Mon Sep 17 00:00:00 2001 From: Carlos Salguero Date: Wed, 1 Nov 2017 09:57:52 -0300 Subject: [PATCH 104/104] PT-139 Improved error message for --channel --- bin/pt-table-checksum | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bin/pt-table-checksum b/bin/pt-table-checksum index 789e33ed..1c245c2c 100755 --- a/bin/pt-table-checksum +++ b/bin/pt-table-checksum @@ -8533,6 +8533,7 @@ sub wait { PTDEBUG && _d('Checking slave lag'); for my $i ( 0..$#lagged_slaves ) { my $lag = $get_lag->($lagged_slaves[$i]->{cxn}); + die "Please restart the program using --channel=" if !defined($lag); PTDEBUG && _d($lagged_slaves[$i]->{cxn}->name(), 'slave lag:', $lag); if ( !defined $lag || $lag > $max_lag ) { @@ -9159,6 +9160,7 @@ use POSIX qw(signal_h); use List::Util qw(max); use Time::HiRes qw(sleep time); use Data::Dumper; +use Carp; $Data::Dumper::Indent = 1; $Data::Dumper::Sortkeys = 1; $Data::Dumper::Quotekeys = 0;