mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Initial roughing out of some profiling context
wcat binaries (http://www.iis.net/community/default.aspx?tabid=34&g=6&i=1466) Orchard.Profiling project to hold some wcat scripts for generating stress-style load and specflow features for generating fixed sets of requests "add profiling data" command in Orchard.DevTools to create a number of samples page and blog content items "build.cmd profiling" target creates build\Profiling web dir from clean build, and execs baseline setup and population via orchard cmdline --HG-- branch : dev
This commit is contained in:
@@ -0,0 +1,61 @@
|
||||
using Orchard.Commands;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.ContentManagement.Aspects;
|
||||
using Orchard.Core.Common.Models;
|
||||
using Orchard.Core.Navigation.Models;
|
||||
using Orchard.Security;
|
||||
|
||||
namespace Orchard.DevTools.Commands {
|
||||
public class ProfilingCommands : DefaultOrchardCommandHandler {
|
||||
private readonly IContentManager _contentManager;
|
||||
private readonly IMembershipService _membershipService;
|
||||
|
||||
public ProfilingCommands(IContentManager contentManager, IMembershipService membershipService) {
|
||||
_contentManager = contentManager;
|
||||
_membershipService = membershipService;
|
||||
}
|
||||
|
||||
[CommandName("add profiling data")]
|
||||
public string AddProfilingData() {
|
||||
var admin = _membershipService.GetUser("admin");
|
||||
|
||||
for (var index = 0; index != 5; ++index) {
|
||||
|
||||
var pageName = "page" + index;
|
||||
var page = _contentManager.Create("page", VersionOptions.Draft);
|
||||
page.As<ICommonAspect>().Owner = admin;
|
||||
page.As<RoutableAspect>().Slug = pageName;
|
||||
page.As<RoutableAspect>().Title = pageName;
|
||||
page.As<BodyAspect>().Text = pageName;
|
||||
page.As<MenuPart>().OnMainMenu = true;
|
||||
page.As<MenuPart>().MenuPosition = "5." + index;
|
||||
page.As<MenuPart>().MenuText = pageName;
|
||||
_contentManager.Publish(page);
|
||||
|
||||
var blogName = "blog" + index;
|
||||
var blog = _contentManager.New("blog");
|
||||
blog.As<ICommonAspect>().Owner = admin;
|
||||
blog.As<RoutableAspect>().Slug = blogName;
|
||||
blog.As<RoutableAspect>().Title = blogName;
|
||||
blog.As<MenuPart>().OnMainMenu = true;
|
||||
blog.As<MenuPart>().MenuPosition = "6." + index;
|
||||
blog.As<MenuPart>().MenuText = blogName;
|
||||
_contentManager.Create(blog);
|
||||
|
||||
// "blogpost" content type can't be created w/out http context at the moment
|
||||
//for (var index2 = 0; index2 != 5; ++index2) {
|
||||
// var postName = "post" + index;
|
||||
// var post = _contentManager.New("blogpost");
|
||||
// post.As<ICommonAspect>().Owner = admin;
|
||||
// post.As<ICommonAspect>().Container = blog;
|
||||
// post.As<RoutableAspect>().Slug = postName;
|
||||
// post.As<RoutableAspect>().Title = postName;
|
||||
// post.As<BodyAspect>().Text = postName;
|
||||
// _contentManager.Create(post);
|
||||
//}
|
||||
}
|
||||
|
||||
return "AddProfilingData completed";
|
||||
}
|
||||
}
|
||||
}
|
@@ -66,6 +66,7 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="AdminMenu.cs" />
|
||||
<Compile Include="Commands\ProfilingCommands.cs" />
|
||||
<Compile Include="Controllers\ContentController.cs" />
|
||||
<Compile Include="Controllers\HomeController.cs" />
|
||||
<Compile Include="Handlers\DebugLinkHandler.cs" />
|
||||
@@ -78,9 +79,9 @@
|
||||
<Compile Include="ViewModels\ContentDetailsViewModel.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Module.txt" />
|
||||
<Content Include="Views\Home\_RenderableAction.ascx" />
|
||||
<Content Include="Views\Home\Simple.aspx" />
|
||||
<Content Include="_Module.txt" />
|
||||
<Content Include="Views\Content\Details.aspx" />
|
||||
<Content Include="Views\Content\Index.aspx" />
|
||||
<Content Include="Views\Home\Index.aspx" />
|
||||
@@ -94,6 +95,10 @@
|
||||
<Project>{2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6}</Project>
|
||||
<Name>Orchard.Framework</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\Core\Orchard.Core.csproj">
|
||||
<Project>{9916839C-39FC-4CEB-A5AF-89CA7E87119F}</Project>
|
||||
<Name>Orchard.Core</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v9.0\WebApplications\Microsoft.WebApplication.targets" />
|
||||
|
1
src/Orchard.Web/Modules/Orchard.Sandbox/Module.txt
Normal file
1
src/Orchard.Web/Modules/Orchard.Sandbox/Module.txt
Normal file
@@ -0,0 +1 @@
|
||||
name: Sandbox
|
Reference in New Issue
Block a user