A simple PHP library for RESTful Metrics. See http://www.restfulmetrics.com
-
Adjust the class constants in the base RestfulMetrics class as needed.
-
Run the setup.sql queries to initialize your database tables for delayed jobs. Make sure to adjust the table names if you want to use non-default prefixes.
RestfulMetrics::setup("API_KEY", "APP_ID");
RestfulMetrics::asynchronous(new PDO("DSN_STRING"));
RestfulMetrics::addMetric("simple_metric", 1);
RestfulMetrics::addMetric("compound_metric", array("foo", "bar");
require '[PATH/TO]/RestfulMetrics/Client.php';
$rm = new RestfulMetrics_Client([APIKEY], [APP_ID]);
$rm->addMetric("simple", 1);
$rm->addMetric("compound", array("a", "b", "c"));
RestfulMetrics::setup("API_KEY", "APP_ID");
RestfulMetrics::asynchronous(new PDO("DSN_STRING"));
RestfulMetrics::runDelayedJobs();