Vugen 中的事务和事务实例有什么区别?
What is the difference between a transaction and a transaction instance in Vugen?
我正在使用 HP Performance Center 的虚拟用户生成器,我无法弄清楚 lr_start
/ end_transaction
和 lr_start
end_transaction_instance
之间的区别。我能找到的支持是事务用于"tracking duration",事务实例用于"performance analysis",但我似乎无法在分析结果中找到差异。
这两者之间有明显的区别吗?如果是这样,我可以看一个简短的例子吗?
LoadRunner 事务 用于测量某些语句执行之间的时间。
LoadRunner 事务实例 用于对您在脚本中声明的现有事务 进行性能分析。您将事务按名称放入一个变量中,该变量稍后可用于分析其状态:获取其当前持续时间、状态等。
示例:
long id;
int status;
int amount_overdrawn = get_amount_overdrawn(); // Call some API
while (amount_overdrawn < LIMIT) {
// Notify that a transaction is starting
lr_start_transaction("withdraw");
status = bank_withdraw(500); // Call some API
// End transaction with operation result - pass or fail
if (status == 0)
lr_end_transaction("withdraw", LR_PASS);
else
lr_end_transaction("withdraw", LR_FAIL);
amount_overdrawn = get_amount_overdrawn();
}
// Set the transaction instance into a variable
id = lr_start_transaction_instance("withdraw", 0);
status = bank_withdraw(500);
// End the transaction instance using the same variable
lr_end_transaction_instance(id, LR_PASS);
我正在使用 HP Performance Center 的虚拟用户生成器,我无法弄清楚 lr_start
/ end_transaction
和 lr_start
end_transaction_instance
之间的区别。我能找到的支持是事务用于"tracking duration",事务实例用于"performance analysis",但我似乎无法在分析结果中找到差异。
这两者之间有明显的区别吗?如果是这样,我可以看一个简短的例子吗?
LoadRunner 事务 用于测量某些语句执行之间的时间。
LoadRunner 事务实例 用于对您在脚本中声明的现有事务 进行性能分析。您将事务按名称放入一个变量中,该变量稍后可用于分析其状态:获取其当前持续时间、状态等。
示例:
long id;
int status;
int amount_overdrawn = get_amount_overdrawn(); // Call some API
while (amount_overdrawn < LIMIT) {
// Notify that a transaction is starting
lr_start_transaction("withdraw");
status = bank_withdraw(500); // Call some API
// End transaction with operation result - pass or fail
if (status == 0)
lr_end_transaction("withdraw", LR_PASS);
else
lr_end_transaction("withdraw", LR_FAIL);
amount_overdrawn = get_amount_overdrawn();
}
// Set the transaction instance into a variable
id = lr_start_transaction_instance("withdraw", 0);
status = bank_withdraw(500);
// End the transaction instance using the same variable
lr_end_transaction_instance(id, LR_PASS);