Discover Packages
gitee.com/danteprince/conductorTemplate
command
module
Version:
v0.2.16
Opens a new window with list of versions in this module.
Published: Sep 14, 2022
License: MulanPSL-2.0
Opens a new window with license information.
Imports: 13
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
README
¶
Conductor Template
使用注意事项
使用前,需要在使用环境进行export GO_ENV=dev/prod/test 进行开发/生产/测试环境的选择以使用不同的config
自定义了可出错重连的httpClient,使用时需设置重传次数,可选择重传退避策略(包括无间断重传、固定间隔重传和指数间隔重传)
增加了服务端 prometheus监控,可进行请求qps、运行时间及成功率等查询,通过/metircs查询,metrics格式为 (service_http_request_count_total{endpoint="/merge",method="POST",status="200"})
增加了worker端prometheus监控,可进行task执行时间、执行次数等查询
由于conductor-go自带prometheus的metrics无法满足需求,需进行手动新增metircs: task_execute{taskType=xxx}用于记录task实际执行次数
github.com/conductor-sdk/conductor-go/sdk/metrics/counter.go中
var counterTemplates = map[MetricName]*MetricDetails{ 中添加
TASK_EXECUTE: NewMetricDetails(
TASK_EXECUTE,
TASK_EXECUTE_DOC,
[]MetricLabel{
TASK_TYPE,
},
),
并在下方新增函数
func IncrementTaskExecute(taskType string) {
incrementCounter(
TASK_EXECUTE,
[]string{
taskType,
},
)
}
github.com/conductor-sdk/conductor-go/sdk/metrics/name.go中const添加
TASK_EXECUTE MetricName = "task_execute"
github.com/conductor-sdk/conductor-go/sdk/metrics/documentation.go中const添加
TASK_EXECUTE_DOC MetricDocumentation = "Incremented each time task execute is done"
Expand ▾
Collapse ▴
Documentation
¶
There is no documentation for this package.
Source Files
¶
Directories
¶
worker
Click to show internal directories.
Click to hide internal directories.