PATH:
opt
/
alt
/
tests
/
alt-php56-pecl-xhprof-tideways_4.1.6-2.el8
/
tests
--TEST-- Tideways: MongoDB --INI-- extension=mongodb.so --SKIPIF-- <?php if (!extension_loaded('mongodb')) { echo 'skip: required extension "mongodb"'; exit; } $host = isset($_SERVER['MONGO_HOST']) ? $_SERVER['MONGO_HOST'] : '127.0.0.1:27017'; if (!@fopen($host)) { echo 'skip: no mongodb is running'; exit; } --FILE-- <?php require_once __DIR__ . '/common.php'; tideways_enable(TIDEWAYS_FLAGS_NO_HIERACHICAL); $host = isset($_SERVER['MONGO_HOST']) ? $_SERVER['MONGO_HOST'] : '127.0.0.1:27017'; $bulk = new MongoDB\Driver\BulkWrite(); $bulk->insert(['_id' => 1, 'x' => 1]); $bulk->insert(['_id' => 2, 'x' => 2]); $bulk->update(['x' => 2], ['$set' => ['x' => 1]], ['multi' => false, 'upsert' => false]); $bulk->update(['x' => 3], ['$set' => ['x' => 3]], ['multi' => false, 'upsert' => true]); $bulk->update(['_id' => 3], ['$set' => ['x' => 3]], ['multi' => false, 'upsert' => true]); $bulk->insert(['_id' => 4, 'x' => 2]); $bulk->delete(['x' => 1], ['limit' => 1]); $manager = new MongoDB\Driver\Manager('mongodb://' . $host); $command = new MongoDB\Driver\Command(array("drop" => 'collection')); $manager->executeCommand('db', $command); $writeConcern = new MongoDB\Driver\WriteConcern(MongoDB\Driver\WriteConcern::MAJORITY, 100); $result = $manager->executeBulkWrite('db.collection', $bulk, $writeConcern); $bulk = new MongoDB\Driver\BulkWrite; for ($i = 100; $i < 1000; $i++) { $bulk->insert(['x' => $i]); } $manager->executeBulkWrite('db.collection', $bulk); $filter = ['x' => ['$gt' => 1]]; $options = [ 'projection' => ['_id' => 0], 'sort' => ['x' => -1], ]; function iterate($cursor) { $count = 0; foreach ($cursor as $document) { $count++; } } $query = new MongoDB\Driver\Query($filter, $options); $cursor = $manager->executeQuery('db.collection', $query); iterate($cursor); tideways_disable(); print_spans(tideways_get_spans()); --EXPECTF-- app: 1 timers - cpu=%d mongodb: 1 timers - host=172.17.0.2 op=connect port=27017 mongodb: 1 timers - ns=db op=executeCommand mongodb: 1 timers - ns=db.collection op=executeBulkWrite mongodb: 1 timers - ns=db.collection op=executeBulkWrite mongodb: 1 timers - ns=db.collection op=executeQuery
[-] tideways_events2.php
[edit]
[-] tideways_spans_032.phpt
[edit]
[-] tideways_003.phpt
[edit]
[-] tideways_spans_022.phpt
[edit]
[-] tideways_036.phpt
[edit]
[-] tideways_spans_014.phpt
[edit]
[-] tideways_spans_017.phpt
[edit]
[-] tideways_tranaction_cakephp3.phpt
[edit]
[-] tideways_errors_004.phpt
[edit]
[-] tideways_spans_019.phpt
[edit]
[-] common_predis.php
[edit]
[-] tideways_007.phpt
[edit]
[-] tideways_errors_002.phpt
[edit]
[-] tideways_spans_027.phpt
[edit]
[-] tideways_005.phpt
[edit]
[-] tideways_spans_025.phpt
[edit]
[-] tideways_spans_018.phpt
[edit]
[-] tideways_events1.php
[edit]
[-] tideways_spans_021.phpt
[edit]
[-] tideways_038.phpt
[edit]
[-] tideways_spans_020.phpt
[edit]
[-] memleak.phpt
[edit]
[-] tideways_023_classes.php
[edit]
[-] tideways_018.phpt
[edit]
[-] http_responder.php
[edit]
[-] tideways_037.phpt
[edit]
[-] tideways_fw_magento_001.phpt
[edit]
[-] tideways_spans_004.phpt
[edit]
[-] tideways_spans_005.phpt
[edit]
[-] tideways_spans_003.phpt
[edit]
[-] tideways_fw_wordpress_001.phpt
[edit]
[-] tideways_spans_007.phpt
[edit]
[-] tideways_039.phpt
[edit]
[-] tideways_spans_030.phpt
[edit]
[-] tideways_spans_031.phpt
[edit]
[-] tideways_004_inc.php
[edit]
[-] tideways_spans_013.phpt
[edit]
[-] tideways_spans_016.phpt
[edit]
[-] tideways_sql_001.phpt
[edit]
[-] tideways_040.phpt
[edit]
[-] tideways_spans_035.phpt
[edit]
[-] tideways_fw_symfony_002.phpt
[edit]
[-] tideways_fw_shopware_001.phpt
[edit]
[-] tideways_spans_015.phpt
[edit]
[-] tideways_001.phpt
[edit]
[-] tideways_spans_024.phpt
[edit]
[-] tideways_spans_026.phpt
[edit]
[-] tideways_doctrine.php
[edit]
[-] tideways_009.phpt
[edit]
[-] tideways_tranaction_cakephp2.phpt
[edit]
[-] tideways_spans_023.phpt
[edit]
[-] tideways_spans_001.phpt
[edit]
[-] tideways_024.phpt
[edit]
[-] tideways_023.phpt
[edit]
[-] tideways_fw_options.phpt
[edit]
[-] tideways_spans_002.phpt
[edit]
[-] tideways_queue.php
[edit]
[-] tideways_symfony3.php
[edit]
[-] tideways_spans_036.phpt
[edit]
[-] tideways_029.phpt
[edit]
[-] tideways_spans_028.phpt
[edit]
[-] tideways_transaction_yii.phpt
[edit]
[-] tideways_004.phpt
[edit]
[-] tideways_spans_012.phpt
[edit]
[-] tideways_026.phpt
[edit]
[-] tideways_002.phpt
[edit]
[-] tideways_004_require.php
[edit]
[-] tideways_symfony.php
[edit]
[-] tideways_errors_005.phpt
[edit]
[-] tideways_spans_006.phpt
[edit]
[-] tideways_errors_001.phpt
[edit]
[+]
..
[-] tideways_spans_008.phpt
[edit]
[-] tideways_039_prepend.php
[edit]
[-] tideways_fw_oxid_001.phpt
[edit]
[-] tideways_spans_009.phpt
[edit]
[-] tideways_errors_003.phpt
[edit]
[-] common.php
[edit]
[-] tideways_035.phpt
[edit]
[-] tideways_spans_029.phpt
[edit]
[-] tideways_fw_zend1.phpt
[edit]
[-] elasticsearch.php
[edit]
[-] tideways_transaction_yii2.phpt
[edit]