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/testLogging.php
Normal file
37
stubs/testLogging.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
require_once(dirname(__DIR__) . '/config/sneakerstrap.inc');
|
||||
|
||||
/*
|
||||
* what we are testing is connecting to the new log channel,
|
||||
* posting a message to the channel,
|
||||
* so that we can see what brokers picked-up the message...
|
||||
*
|
||||
*/
|
||||
|
||||
$errors = [];
|
||||
// instantiate a logger client
|
||||
$logger = new gacErrorLogger();
|
||||
if (!$logger->status) die(ERROR_FAILED_TO_INSTANTIATE . RESOURCE_LOGGER);
|
||||
$meta = [
|
||||
META_CLIENT => CLIENT_SYSTEM, // back-door the meta-data checks
|
||||
META_LIMIT => 1,
|
||||
META_TEMPLATE => TEMPLATE_CLASS_GRAPHS,
|
||||
META_TEMPLATE => TEMPLATE_CLASS_TEST_PDO,
|
||||
META_CLIENT_IP => STRING_SESSION_HOME, // required
|
||||
META_EVENT_GUID => guid() // simulate a broker event by generating the event guid
|
||||
];
|
||||
$objTest = new gacFactory($meta, FACTORY_EVENT_NEW_CLASS, '', $errors);
|
||||
|
||||
// this next part just does a non-broker fetch of a single record so that we can fire-off a metrics-fetch event
|
||||
$meta[META_TEMPLATE] = TEMPLATE_CLASS_TEST_MONGO;
|
||||
$logger->fatal(STRING_TEST);
|
||||
// fetch a test record so that we create a metrics event
|
||||
// set up the data payloads
|
||||
$objTest = new gacFactory($meta, FACTORY_EVENT_NEW_CLASS, '', $errors);
|
||||
if (!$objTest->status) die(ERROR_FAILED_TO_INSTANTIATE . $meta[META_TEMPLATE]);
|
||||
$widget = $objTest->widget;
|
||||
$query = null;
|
||||
$request = [BROKER_DATA => [ STRING_QUERY_DATA => $query]];
|
||||
$widget->_fetchRecords($request);
|
||||
if (!$widget->status) var_export($widget->eventMessages);
|
||||
echo 'done' . PHP_EOL;
|
||||
Reference in New Issue
Block a user