Skip to content

Instantly share code, notes, and snippets.

@janbuecker
Last active July 31, 2018 07:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save janbuecker/d4a732a58324b4abe01fbfa7db053ebc to your computer and use it in GitHub Desktop.
Save janbuecker/d4a732a58324b4abe01fbfa7db053ebc to your computer and use it in GitHub Desktop.
DynamoDB call
<?php
require 'vendor/autoload.php';
$ms = microtime(true);
$marshaler = new \Aws\DynamoDb\Marshaler();
$client = new \Aws\DynamoDb\DynamoDbClient([
'region' => 'eu-central-1',
'version' => 'latest',
'scheme' => 'http', // is recommended for lower latency because of SSL handshake
]);
$client->getItem([
'TableName' => 'table_name',
'Key' => $marshaler->marshalItem(['foo' => 'bar']),
]);
print (microtime(true) - $ms) . PHP_EOL;
// Output: 0.041330099105835
// Blackfire: https://blackfire.io/profiles/744eb488-38a1-4867-be1b-9ffda2836e93/graph
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment