Skip to content

Commit

Permalink
save time taken and generated size (closes #3)
Browse files Browse the repository at this point in the history
  • Loading branch information
juzna committed Mar 8, 2012
1 parent 62edf49 commit 0070e4b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/presenters/GeneratorPresenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,17 @@ protected function make($item) {
}

// Generate API
$timeStarted = microtime(true);
$rootDir = APP_DIR . '/../';
$sourceDir = "$repoDir/$item->subdir";
$docDir = DOC_PROCESSING_DIR . "/$item->dir";
$docFinalDir = DOC_FINAL_DIR . "/$item->dir";
$generatedWell = $this->exec("php -dmemory_limit=1024M $rootDir/apigen/apigen.php -s " . escapeshellarg($sourceDir) . " -d " . escapeshellarg($docDir) . " --charset=auto --download --debug --colors=no --progressbar=no --title=" . escapeshellarg($item->name), $result);
if($result) $this->db->table('repo')->where('id', $item->id)->update(array('apigenResultId' => $result->id));
$this->db->table('repo')->where('id', $item->id)->update(array(
'apigenResultId' => $result->id,
'apigenTime' => microtime(true) - $timeStarted,
'sizeDoc' => (int) exec("du -sb " . escapeshellarg($docDir)),
));

// check
if(!file_exists("$docDir/index.html") || !$generatedWell) {
Expand Down

0 comments on commit 0070e4b

Please sign in to comment.