From a2d38af8e575dd826cc892608ca0b2d82fbb8fbb Mon Sep 17 00:00:00 2001 From: Calvin Date: Wed, 24 Jul 2013 01:14:43 +0800 Subject: [PATCH] =?UTF-8?q?#238=20=E4=BD=BF=E7=94=A8JMeter=E5=AF=B9Showcas?= =?UTF-8?q?e=E8=BF=9B=E8=A1=8C=E6=80=A7=E8=83=BD=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=EF=BC=8C=E5=AE=8C=E6=88=90Restful=E9=83=A8=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 + examples/showcase/bin/jetty-large.bat | 11 ++ support/jmeter/Result.txt | 4 + support/jmeter/showcase-jaxrs.jmx | 143 +++++++++++++++++++++++ support/jmeter/showcase-rest-shiro.jmx | 153 +++++++++++++++++++++++++ support/jmeter/showcase-rest-xml.jmx | 143 +++++++++++++++++++++++ support/jmeter/showcase-rest.jmx | 36 +++++- 7 files changed, 490 insertions(+), 2 deletions(-) create mode 100644 examples/showcase/bin/jetty-large.bat create mode 100644 support/jmeter/Result.txt create mode 100644 support/jmeter/showcase-jaxrs.jmx create mode 100644 support/jmeter/showcase-rest-shiro.jmx create mode 100644 support/jmeter/showcase-rest-xml.jmx diff --git a/.gitignore b/.gitignore index e15bb0f20..e4a10566a 100644 --- a/.gitignore +++ b/.gitignore @@ -12,4 +12,6 @@ target/ logs/ /examples/showcase/bin/yuicompressor-2.4.*.jar +/support/jmeter/*.jtl +/support/jmeter/*.log /support/local-script/ diff --git a/examples/showcase/bin/jetty-large.bat b/examples/showcase/bin/jetty-large.bat new file mode 100644 index 000000000..2cce9d8c1 --- /dev/null +++ b/examples/showcase/bin/jetty-large.bat @@ -0,0 +1,11 @@ +@echo off +echo [INFO] Use maven jetty-plugin run the project. + +cd %~dp0 +cd .. + +set MAVEN_OPTS=%MAVEN_OPTS% -XX:MaxPermSize=128m -Xms1024m -Xmx1024m -XX:NewSize=512m -XX:MaxNewSize=512m +call mvn jetty:run -Djetty.port=8080 + +cd bin +pause \ No newline at end of file diff --git a/support/jmeter/Result.txt b/support/jmeter/Result.txt new file mode 100644 index 000000000..d91de49c0 --- /dev/null +++ b/support/jmeter/Result.txt @@ -0,0 +1,4 @@ +showcase-rest: 3038 TPS +showcase-rest-xml: 3006 TPS +showcase-rest-shiro:1344 TPS +showcase-jaxrs: 2609 TPS \ No newline at end of file diff --git a/support/jmeter/showcase-jaxrs.jmx b/support/jmeter/showcase-jaxrs.jmx new file mode 100644 index 000000000..146bbe186 --- /dev/null +++ b/support/jmeter/showcase-jaxrs.jmx @@ -0,0 +1,143 @@ + + + + + 测试CXF JAXRS Restful Service,返回JSON格式数据 + false + false + + + + + + + + continue + + false + 2000 + + 50 + 1 + 1374592894000 + 1374592894000 + false + + + + + + + + + localhost + 8080 + + + + + + HttpClient4 + 4 + + + + + + + + + + + + + /showcase/cxf/jaxrs/user/1.json + GET + true + false + true + false + false + + + + + + 200 + + Assertion.response_code + false + 8 + + + + + + + false + + saveConfig + + + true + true + true + + true + true + true + true + false + true + true + false + false + false + false + false + false + false + false + 0 + true + + + + + + + false + + saveConfig + + + true + true + true + + true + true + true + true + false + true + true + false + false + false + false + false + false + false + false + 0 + true + + + + + + + + + diff --git a/support/jmeter/showcase-rest-shiro.jmx b/support/jmeter/showcase-rest-shiro.jmx new file mode 100644 index 000000000..2d769d29e --- /dev/null +++ b/support/jmeter/showcase-rest-shiro.jmx @@ -0,0 +1,153 @@ + + + + + 测试Spring MVC Restful Service,Shiro的安全控制,返回JSON格式数据 + false + false + + + + + + + + continue + + false + 2000 + + 50 + 1 + 1374592894000 + 1374592894000 + false + + + + + + + + + localhost + 8080 + + + + + + HttpClient4 + 4 + + + + + + Authorization + Basic YWRtaW46YWRtaW4= + + + 当验证Shiro保护的Secure API时使用 + + + + + + + + + + + + + /showcase/api/secure/v1/user/1.json + GET + true + false + true + false + false + + + + + + 200 + + Assertion.response_code + false + 8 + + + + + + + false + + saveConfig + + + true + true + true + + true + true + true + true + false + true + true + false + false + false + false + false + false + false + false + 0 + true + + + + + + + false + + saveConfig + + + true + true + true + + true + true + true + true + false + true + true + false + false + false + false + false + false + false + false + 0 + true + + + + + + + + + diff --git a/support/jmeter/showcase-rest-xml.jmx b/support/jmeter/showcase-rest-xml.jmx new file mode 100644 index 000000000..81d058d14 --- /dev/null +++ b/support/jmeter/showcase-rest-xml.jmx @@ -0,0 +1,143 @@ + + + + + 测试Spring MVC Restful Service, 返回XML格式数据 + false + false + + + + + + + + continue + + false + 2000 + + 50 + 1 + 1374592894000 + 1374592894000 + false + + + + + + + + + localhost + 8080 + + + + + + HttpClient4 + 4 + + + + + + + + + + + + + /showcase/api/v1/user/1.xml + GET + true + false + true + false + false + + + + + + 200 + + Assertion.response_code + false + 8 + + + + + + + false + + saveConfig + + + true + true + true + + true + true + true + true + false + true + true + false + false + false + false + false + false + false + false + 0 + true + + + + + + + false + + saveConfig + + + true + true + true + + true + true + true + true + false + true + true + false + false + false + false + false + false + false + false + 0 + true + + + + + + + + + diff --git a/support/jmeter/showcase-rest.jmx b/support/jmeter/showcase-rest.jmx index f1baad797..17507b7fe 100644 --- a/support/jmeter/showcase-rest.jmx +++ b/support/jmeter/showcase-rest.jmx @@ -2,7 +2,7 @@ - + 测试Spring MVC Restful Service,返回JSON格式数据 false false @@ -51,7 +51,7 @@ - /showcase/api/v1/user/1.xml + /showcase/api/v1/user/1.json GET true false @@ -105,6 +105,38 @@ + + false + + saveConfig + + + true + true + true + + true + true + true + true + false + true + true + false + false + false + false + false + false + false + false + 0 + true + + + + +