Archive: Namaste PHP AMQP framework v1.0 (2017-2020)
952 days continuous production uptime, 40k+ tp/s single node. Original corpo Bitbucket history not included — clean archive commit.
This commit is contained in:
37
stubs/testJSONHandler.php
Normal file
37
stubs/testJSONHandler.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: mshallop
|
||||
* Date: 4/15/19
|
||||
* Time: 11:23 AM
|
||||
*/
|
||||
|
||||
// initialization
|
||||
require_once(dirname(__DIR__) . '/config/sneakerstrap.inc');
|
||||
|
||||
$errors = [];
|
||||
$meta = [
|
||||
META_TEMPLATE => TEMPLATE_CLASS_TEST_MONGO,
|
||||
META_CLIENT => CLIENT_CLIENT,
|
||||
META_EVENT_GUID => guid(),
|
||||
META_SYSTEM_NOTES => basename(__FILE__)
|
||||
];
|
||||
|
||||
// instantiate a test class and generate some test data
|
||||
$objTest = new gacFactory($meta, FACTORY_EVENT_NEW_CLASS, '',$errors);
|
||||
if (!$objTest->status)
|
||||
exit (ERROR_TEMPLATE_INSTANTIATE . TEMPLATE_CLASS_TEST_MONGO);
|
||||
/** @var $widget gatTestMongo */
|
||||
$widget = $objTest->widget;
|
||||
$testData = $widget->template->buildTestData(100);
|
||||
foreach ($testData as &$record) {
|
||||
$record[CM_TST_TOKEN] = guid();
|
||||
$record[CM_TST_FIELD_TEST_CDATE] = time();
|
||||
$record[CM_TST_FIELD_TEST_STATUS] = STATUS_ACTIVE;
|
||||
}
|
||||
|
||||
$cacheString = jsonHandler($testData, JSON_DIR_ENC, $errors, false);
|
||||
if (is_null($cacheString))
|
||||
exit('error processing json data - check logs');
|
||||
$length = strlen($cacheString);
|
||||
echo 'cache string is ' . strval($length/1024) . ' Kbytes long';
|
||||
Reference in New Issue
Block a user