Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
share
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄刚
share
Commits
e9f5e5de
Commit
e9f5e5de
authored
Oct 15, 2018
by
黄刚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
接口增加context参数,修改条件参数,增加一些接口
parent
8b19bca9
Pipeline
#3809
failed with stages
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
10 deletions
+34
-10
trace组件设计草稿.md
trace组件设计草稿.md
+34
-10
No files found.
trace组件设计草稿.md
View file @
e9f5e5de
# tra
ce组件工作流程
# tra
ce组件工作流程
...
@@ -43,18 +43,42 @@ const (
...
@@ -43,18 +43,42 @@ const (
#### Task Server
#### Task Server
```
go
```
go
CreateTask
(
taskId
string
,
ty
TaskType
,
taskName
string
,
nodeList
[]
string
,
ctx
...
interface
{})
error
type
ReplyTraceList
struct
{
StartTask
(
taskId
string
)
error
Partion
int64
StopTask
(
taskId
string
)
error
Index
int64
DeleteTask
(
taskId
string
)
error
Node
string
QueryTaskStatus
(
taskId
string
)
TaskStatus
TraceList
[]
*
TraceInfo
}
//创建任务
func
CreateTask
(
ctx
context
.
Context
,
taskId
string
,
ty
TaskType
,
taskName
string
,
nodeList
[]
string
,
ctx
...
interface
{})
error
//开始任务
func
StartTask
(
ctx
context
.
Context
,
taskId
string
)
error
//停止任务
func
StopTask
(
ctx
context
.
Context
,
taskId
string
)
error
//删除任务
func
DeleteTask
(
ctx
context
.
Context
,
taskId
string
)
error
//查询任务状态
func
QueryTaskStatus
(
ctx
context
.
Context
,
taskId
string
)
TaskStatus
//查询任务列表,返回任务id及对应状态
func
QueryTaskList
(
ctx
context
.
Context
)
map
[
string
]
TaskStatus
//查询跟踪信息
func
QueryTraceList
(
ctx
context
.
Context
,
taskId
string
)
*
ReplyTraceList
```
```
#### Trace Plugin
#### Trace Plugin
```
go
```
go
StartTask
(
ctx
...
interface
{})
type
TraceTask
struct
{
StopTask
(
ctx
...
interface
{})
hashMap
map
[
int64
]
string
}
//开始任务
func
StartTask
(
ctx
context
.
Context
,
taskId
string
,
condition
map
[
string
]
string
)
error
//停止任务
func
StopTask
(
ctx
context
.
Context
,
taskId
string
,
condition
map
[
string
]
string
)
error
//删除任务
func
DeleteTask
(
ctx
context
.
Context
,
taskId
string
)
error
//查询任务,返回该任务对应的字典
func
QueryTask
(
ctx
context
.
Context
,
taskId
string
)
TraceTask
```
```
参数为过滤条件,比如只需要某个交易hash的信息,参数就可以是("Txhash",“xxxxxxxxx”);或者只要打印mempool模块的信息,参数就可以是(“module”,“mempool”);两个条件同时满足("Txhash",“xxxxxxxxx”,“module”,“mempool”);多个交易hash?多个模块?更复杂的条件还没有想好怎么表达和处理。
map参数为过滤条件,比如只需要某个交易hash的信息,参数就可以是("Txhash",“xxxxxxxxx”);或者只要打印mempool模块的信息,参数就可以是(“module”,“mempool”);两个条件同时满足("Txhash",“xxxxxxxxx”,“module”,“mempool”);目前一个任务的条件是"与"的关系,如果要创建"或"关系的条件,需要创建新任务。
\ No newline at end of file
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment