Skip to content

Instantly share code, notes, and snippets.

@Mossman1215
Created August 13, 2020 21:30
Show Gist options
  • Save Mossman1215/dc3c25dd419a4bbe16502daf60de4931 to your computer and use it in GitHub Desktop.
Save Mossman1215/dc3c25dd419a4bbe16502daf60de4931 to your computer and use it in GitHub Desktop.
<?php
namespace SilverStripe\Com\Tasks;
use Psr\Log\LoggerInterface;
use SilverStripe\Core\Injector\Injector;
use SilverStripe\Dev\BuildTask;
use SilverStripe\Versioned\Versioned;
use SilverStripe\CMS\Model\SiteTree;
/**
* export site tree for performance testing
*/
class ExportSiteTree extends BuildTask
{
/**
* Set a custom url segment (to follow dev/tasks/)
*
* @config
* @var string
*/
private static $segment = 'ExportSiteTree';
public function run($request)
{
$livePages = Versioned::get_by_stage(SiteTree::class, Versioned::LIVE);
foreach ($livePages as $page) {
echo $page->Link().PHP_EOL;
}
}
}
#!/bin/bash
while IFS= read -r line; do
ab -n 10 "$line";
done < "$1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment