-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from vrobert78/counters
Counters & Pauses in the reference scenario
- Loading branch information
Showing
9 changed files
with
258 additions
and
125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,28 @@ | ||
import { productChangePrice, fetchBearerToken, productImport, productChangeStocks, useCredentials } from "./helpers/api.js"; | ||
import { Counter } from 'k6/metrics'; | ||
import { Trend } from 'k6/metrics'; | ||
|
||
let fetchBearerTokenRT = new Trend('response_time_fetchBearerToken'); | ||
let fetchBearerTokenCounter = new Counter('counter_fetchBearerToken'); | ||
|
||
let APIProductImportRT = new Trend('response_time_API_ProductImport'); | ||
let APIproductChangePrice = new Trend('response_time_API_productChangePrice'); | ||
let APIproductChangeStocks = new Trend('response_time_API_productChangeStocks'); | ||
let APIProductImportCounter = new Counter('counter_API_ProductImport'); | ||
|
||
let APIproductChangePriceRT = new Trend('response_time_API_productChangePrice'); | ||
let APIproductChangePriceCounter = new Counter('counter_API_productChangePrice'); | ||
|
||
let APIproductChangeStocksRT = new Trend('response_time_API_productChangeStocks'); | ||
let APIproductChangeStocksCounter = new Counter('counter_API_productChangeStocks'); | ||
|
||
export function setup() { | ||
const token = fetchBearerToken(fetchBearerTokenRT); | ||
const token = fetchBearerToken(fetchBearerTokenRT, fetchBearerTokenCounter); | ||
|
||
return { token }; | ||
} | ||
|
||
export default (data) => { | ||
useCredentials(data.token); | ||
productImport(APIProductImportRT, 20); | ||
productChangePrice(APIproductChangePrice, 20); | ||
productChangeStocks(APIproductChangeStocks, 20); | ||
productImport(APIProductImportRT, APIProductImportCounter, 20); | ||
productChangePrice(APIproductChangePriceRT, APIproductChangePriceCounter, 20); | ||
productChangeStocks(APIproductChangeStocksRT, APIproductChangeStocksCounter, 20); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.