diff --git a/test/AbpPerfTest/AbpPerfTest.WithAbp/AppModule.cs b/test/AbpPerfTest/AbpPerfTest.WithAbp/AppModule.cs index 1cd88989e6..3846cdd3de 100644 --- a/test/AbpPerfTest/AbpPerfTest.WithAbp/AppModule.cs +++ b/test/AbpPerfTest/AbpPerfTest.WithAbp/AppModule.cs @@ -33,7 +33,7 @@ namespace AbpPerfTest.WithAbp Configure(options => { - options.TransactionBehavior = UnitOfWorkTransactionBehavior.Disabled; + options.TransactionBehavior = UnitOfWorkTransactionBehavior.Auto; }); } diff --git a/test/AbpPerfTest/AbpPerfTest.WithAbp/Controllers/BookController.cs b/test/AbpPerfTest/AbpPerfTest.WithAbp/Controllers/BookController.cs index ed7bdb6a4d..1533e95f71 100644 --- a/test/AbpPerfTest/AbpPerfTest.WithAbp/Controllers/BookController.cs +++ b/test/AbpPerfTest/AbpPerfTest.WithAbp/Controllers/BookController.cs @@ -22,7 +22,7 @@ namespace AbpPerfTest.WithAbp.Controllers [HttpGet] public async Task> GetListAsync() { - var books = await _bookRepository.GetListAsync(); + var books = await _bookRepository.GetPagedListAsync(0, 10, "Id"); return books .Select(b => new BookDto @@ -51,7 +51,7 @@ namespace AbpPerfTest.WithAbp.Controllers } [HttpPost] - public async Task CreateAsync(CreateUpdateBookDto input) + public async Task CreateAsync([FromBody] CreateUpdateBookDto input) { var book = new Book { @@ -67,7 +67,7 @@ namespace AbpPerfTest.WithAbp.Controllers [HttpPut] [Route("{id}")] - public async Task UpdateAsync(Guid id, CreateUpdateBookDto input) + public async Task UpdateAsync(Guid id, [FromBody] CreateUpdateBookDto input) { var book = await _bookRepository.GetAsync(id); diff --git a/test/AbpPerfTest/AbpPerfTest.WithoutAbp/Controllers/BookController.cs b/test/AbpPerfTest/AbpPerfTest.WithoutAbp/Controllers/BookController.cs index c7b5746bc7..b05f86be68 100644 --- a/test/AbpPerfTest/AbpPerfTest.WithoutAbp/Controllers/BookController.cs +++ b/test/AbpPerfTest/AbpPerfTest.WithoutAbp/Controllers/BookController.cs @@ -23,7 +23,7 @@ namespace AbpPerfTest.WithoutAbp.Controllers [HttpGet] public async Task> GetListAsync() { - var books = await _bookDbContext.Books.ToListAsync(); + var books = await _bookDbContext.Books.OrderBy(x => x.Id).Take(10).ToListAsync(); return books .Select(b => new BookDto @@ -52,7 +52,7 @@ namespace AbpPerfTest.WithoutAbp.Controllers } [HttpPost] - public async Task CreateAsync(CreateUpdateBookDto input) + public async Task CreateAsync([FromBody] CreateUpdateBookDto input) { var book = new Book { @@ -69,7 +69,7 @@ namespace AbpPerfTest.WithoutAbp.Controllers [HttpPut] [Route("{id}")] - public async Task UpdateAsync(Guid id, CreateUpdateBookDto input) + public async Task UpdateAsync(Guid id, [FromBody] CreateUpdateBookDto input) { var book = await _bookDbContext.Books.SingleAsync(b => b.Id == id); diff --git a/test/AbpPerfTest/SimpleTestPlan.jmx b/test/AbpPerfTest/SimpleTestPlan.jmx new file mode 100644 index 0000000000..e532423147 --- /dev/null +++ b/test/AbpPerfTest/SimpleTestPlan.jmx @@ -0,0 +1,128 @@ + + + + + + false + true + false + + + + + + + + continue + + false + 100 + + 100 + 10 + false + + + true + + + + + + + localhost + 5001 + https + + /api/books + GET + true + false + true + false + + + + + + + true + + + + false + { + "name": "My book", + "price": "33", + "isAvailable": "true" +} + + = + + + + localhost + 5001 + https + + /api/books/ + POST + true + false + true + false + + + + + + + false + + saveConfig + + + true + true + true + + true + true + true + true + false + true + true + false + false + false + true + false + false + false + true + 0 + true + true + true + true + true + true + + + + + + + + + + Content-Type + application/json + + + + + + + diff --git a/test/AbpPerfTest/_results/get-insert-with-transaction-auto.png b/test/AbpPerfTest/_results/get-insert-with-transaction-auto.png new file mode 100644 index 0000000000..06bc2b0818 Binary files /dev/null and b/test/AbpPerfTest/_results/get-insert-with-transaction-auto.png differ diff --git a/test/AbpPerfTest/_results/get-insert-with-transaction-disabled.png b/test/AbpPerfTest/_results/get-insert-with-transaction-disabled.png new file mode 100644 index 0000000000..bebaf0b05d Binary files /dev/null and b/test/AbpPerfTest/_results/get-insert-with-transaction-disabled.png differ diff --git a/test/AbpPerfTest/_results/get-insert-with-transaction-enabled.png b/test/AbpPerfTest/_results/get-insert-with-transaction-enabled.png new file mode 100644 index 0000000000..15ac17789e Binary files /dev/null and b/test/AbpPerfTest/_results/get-insert-with-transaction-enabled.png differ