mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-06-28 15:34:39 +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:
parent
c0519a48b1
commit
17fcea6e86
@ -8,8 +8,7 @@ glob:*.patch
|
|||||||
glob:*.hg
|
glob:*.hg
|
||||||
glob:build
|
glob:build
|
||||||
glob:*.sln.cache
|
glob:*.sln.cache
|
||||||
glob:src/Orchard.Web/Modules/Orchard.DevTools/Module.txt
|
|
||||||
glob:src/Orchard.Web/Modules/Orchard.Sandbox/Module.txt
|
|
||||||
glob:src/Orchard.Web/Media/*
|
glob:src/Orchard.Web/Media/*
|
||||||
glob:desktop.ini
|
glob:desktop.ini
|
||||||
glob:src/Orchard.Azure.suo
|
glob:src/Orchard.Azure.suo
|
||||||
|
glob:log.xml
|
||||||
|
25
Orchard.proj
25
Orchard.proj
@ -11,6 +11,7 @@
|
|||||||
<CompileFolder>$(BuildFolder)\Compile</CompileFolder>
|
<CompileFolder>$(BuildFolder)\Compile</CompileFolder>
|
||||||
<WebSitesFolder>$(CompileFolder)\_PublishedWebsites</WebSitesFolder>
|
<WebSitesFolder>$(CompileFolder)\_PublishedWebsites</WebSitesFolder>
|
||||||
<StageFolder>$(BuildFolder)\Stage</StageFolder>
|
<StageFolder>$(BuildFolder)\Stage</StageFolder>
|
||||||
|
<ProfilingFolder>$(BuildFolder)\Profiling</ProfilingFolder>
|
||||||
|
|
||||||
<BuildPlatform Condition="$(ProgramW6432) != ''">x64</BuildPlatform>
|
<BuildPlatform Condition="$(ProgramW6432) != ''">x64</BuildPlatform>
|
||||||
<BuildPlatform Condition="$(BuildPlatform) == ''">x86</BuildPlatform>
|
<BuildPlatform Condition="$(BuildPlatform) == ''">x86</BuildPlatform>
|
||||||
@ -32,6 +33,14 @@
|
|||||||
<CallTarget Targets="Package-Zip"/>
|
<CallTarget Targets="Package-Zip"/>
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
|
<Target Name="Profiling">
|
||||||
|
<CallTarget Targets="Clean"/>
|
||||||
|
<CallTarget Targets="Compile"/>
|
||||||
|
<CallTarget Targets="Package-Stage"/>
|
||||||
|
<CallTarget Targets="Profiling-Stage"/>
|
||||||
|
<CallTarget Targets="Profiling-Setup"/>
|
||||||
|
</Target>
|
||||||
|
|
||||||
|
|
||||||
<!-- Building -->
|
<!-- Building -->
|
||||||
|
|
||||||
@ -141,4 +150,20 @@
|
|||||||
<Zip Files="@(Zip-Source)" WorkingDirectory="$(MSBuildProjectDirectory)" ZipFileName="$(BuildFolder)\Orchard.Source.zip" />
|
<Zip Files="@(Zip-Source)" WorkingDirectory="$(MSBuildProjectDirectory)" ZipFileName="$(BuildFolder)\Orchard.Source.zip" />
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
|
<!-- Profiling -->
|
||||||
|
|
||||||
|
<Target Name="Profiling-Stage">
|
||||||
|
<ItemGroup>
|
||||||
|
<Profiling-Web Include="$(StageFolder)\**\*" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<Copy SourceFiles="@(Profiling-Web)" DestinationFolder="$(ProfilingFolder)\%(RecursiveDir)"/>
|
||||||
|
|
||||||
|
</Target>
|
||||||
|
|
||||||
|
<Target Name="Profiling-Setup">
|
||||||
|
<Exec Command="$(ProfilingFolder)\bin\Orchard.exe @$(SrcFolder)\Orchard.Profile\profiling-setup-commands.txt" WorkingDirectory="$(ProfilingFolder)"/>
|
||||||
|
</Target>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|
||||||
|
37
lib/wcat/doc/readme.txt
Normal file
37
lib/wcat/doc/readme.txt
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
Getting Started with WCAT
|
||||||
|
======================================
|
||||||
|
|
||||||
|
Documentation
|
||||||
|
It is suggested that you read the documentation for WCAT in order to understand
|
||||||
|
the environment and configuration needed. Documentation can be found under the
|
||||||
|
doc folder in the directory that you installed WCAT to.
|
||||||
|
|
||||||
|
Installing WCAT
|
||||||
|
Prerequisite: all machines that will run WCAT must have the administrator account
|
||||||
|
enabled and must all share a common password.
|
||||||
|
|
||||||
|
1. Log into the WCAT Controller as administrator.
|
||||||
|
2. Install wcat.msi on the machine to be used as a WCAT Controller.
|
||||||
|
3. If any WCAT extension DLLs will be used, copy them to the WCAT installation
|
||||||
|
directory. (typically c:\Program Files\WCAT)
|
||||||
|
4. Open a command prompt; navigate to the WCAT installation directory.
|
||||||
|
5. Run ‘cscript //H:Cscript’
|
||||||
|
6. Run ‘wcat.wsf –terminate –update –clients {comma separated list of WCAT client
|
||||||
|
machines}’ where the “clients” parameter accepts a comma separated list (no
|
||||||
|
spaces) of the machines you plan on using as WCAT Client machines. Note: If
|
||||||
|
the WCAT Controller machine will also be used as a WCAT Client, include
|
||||||
|
‘localhost’ OR the name of the WCAT Controller machine in the list of clients.
|
||||||
|
|
||||||
|
NOTE: If WCAT has never been installed on the WCAT Client machines before,
|
||||||
|
this will cause the machines to reboot.
|
||||||
|
|
||||||
|
Running WCAT
|
||||||
|
1. Log into the WCAT Controller as administrator.
|
||||||
|
2. Install wcat.msi on the machine to be used as a WCAT Controller.
|
||||||
|
3. Open a command prompt, navigate to the WCAT installation directory (typically
|
||||||
|
c:\Program Files\WCAT)
|
||||||
|
4. Run ‘wcat.wsf –terminate –run –clients {comma separated client list} –t
|
||||||
|
{scenario file} –f {settings file} –s {name of the Web Server} –singleip -x
|
||||||
|
5. Output will be generated in the current directory, ‘log.xml’. To change this,
|
||||||
|
use the ‘-o’ flag. For more help on options to pass to wcat.wsf type
|
||||||
|
‘wcctl.exe -?’
|
BIN
lib/wcat/doc/wcat.doc
Normal file
BIN
lib/wcat/doc/wcat.doc
Normal file
Binary file not shown.
1786
lib/wcat/report.xsl
Normal file
1786
lib/wcat/report.xsl
Normal file
File diff suppressed because it is too large
Load Diff
66
lib/wcat/samples/scripts/home.ubr
Normal file
66
lib/wcat/samples/scripts/home.ubr
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
scenario
|
||||||
|
{
|
||||||
|
name = "IIS Home Page";
|
||||||
|
|
||||||
|
warmup = 30;
|
||||||
|
duration = 120;
|
||||||
|
cooldown = 10;
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// All requests inherit the settings from the default request.
|
||||||
|
// Defaults are overridden if specified in the request itself.
|
||||||
|
//
|
||||||
|
/////////////////////////////////////////////////////////////////
|
||||||
|
default
|
||||||
|
{
|
||||||
|
// send keep-alive header
|
||||||
|
setheader
|
||||||
|
{
|
||||||
|
name = "Connection";
|
||||||
|
value = "keep-alive";
|
||||||
|
}
|
||||||
|
|
||||||
|
// set the host header
|
||||||
|
setheader
|
||||||
|
{
|
||||||
|
name = "Host";
|
||||||
|
value = server();
|
||||||
|
}
|
||||||
|
|
||||||
|
// HTTP1.1 request
|
||||||
|
version = HTTP11;
|
||||||
|
|
||||||
|
// keep the connection alive after the request
|
||||||
|
close = ka;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// This script is made for IIS7
|
||||||
|
//
|
||||||
|
transaction
|
||||||
|
{
|
||||||
|
id = "Default Web Site Homepage";
|
||||||
|
weight = 1;
|
||||||
|
|
||||||
|
request
|
||||||
|
{
|
||||||
|
url = "/";
|
||||||
|
statuscode = 200;
|
||||||
|
}
|
||||||
|
|
||||||
|
request
|
||||||
|
{
|
||||||
|
url = "/welcome.png";
|
||||||
|
statuscode = 200;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// specifically close the connection after both files are requested
|
||||||
|
//
|
||||||
|
close
|
||||||
|
{
|
||||||
|
method = reset;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
102
lib/wcat/samples/scripts/settings.ubr
Normal file
102
lib/wcat/samples/scripts/settings.ubr
Normal file
@ -0,0 +1,102 @@
|
|||||||
|
settings
|
||||||
|
{
|
||||||
|
//--------------------------------------------------------------------------
|
||||||
|
// General controller settings
|
||||||
|
//
|
||||||
|
// clientfile - specifies the client file, relative to working dir
|
||||||
|
// server - host name of the webserver
|
||||||
|
// virtualclients - number of 'threads' per physical client
|
||||||
|
// clients - number of physical webcat client machines
|
||||||
|
//
|
||||||
|
//--------------------------------------------------------------------------
|
||||||
|
// Example:
|
||||||
|
//
|
||||||
|
// clientfile = "ubr\lcw2.light.ubr";
|
||||||
|
// server = "webserver";
|
||||||
|
// clients = 10;
|
||||||
|
// virtualclients = 100;
|
||||||
|
//
|
||||||
|
//--------------------------------------------------------------------------
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------
|
||||||
|
// Performance counters (pass '-x' option to wcctl.exe to enable)
|
||||||
|
//
|
||||||
|
// interval - polling interval in seconds (default=10)
|
||||||
|
// host - host name of machine to monitor (default=webserver)
|
||||||
|
// counter - path of counter to monitor
|
||||||
|
//
|
||||||
|
//--------------------------------------------------------------------------
|
||||||
|
// Optional:
|
||||||
|
//
|
||||||
|
// Additional machines can be monitored by adding more counters blocks.
|
||||||
|
//
|
||||||
|
// Example:
|
||||||
|
//
|
||||||
|
// counters {
|
||||||
|
// host = "sqlserver"; // name of remote machine
|
||||||
|
// interval = 5;
|
||||||
|
// counter = "...";
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
//--------------------------------------------------------------------------
|
||||||
|
|
||||||
|
counters
|
||||||
|
{
|
||||||
|
interval = 10;
|
||||||
|
|
||||||
|
counter = "Processor(_Total)\\% Processor Time";
|
||||||
|
counter = "Processor(_Total)\\% Privileged Time";
|
||||||
|
counter = "Processor(_Total)\\% User Time";
|
||||||
|
counter = "Processor(_Total)\\Interrupts/sec";
|
||||||
|
|
||||||
|
counter = "Memory\\Available KBytes";
|
||||||
|
|
||||||
|
counter = "Process(w3wp)\\Working Set";
|
||||||
|
|
||||||
|
counter = "System\\Context Switches/sec";
|
||||||
|
counter = "System\\System Calls/sec";
|
||||||
|
|
||||||
|
counter = "Web Service(_Total)\\Bytes Received/sec" ;
|
||||||
|
counter = "Web Service(_Total)\\Bytes Sent/sec" ;
|
||||||
|
counter = "Web Service(_Total)\\Connection Attempts/sec" ;
|
||||||
|
counter = "Web Service(_Total)\\Get Requests/sec" ;
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------
|
||||||
|
// Registry Key Monitors (pass '-x' option to wcctl.exe to enable)
|
||||||
|
//
|
||||||
|
// path - registry path, relative to HKLM
|
||||||
|
// name - name of registry key
|
||||||
|
// type - type of value (REG_SZ | REG_DWORD)
|
||||||
|
//
|
||||||
|
//--------------------------------------------------------------------------
|
||||||
|
// Optional:
|
||||||
|
//
|
||||||
|
// Additional registry keys can be monitored on the web server by
|
||||||
|
// adding more registry blocks to this file. Note that simple strings and
|
||||||
|
// dwords are all that webcat currently supports.
|
||||||
|
//
|
||||||
|
// Example:
|
||||||
|
//
|
||||||
|
// registry {
|
||||||
|
// path = "System\\CurrentControlSet\\Services\\Tcpip\\Parameters";
|
||||||
|
// name = "DhcpDomain";
|
||||||
|
// type = REG_SZ;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
//--------------------------------------------------------------------------
|
||||||
|
|
||||||
|
registry
|
||||||
|
{
|
||||||
|
path = "System\\CurrentControlSet\\Control\\FileSystem";
|
||||||
|
name = "NtfsDisableLastAccessUpdate";
|
||||||
|
type = REG_DWORD;
|
||||||
|
}
|
||||||
|
|
||||||
|
registry
|
||||||
|
{
|
||||||
|
path = "System\\CurrentControlSet\\Services\\Tcpip\\Parameters";
|
||||||
|
name = "SynAttackProtect";
|
||||||
|
type = REG_DWORD;
|
||||||
|
}
|
||||||
|
}
|
14
lib/wcat/samples/src/precomp.h
Normal file
14
lib/wcat/samples/src/precomp.h
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
#ifndef _PRECOMP_H
|
||||||
|
#define _PRECOMP_H
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <time.h>
|
||||||
|
#include <winsock2.h>
|
||||||
|
#include <windows.h>
|
||||||
|
|
||||||
|
#include <ws2tcpip.h>
|
||||||
|
#include <mswsock.h>
|
||||||
|
|
||||||
|
#endif // _PRECOMP_H
|
186
lib/wcat/samples/src/viewstate.c
Normal file
186
lib/wcat/samples/src/viewstate.c
Normal file
@ -0,0 +1,186 @@
|
|||||||
|
#include <stdlib.h>
|
||||||
|
#include <windows.h>
|
||||||
|
#include "precomp.h"
|
||||||
|
|
||||||
|
#define MAX_VIEWSTATE (1024)
|
||||||
|
#define VIEWSTATE "__VIEWSTATE"
|
||||||
|
#define VIEWSTATE_LEN (10)
|
||||||
|
#define MAX_TAG_NAME (128)
|
||||||
|
|
||||||
|
#define WCATRESULT_ERROR (-1)
|
||||||
|
#define WCATRESULT_SUCCESS (0)
|
||||||
|
#define WCATRESULT_MORE_DATA_NEEDED (1)
|
||||||
|
#define WCATRESULT_NEXT_PACKET (2)
|
||||||
|
|
||||||
|
typedef enum _USER_STATE
|
||||||
|
{
|
||||||
|
UserStateFindViewState,
|
||||||
|
UserStateFindValue,
|
||||||
|
UserStateFindEqual,
|
||||||
|
UserStateFindFirstQuote,
|
||||||
|
UserStateGetValue,
|
||||||
|
UserStateFinished
|
||||||
|
} USER_STATE;
|
||||||
|
|
||||||
|
typedef struct _USER_DATA
|
||||||
|
{
|
||||||
|
USER_STATE state;
|
||||||
|
char viewstate[MAX_VIEWSTATE];
|
||||||
|
} USER_DATA, *PUSER_DATA;
|
||||||
|
|
||||||
|
BOOL WINAPI DllMain(
|
||||||
|
IN HINSTANCE hinstDll,
|
||||||
|
IN DWORD dwReason,
|
||||||
|
IN LPVOID lpvContext
|
||||||
|
)
|
||||||
|
{
|
||||||
|
switch( dwReason ) {
|
||||||
|
|
||||||
|
case DLL_PROCESS_ATTACH:
|
||||||
|
break;
|
||||||
|
|
||||||
|
case DLL_PROCESS_DETACH:
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
DWORD GetViewstate(PVOID *context, DWORD argc, PCHAR argv[], PCHAR *result)
|
||||||
|
{
|
||||||
|
PUSER_DATA user;
|
||||||
|
|
||||||
|
if (*context == NULL)
|
||||||
|
{
|
||||||
|
*result = NULL;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
user = *context;
|
||||||
|
|
||||||
|
*result = user->viewstate;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
DWORD ResponseFilter(PVOID *context, DWORD argc, PCHAR argv[], PCHAR packet, ULONG_PTR len, ULONG_PTR sequence)
|
||||||
|
{
|
||||||
|
PCHAR buffer = packet;
|
||||||
|
DWORD i = 0;
|
||||||
|
PUSER_DATA user = NULL;
|
||||||
|
|
||||||
|
if (*context == NULL)
|
||||||
|
{
|
||||||
|
*context = calloc(1, sizeof(USER_DATA));
|
||||||
|
|
||||||
|
if (NULL == *context)
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
user = *context;
|
||||||
|
|
||||||
|
if (sequence == 0)
|
||||||
|
{
|
||||||
|
user->state = UserStateFindViewState;
|
||||||
|
user->viewstate[0] = '\0';
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// fastpath for when we don't have any work to do
|
||||||
|
//
|
||||||
|
if (user->state == UserStateFinished)
|
||||||
|
{
|
||||||
|
return WCATRESULT_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
while (len && *buffer)
|
||||||
|
{
|
||||||
|
switch (user->state)
|
||||||
|
{
|
||||||
|
case UserStateFindViewState:
|
||||||
|
if (*buffer == '_')
|
||||||
|
{
|
||||||
|
if (len < VIEWSTATE_LEN)
|
||||||
|
{
|
||||||
|
return WCATRESULT_MORE_DATA_NEEDED;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_strnicmp(buffer, VIEWSTATE, VIEWSTATE_LEN) == 0)
|
||||||
|
{
|
||||||
|
len -= VIEWSTATE_LEN-1;
|
||||||
|
buffer += VIEWSTATE_LEN-1;
|
||||||
|
|
||||||
|
user->state = UserStateFindValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
case UserStateFindValue:
|
||||||
|
if (*buffer == 'v' || *buffer == 'V')
|
||||||
|
{
|
||||||
|
if (len < 5)
|
||||||
|
{
|
||||||
|
return WCATRESULT_MORE_DATA_NEEDED;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_strnicmp(buffer, "value", 5) == 0)
|
||||||
|
{
|
||||||
|
len -= 4;
|
||||||
|
buffer += 4;
|
||||||
|
|
||||||
|
user->state = UserStateFindEqual;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case UserStateFindEqual:
|
||||||
|
if (*buffer == '=')
|
||||||
|
{
|
||||||
|
user->state = UserStateFindFirstQuote;
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
case UserStateFindFirstQuote:
|
||||||
|
if (*buffer == '"')
|
||||||
|
{
|
||||||
|
user->state = UserStateGetValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
case UserStateGetValue:
|
||||||
|
i = 0;
|
||||||
|
|
||||||
|
for (i=0; len && *buffer && *buffer != '"'; i++, len--, buffer++)
|
||||||
|
{
|
||||||
|
if (i > MAX_VIEWSTATE)
|
||||||
|
{
|
||||||
|
return WCATRESULT_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
user->viewstate[i] = *buffer;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (len == 0 || *buffer != '"')
|
||||||
|
{
|
||||||
|
return WCATRESULT_MORE_DATA_NEEDED;
|
||||||
|
}
|
||||||
|
|
||||||
|
user->viewstate[i] = '\0';
|
||||||
|
|
||||||
|
user->state = UserStateFinished;
|
||||||
|
break;
|
||||||
|
case UserStateFinished:
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
len--; buffer++;
|
||||||
|
}
|
||||||
|
|
||||||
|
return WCATRESULT_SUCCESS;
|
||||||
|
}
|
7
lib/wcat/samples/src/viewstate.def
Normal file
7
lib/wcat/samples/src/viewstate.def
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
; MYTESTSERVICE.def : declares the module parameters for the DLL.
|
||||||
|
|
||||||
|
LIBRARY "Viewstate"
|
||||||
|
|
||||||
|
EXPORTS
|
||||||
|
GetViewstate
|
||||||
|
ResponseFilter
|
9
lib/wcat/samples/src/wcat.h
Normal file
9
lib/wcat/samples/src/wcat.h
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
#ifndef _WCAT_H
|
||||||
|
#define _WCAT_H
|
||||||
|
|
||||||
|
#define WCATRESULT_ERROR (-1)
|
||||||
|
#define WCATRESULT_SUCCESS (0)
|
||||||
|
#define WCATRESULT_MORE_DATA_NEEDED (1)
|
||||||
|
#define WCATRESULT_NEXT_PACKET (2)
|
||||||
|
|
||||||
|
#endif // define _WCAT_H
|
1134
lib/wcat/wcat.wsf
Normal file
1134
lib/wcat/wcat.wsf
Normal file
File diff suppressed because it is too large
Load Diff
BIN
lib/wcat/wcclient.exe
Normal file
BIN
lib/wcat/wcclient.exe
Normal file
Binary file not shown.
BIN
lib/wcat/wcctl.exe
Normal file
BIN
lib/wcat/wcctl.exe
Normal file
Binary file not shown.
BIN
lib/wcat/wcutil.exe
Normal file
BIN
lib/wcat/wcutil.exe
Normal file
Binary file not shown.
3
src/Orchard.Profile/Go.cmd
Normal file
3
src/Orchard.Profile/Go.cmd
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
@echo off
|
||||||
|
call "%~dp0\_environment"
|
||||||
|
"%wcatfiles%\wcat.wsf" -terminate -run -clients localhost -t "%~dp0\Scripts\%1.txt" -f "%~dp0\settings.txt" -s localhost -singleip -x
|
4
src/Orchard.Profile/Initialize.cmd
Normal file
4
src/Orchard.Profile/Initialize.cmd
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
@echo off
|
||||||
|
call "%~dp0\_environment"
|
||||||
|
"%wcatfiles%\wcat.wsf" -terminate -update -clients localhost
|
||||||
|
|
90
src/Orchard.Profile/Orchard.Profile.csproj
Normal file
90
src/Orchard.Profile/Orchard.Profile.csproj
Normal file
@ -0,0 +1,90 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<PropertyGroup>
|
||||||
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
|
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||||
|
<ProductVersion>9.0.30729</ProductVersion>
|
||||||
|
<SchemaVersion>2.0</SchemaVersion>
|
||||||
|
<ProjectGuid>{94E694A2-D140-468D-A277-C5FCE1D13E9B}</ProjectGuid>
|
||||||
|
<OutputType>Library</OutputType>
|
||||||
|
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||||
|
<RootNamespace>Orchard.Profile</RootNamespace>
|
||||||
|
<AssemblyName>Orchard.Profile</AssemblyName>
|
||||||
|
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||||
|
<FileAlignment>512</FileAlignment>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<Optimize>false</Optimize>
|
||||||
|
<OutputPath>bin\Debug\</OutputPath>
|
||||||
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||||
|
<DebugType>pdbonly</DebugType>
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<OutputPath>bin\Release\</OutputPath>
|
||||||
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Reference Include="nunit.framework, Version=2.5.2.9222, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
|
||||||
|
<SpecificVersion>False</SpecificVersion>
|
||||||
|
<HintPath>..\..\lib\nunit\nunit.framework.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System" />
|
||||||
|
<Reference Include="System.Core">
|
||||||
|
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System.Web" />
|
||||||
|
<Reference Include="System.Xml.Linq">
|
||||||
|
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System.Data.DataSetExtensions">
|
||||||
|
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System.Data" />
|
||||||
|
<Reference Include="System.Xml" />
|
||||||
|
<Reference Include="TechTalk.SpecFlow, Version=1.2.0.0, Culture=neutral, PublicKeyToken=0778194805d6db41, processorArchitecture=MSIL">
|
||||||
|
<SpecificVersion>False</SpecificVersion>
|
||||||
|
<HintPath>..\..\lib\specflow\TechTalk.SpecFlow.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Include="Class1.cs" />
|
||||||
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
|
<Compile Include="Tests\HttpClient.cs" />
|
||||||
|
<Compile Include="Tests\Profiling.feature.cs">
|
||||||
|
<AutoGen>True</AutoGen>
|
||||||
|
<DesignTime>True</DesignTime>
|
||||||
|
<DependentUpon>Profiling.feature</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="Tests\Profiling.feature">
|
||||||
|
<Generator>SpecFlowSingleFileGenerator</Generator>
|
||||||
|
<LastGenOutput>Profiling.feature.cs</LastGenOutput>
|
||||||
|
</None>
|
||||||
|
<None Include="_environment.cmd" />
|
||||||
|
<None Include="Go.cmd" />
|
||||||
|
<None Include="Initialize.cmd" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Content Include="profiling-setup-commands.txt" />
|
||||||
|
<Content Include="report.xsl" />
|
||||||
|
<Content Include="Scripts\scenario.txt" />
|
||||||
|
<Content Include="Scripts\dashboard.txt" />
|
||||||
|
<Content Include="settings.txt" />
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
|
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||||
|
Other similar extension points exist, see Microsoft.Common.targets.
|
||||||
|
<Target Name="BeforeBuild">
|
||||||
|
</Target>
|
||||||
|
<Target Name="AfterBuild">
|
||||||
|
</Target>
|
||||||
|
-->
|
||||||
|
</Project>
|
36
src/Orchard.Profile/Properties/AssemblyInfo.cs
Normal file
36
src/Orchard.Profile/Properties/AssemblyInfo.cs
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
using System.Reflection;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
|
// General Information about an assembly is controlled through the following
|
||||||
|
// set of attributes. Change these attribute values to modify the information
|
||||||
|
// associated with an assembly.
|
||||||
|
[assembly: AssemblyTitle("Orchard.Profile")]
|
||||||
|
[assembly: AssemblyDescription("")]
|
||||||
|
[assembly: AssemblyConfiguration("")]
|
||||||
|
[assembly: AssemblyCompany("Microsoft")]
|
||||||
|
[assembly: AssemblyProduct("Orchard.Profile")]
|
||||||
|
[assembly: AssemblyCopyright("Copyright © Microsoft 2010")]
|
||||||
|
[assembly: AssemblyTrademark("")]
|
||||||
|
[assembly: AssemblyCulture("")]
|
||||||
|
|
||||||
|
// Setting ComVisible to false makes the types in this assembly not visible
|
||||||
|
// to COM components. If you need to access a type in this assembly from
|
||||||
|
// COM, set the ComVisible attribute to true on that type.
|
||||||
|
[assembly: ComVisible(false)]
|
||||||
|
|
||||||
|
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||||
|
[assembly: Guid("669564db-5b8e-4378-b40a-03d3b9bec4c9")]
|
||||||
|
|
||||||
|
// Version information for an assembly consists of the following four values:
|
||||||
|
//
|
||||||
|
// Major Version
|
||||||
|
// Minor Version
|
||||||
|
// Build Number
|
||||||
|
// Revision
|
||||||
|
//
|
||||||
|
// You can specify all the values or you can default the Build and Revision Numbers
|
||||||
|
// by using the '*' as shown below:
|
||||||
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
|
[assembly: AssemblyVersion("1.0.0.0")]
|
||||||
|
[assembly: AssemblyFileVersion("1.0.0.0")]
|
70
src/Orchard.Profile/Scripts/dashboard.txt
Normal file
70
src/Orchard.Profile/Scripts/dashboard.txt
Normal file
@ -0,0 +1,70 @@
|
|||||||
|
scenario
|
||||||
|
{
|
||||||
|
name = "Orchard Dashboard";
|
||||||
|
|
||||||
|
warmup = 10;
|
||||||
|
duration = 30;
|
||||||
|
cooldown = 1;
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// All requests inherit the settings from the default request.
|
||||||
|
// Defaults are overridden if specified in the request itself.
|
||||||
|
//
|
||||||
|
/////////////////////////////////////////////////////////////////
|
||||||
|
default
|
||||||
|
{
|
||||||
|
// send keep-alive header
|
||||||
|
setheader
|
||||||
|
{
|
||||||
|
name = "Connection";
|
||||||
|
value = "keep-alive";
|
||||||
|
}
|
||||||
|
|
||||||
|
// set the host header
|
||||||
|
setheader
|
||||||
|
{
|
||||||
|
name = "Host";
|
||||||
|
value = server();
|
||||||
|
}
|
||||||
|
|
||||||
|
// HTTP1.1 request
|
||||||
|
version = HTTP11;
|
||||||
|
|
||||||
|
// keep the connection alive after the request
|
||||||
|
close = ka;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// This script is made for IIS7
|
||||||
|
//
|
||||||
|
transaction
|
||||||
|
{
|
||||||
|
id = "Login and view admin";
|
||||||
|
weight = 1;
|
||||||
|
|
||||||
|
request
|
||||||
|
{
|
||||||
|
url = "/Users/Account/LogOn";
|
||||||
|
verb = POST;
|
||||||
|
postdata = "username=admin&password=profiling-secret";
|
||||||
|
redirect = true;
|
||||||
|
redirverb = GET;
|
||||||
|
statuscode = 200;
|
||||||
|
}
|
||||||
|
|
||||||
|
request
|
||||||
|
{
|
||||||
|
url = "/admin";
|
||||||
|
statuscode = 200;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// specifically close the connection after both files are requested
|
||||||
|
//
|
||||||
|
close
|
||||||
|
{
|
||||||
|
method = reset;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
66
src/Orchard.Profile/Scripts/scenario.txt
Normal file
66
src/Orchard.Profile/Scripts/scenario.txt
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
scenario
|
||||||
|
{
|
||||||
|
name = "IIS Home Page";
|
||||||
|
|
||||||
|
warmup = 10;
|
||||||
|
duration = 30;
|
||||||
|
cooldown = 1;
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// All requests inherit the settings from the default request.
|
||||||
|
// Defaults are overridden if specified in the request itself.
|
||||||
|
//
|
||||||
|
/////////////////////////////////////////////////////////////////
|
||||||
|
default
|
||||||
|
{
|
||||||
|
// send keep-alive header
|
||||||
|
setheader
|
||||||
|
{
|
||||||
|
name = "Connection";
|
||||||
|
value = "keep-alive";
|
||||||
|
}
|
||||||
|
|
||||||
|
// set the host header
|
||||||
|
setheader
|
||||||
|
{
|
||||||
|
name = "Host";
|
||||||
|
value = server();
|
||||||
|
}
|
||||||
|
|
||||||
|
// HTTP1.1 request
|
||||||
|
version = HTTP11;
|
||||||
|
|
||||||
|
// keep the connection alive after the request
|
||||||
|
close = ka;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// This script is made for IIS7
|
||||||
|
//
|
||||||
|
transaction
|
||||||
|
{
|
||||||
|
id = "Default Web Site Homepage";
|
||||||
|
weight = 1;
|
||||||
|
|
||||||
|
request
|
||||||
|
{
|
||||||
|
url = "/";
|
||||||
|
statuscode = 200;
|
||||||
|
}
|
||||||
|
|
||||||
|
request
|
||||||
|
{
|
||||||
|
url = "/welcome.png";
|
||||||
|
statuscode = 200;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// specifically close the connection after both files are requested
|
||||||
|
//
|
||||||
|
close
|
||||||
|
{
|
||||||
|
method = reset;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
64
src/Orchard.Profile/Tests/HttpClient.cs
Normal file
64
src/Orchard.Profile/Tests/HttpClient.cs
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Net;
|
||||||
|
using System.Text;
|
||||||
|
using System.Web;
|
||||||
|
using TechTalk.SpecFlow;
|
||||||
|
|
||||||
|
namespace Orchard.Profile.Tests {
|
||||||
|
[Binding]
|
||||||
|
public class HttpClient {
|
||||||
|
private readonly CookieContainer _cookieContainer = new CookieContainer();
|
||||||
|
private HttpWebRequest _request;
|
||||||
|
private HttpWebResponse _response;
|
||||||
|
private string _text;
|
||||||
|
|
||||||
|
[Given(@"I am logged in")]
|
||||||
|
public void GivenIAmLoggedIn() {
|
||||||
|
DoRequest("/Users/Account/LogOn", "userNameOrEmail=admin&password=profiling-secret&rememberMe=false");
|
||||||
|
}
|
||||||
|
|
||||||
|
[When(@"I go to ""(.*)""")]
|
||||||
|
public void WhenIGoTo(string url) {
|
||||||
|
DoRequest(url);
|
||||||
|
}
|
||||||
|
|
||||||
|
[When(@"I go to ""(.*)"" (.*) times")]
|
||||||
|
public void WhenIGoTo(string url, int times) {
|
||||||
|
for (int i = 0; i != times; ++i)
|
||||||
|
DoRequest(url);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DoRequest(string url) {
|
||||||
|
DoRequest(url, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DoRequest(string url, string postData) {
|
||||||
|
_request = (HttpWebRequest)WebRequest.Create("http://localhost" + url);
|
||||||
|
_request.CookieContainer = _cookieContainer;
|
||||||
|
if (postData != null) {
|
||||||
|
_request.Method = "POST";
|
||||||
|
_request.ContentType = "application/x-www-form-urlencoded";
|
||||||
|
using (var stream = _request.GetRequestStream()) {
|
||||||
|
using (var writer = new StreamWriter(stream)) {
|
||||||
|
writer.Write(postData);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
_response = (HttpWebResponse)_request.GetResponse();
|
||||||
|
}
|
||||||
|
catch (WebException ex) {
|
||||||
|
_response = (HttpWebResponse)ex.Response;
|
||||||
|
}
|
||||||
|
|
||||||
|
using (var stream = _response.GetResponseStream()) {
|
||||||
|
using (var reader = new StreamReader(stream)) {
|
||||||
|
_text = reader.ReadToEnd();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
8
src/Orchard.Profile/Tests/Profiling.feature
Normal file
8
src/Orchard.Profile/Tests/Profiling.feature
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
Feature: Profiling
|
||||||
|
In order to profile the site
|
||||||
|
As a developer
|
||||||
|
I want to generate a fixed number of repeatable requests
|
||||||
|
|
||||||
|
Scenario: Dashboard
|
||||||
|
Given I am logged in
|
||||||
|
When I go to "/admin" 40 times
|
68
src/Orchard.Profile/Tests/Profiling.feature.cs
generated
Normal file
68
src/Orchard.Profile/Tests/Profiling.feature.cs
generated
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
// ------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by SpecFlow (http://www.specflow.org/).
|
||||||
|
// SpecFlow Version:1.2.0.0
|
||||||
|
// Runtime Version:2.0.50727.4927
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
// ------------------------------------------------------------------------------
|
||||||
|
namespace Orchard.Profile.Tests
|
||||||
|
{
|
||||||
|
using TechTalk.SpecFlow;
|
||||||
|
|
||||||
|
|
||||||
|
[NUnit.Framework.TestFixtureAttribute()]
|
||||||
|
[NUnit.Framework.DescriptionAttribute("Profiling")]
|
||||||
|
public partial class ProfilingFeature
|
||||||
|
{
|
||||||
|
|
||||||
|
private static TechTalk.SpecFlow.ITestRunner testRunner;
|
||||||
|
|
||||||
|
#line 1 "Profiling.feature"
|
||||||
|
#line hidden
|
||||||
|
|
||||||
|
[NUnit.Framework.TestFixtureSetUpAttribute()]
|
||||||
|
public virtual void FeatureSetup()
|
||||||
|
{
|
||||||
|
testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner();
|
||||||
|
TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Profiling", "In order to profile the site\r\nAs a developer\r\nI want to generate a fixed number o" +
|
||||||
|
"f repeatable requests", ((string[])(null)));
|
||||||
|
testRunner.OnFeatureStart(featureInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
[NUnit.Framework.TestFixtureTearDownAttribute()]
|
||||||
|
public virtual void FeatureTearDown()
|
||||||
|
{
|
||||||
|
testRunner.OnFeatureEnd();
|
||||||
|
testRunner = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual void ScenarioSetup(TechTalk.SpecFlow.ScenarioInfo scenarioInfo)
|
||||||
|
{
|
||||||
|
testRunner.OnScenarioStart(scenarioInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
[NUnit.Framework.TearDownAttribute()]
|
||||||
|
public virtual void ScenarioTearDown()
|
||||||
|
{
|
||||||
|
testRunner.OnScenarioEnd();
|
||||||
|
}
|
||||||
|
|
||||||
|
[NUnit.Framework.TestAttribute()]
|
||||||
|
[NUnit.Framework.DescriptionAttribute("Dashboard")]
|
||||||
|
public virtual void Dashboard()
|
||||||
|
{
|
||||||
|
TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Dashboard", ((string[])(null)));
|
||||||
|
#line 6
|
||||||
|
this.ScenarioSetup(scenarioInfo);
|
||||||
|
#line 7
|
||||||
|
testRunner.Given("I am logged in");
|
||||||
|
#line 8
|
||||||
|
testRunner.When("I go to \"/admin\" 40 times");
|
||||||
|
#line hidden
|
||||||
|
testRunner.CollectScenarioErrors();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
5
src/Orchard.Profile/_environment.cmd
Normal file
5
src/Orchard.Profile/_environment.cmd
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
CScript //H:CScript
|
||||||
|
|
||||||
|
set wcatfiles=%programfiles%\wcat
|
||||||
|
if not "%programfiles(x86)%"=="" set wcatfiles=%programfiles(x86)%\wcat
|
||||||
|
if not exist "%wcatfiles%" set wcatfiles="%~dp0\..\..\lib\wcat"
|
6
src/Orchard.Profile/profiling-setup-commands.txt
Normal file
6
src/Orchard.Profile/profiling-setup-commands.txt
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
help commands
|
||||||
|
setup /SiteName:Profiling /AdminUsername:admin /AdminPassword:profiling-secret /DatabaseProvider:SQLite /EnabledFeatures:Orchard.Framework,Common,Dashboard,Feeds,HomePage,Navigation,Scheduling,Settings,XmlRpc,Orchard.Users,Orchard.Roles,TinyMce,Orchard.Modules,Orchard.Themes,Orchard.MultiTenancy,Orchard.Pages,Orchard.Blogs,Orchard.Comments,Futures.Widgets,Orchard.Media,Orchard.Tags,Orchard.DevTools
|
||||||
|
help commands
|
||||||
|
tenant list
|
||||||
|
feature list
|
||||||
|
add profiling data
|
1786
src/Orchard.Profile/report.xsl
Normal file
1786
src/Orchard.Profile/report.xsl
Normal file
File diff suppressed because it is too large
Load Diff
104
src/Orchard.Profile/settings.txt
Normal file
104
src/Orchard.Profile/settings.txt
Normal file
@ -0,0 +1,104 @@
|
|||||||
|
settings
|
||||||
|
{
|
||||||
|
//--------------------------------------------------------------------------
|
||||||
|
// General controller settings
|
||||||
|
//
|
||||||
|
// clientfile - specifies the client file, relative to working dir
|
||||||
|
// server - host name of the webserver
|
||||||
|
// virtualclients - number of 'threads' per physical client
|
||||||
|
// clients - number of physical webcat client machines
|
||||||
|
//
|
||||||
|
//--------------------------------------------------------------------------
|
||||||
|
// Example:
|
||||||
|
//
|
||||||
|
// clientfile = "ubr\lcw2.light.ubr";
|
||||||
|
// server = "webserver";
|
||||||
|
// clients = 10;
|
||||||
|
// virtualclients = 100;
|
||||||
|
//
|
||||||
|
//--------------------------------------------------------------------------
|
||||||
|
|
||||||
|
virtualclients = 1;
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------
|
||||||
|
// Performance counters (pass '-x' option to wcctl.exe to enable)
|
||||||
|
//
|
||||||
|
// interval - polling interval in seconds (default=10)
|
||||||
|
// host - host name of machine to monitor (default=webserver)
|
||||||
|
// counter - path of counter to monitor
|
||||||
|
//
|
||||||
|
//--------------------------------------------------------------------------
|
||||||
|
// Optional:
|
||||||
|
//
|
||||||
|
// Additional machines can be monitored by adding more counters blocks.
|
||||||
|
//
|
||||||
|
// Example:
|
||||||
|
//
|
||||||
|
// counters {
|
||||||
|
// host = "sqlserver"; // name of remote machine
|
||||||
|
// interval = 5;
|
||||||
|
// counter = "...";
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
//--------------------------------------------------------------------------
|
||||||
|
|
||||||
|
counters
|
||||||
|
{
|
||||||
|
interval = 10;
|
||||||
|
|
||||||
|
counter = "Processor(_Total)\\% Processor Time";
|
||||||
|
counter = "Processor(_Total)\\% Privileged Time";
|
||||||
|
counter = "Processor(_Total)\\% User Time";
|
||||||
|
counter = "Processor(_Total)\\Interrupts/sec";
|
||||||
|
|
||||||
|
counter = "Memory\\Available KBytes";
|
||||||
|
|
||||||
|
counter = "Process(w3wp)\\Working Set";
|
||||||
|
|
||||||
|
counter = "System\\Context Switches/sec";
|
||||||
|
counter = "System\\System Calls/sec";
|
||||||
|
|
||||||
|
counter = "Web Service(_Total)\\Bytes Received/sec" ;
|
||||||
|
counter = "Web Service(_Total)\\Bytes Sent/sec" ;
|
||||||
|
counter = "Web Service(_Total)\\Connection Attempts/sec" ;
|
||||||
|
counter = "Web Service(_Total)\\Get Requests/sec" ;
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------
|
||||||
|
// Registry Key Monitors (pass '-x' option to wcctl.exe to enable)
|
||||||
|
//
|
||||||
|
// path - registry path, relative to HKLM
|
||||||
|
// name - name of registry key
|
||||||
|
// type - type of value (REG_SZ | REG_DWORD)
|
||||||
|
//
|
||||||
|
//--------------------------------------------------------------------------
|
||||||
|
// Optional:
|
||||||
|
//
|
||||||
|
// Additional registry keys can be monitored on the web server by
|
||||||
|
// adding more registry blocks to this file. Note that simple strings and
|
||||||
|
// dwords are all that webcat currently supports.
|
||||||
|
//
|
||||||
|
// Example:
|
||||||
|
//
|
||||||
|
// registry {
|
||||||
|
// path = "System\\CurrentControlSet\\Services\\Tcpip\\Parameters";
|
||||||
|
// name = "DhcpDomain";
|
||||||
|
// type = REG_SZ;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
//--------------------------------------------------------------------------
|
||||||
|
|
||||||
|
registry
|
||||||
|
{
|
||||||
|
path = "System\\CurrentControlSet\\Control\\FileSystem";
|
||||||
|
name = "NtfsDisableLastAccessUpdate";
|
||||||
|
type = REG_DWORD;
|
||||||
|
}
|
||||||
|
|
||||||
|
registry
|
||||||
|
{
|
||||||
|
path = "System\\CurrentControlSet\\Services\\Tcpip\\Parameters";
|
||||||
|
name = "SynAttackProtect";
|
||||||
|
type = REG_DWORD;
|
||||||
|
}
|
||||||
|
}
|
@ -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>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="AdminMenu.cs" />
|
<Compile Include="AdminMenu.cs" />
|
||||||
|
<Compile Include="Commands\ProfilingCommands.cs" />
|
||||||
<Compile Include="Controllers\ContentController.cs" />
|
<Compile Include="Controllers\ContentController.cs" />
|
||||||
<Compile Include="Controllers\HomeController.cs" />
|
<Compile Include="Controllers\HomeController.cs" />
|
||||||
<Compile Include="Handlers\DebugLinkHandler.cs" />
|
<Compile Include="Handlers\DebugLinkHandler.cs" />
|
||||||
@ -78,9 +79,9 @@
|
|||||||
<Compile Include="ViewModels\ContentDetailsViewModel.cs" />
|
<Compile Include="ViewModels\ContentDetailsViewModel.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Content Include="Module.txt" />
|
||||||
<Content Include="Views\Home\_RenderableAction.ascx" />
|
<Content Include="Views\Home\_RenderableAction.ascx" />
|
||||||
<Content Include="Views\Home\Simple.aspx" />
|
<Content Include="Views\Home\Simple.aspx" />
|
||||||
<Content Include="_Module.txt" />
|
|
||||||
<Content Include="Views\Content\Details.aspx" />
|
<Content Include="Views\Content\Details.aspx" />
|
||||||
<Content Include="Views\Content\Index.aspx" />
|
<Content Include="Views\Content\Index.aspx" />
|
||||||
<Content Include="Views\Home\Index.aspx" />
|
<Content Include="Views\Home\Index.aspx" />
|
||||||
@ -94,6 +95,10 @@
|
|||||||
<Project>{2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6}</Project>
|
<Project>{2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6}</Project>
|
||||||
<Name>Orchard.Framework</Name>
|
<Name>Orchard.Framework</Name>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
|
<ProjectReference Include="..\..\Core\Orchard.Core.csproj">
|
||||||
|
<Project>{9916839C-39FC-4CEB-A5AF-89CA7E87119F}</Project>
|
||||||
|
<Name>Orchard.Core</Name>
|
||||||
|
</ProjectReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||||
<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v9.0\WebApplications\Microsoft.WebApplication.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
|
@ -61,6 +61,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Themes", "Orchard.W
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Modules", "Orchard.Web\Modules\Orchard.Modules\Orchard.Modules.csproj", "{17F86780-9A1F-4AA1-86F1-875EEC2730C7}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Modules", "Orchard.Web\Modules\Orchard.Modules\Orchard.Modules.csproj", "{17F86780-9A1F-4AA1-86F1-875EEC2730C7}"
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Profile", "Orchard.Profile\Orchard.Profile.csproj", "{94E694A2-D140-468D-A277-C5FCE1D13E9B}"
|
||||||
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
@ -171,6 +173,10 @@ Global
|
|||||||
{17F86780-9A1F-4AA1-86F1-875EEC2730C7}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{17F86780-9A1F-4AA1-86F1-875EEC2730C7}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{17F86780-9A1F-4AA1-86F1-875EEC2730C7}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{17F86780-9A1F-4AA1-86F1-875EEC2730C7}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{17F86780-9A1F-4AA1-86F1-875EEC2730C7}.Release|Any CPU.Build.0 = Release|Any CPU
|
{17F86780-9A1F-4AA1-86F1-875EEC2730C7}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{94E694A2-D140-468D-A277-C5FCE1D13E9B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{94E694A2-D140-468D-A277-C5FCE1D13E9B}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{94E694A2-D140-468D-A277-C5FCE1D13E9B}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{94E694A2-D140-468D-A277-C5FCE1D13E9B}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
@ -181,6 +187,7 @@ Global
|
|||||||
{2FC1D9C8-446D-4414-B252-5E9FBE61EB63} = {74E681ED-FECC-4034-B9BD-01B0BB1BDECA}
|
{2FC1D9C8-446D-4414-B252-5E9FBE61EB63} = {74E681ED-FECC-4034-B9BD-01B0BB1BDECA}
|
||||||
{ABC826D4-2FA1-4F2F-87DE-E6095F653810} = {74E681ED-FECC-4034-B9BD-01B0BB1BDECA}
|
{ABC826D4-2FA1-4F2F-87DE-E6095F653810} = {74E681ED-FECC-4034-B9BD-01B0BB1BDECA}
|
||||||
{7354DF37-934B-46CF-A13C-455D5F5F5413} = {74E681ED-FECC-4034-B9BD-01B0BB1BDECA}
|
{7354DF37-934B-46CF-A13C-455D5F5F5413} = {74E681ED-FECC-4034-B9BD-01B0BB1BDECA}
|
||||||
|
{94E694A2-D140-468D-A277-C5FCE1D13E9B} = {74E681ED-FECC-4034-B9BD-01B0BB1BDECA}
|
||||||
{954CA994-D204-468B-9D69-51F6AD3E1C29} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5}
|
{954CA994-D204-468B-9D69-51F6AD3E1C29} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5}
|
||||||
{D9A7B330-CD22-4DA1-A95A-8DE1982AD8EB} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5}
|
{D9A7B330-CD22-4DA1-A95A-8DE1982AD8EB} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5}
|
||||||
{79AED36E-ABD0-4747-93D3-8722B042454B} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5}
|
{79AED36E-ABD0-4747-93D3-8722B042454B} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5}
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
<DefineConstants>TRACE</DefineConstants>
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
|
<PlatformTarget>x86</PlatformTarget>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
|
Loading…
Reference in New Issue
Block a user