将bwi方法添加到项目中的包
bwi的Python项目详细描述
BWI库
python客户端,用于BWI交互
使用
实例化客户端
importbwiclient=bwi.Client(api_key='xxxxxxxxxxxxxxxx',workflow='shop')
操作日志
^{pr2}$度量管理
# manipulate metricsclient.Step('validate order')# Your business-oriented code goes here# ...total_paid=220# increment the income metric for this stepbwi.metrics.inc('income',total_paid)
错误处理
# report any unknown exception to the bwi handlertry:# Your business-oriented code goes hereexceptExceptionaserr:bwi.handler.catch(err)# the error is now available for this specific step
将步骤标记为(未)成功
step=bwi.Step('process order')# Your business-oriented code goes herestep.success()# other scenario, where thing go badstep.failed()
- 项目
标签: