in sample/sample.php [82:109]
function getLogsWithPowerSql(Aliyun_Log_Client $client, $project, $logstore) {
$topic = '';
$from = time()-3600;
$to = time();
$query = "* | select count(method)";
$request = new Aliyun_Log_Models_LogStoreSqlRequest($project, $logstore, $from, $to, $query, True);
try {
$response = $client->executeLogStoreSql($request);
foreach($response -> getLogs() as $log)
{
print $log -> getTime()."\t";
foreach($log -> getContents() as $key => $value){
print $key.":".$value."\t";
}
print "\n";
}
print "proccesedRows:".$response -> getProcessedRows()."\n";
print "elapsedMilli:".$response -> getElapsedMilli()."\n";
print "cpuSec:".$response -> getCpuSec()."\n";
print "cpuCores:".$response -> getCpuCores()."\n";
} catch (Aliyun_Log_Exception $ex) {
logVarDump($ex);
} catch (Exception $ex) {
logVarDump($ex);
}
}