Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Kirill Smelkov
neo
Commits
4ba6eacf
Commit
4ba6eacf
authored
Jan 28, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
23e2d875
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
7 deletions
+20
-7
go/neo/client.go
go/neo/client.go
+2
-1
go/neo/t_tracego_test.go
go/neo/t_tracego_test.go
+18
-6
No files found.
go/neo/client.go
View file @
4ba6eacf
...
...
@@ -116,7 +116,8 @@ func (cli *Client) Run(ctx context.Context) error {
ctx
,
cancel
:=
context
.
WithCancel
(
ctx
)
cli
.
talkMasterCancel
=
cancel
// cli.node.OnShutdown = cancel // XXX ok?
return
cli
.
talkMaster
(
ctx
)
// return cli.talkMaster(ctx)
return
cli
.
node
.
talkMaster
(
ctx
)
}
// Close implements zodb.IStorageDriver.
...
...
go/neo/t_tracego_test.go
View file @
4ba6eacf
...
...
@@ -38,7 +38,8 @@ type TraceCollector struct {
pg
*
tracing
.
ProbeGroup
rx
interface
{
RxEvent
(
interface
{})
}
node2Name
map
[
*
xneo
.
NodeApp
]
string
// node2Name map[*xneo.NodeApp]string
node2Name
map
[
interface
{}]
string
// XXX -> *_MasteredNode
nodeTab2Owner
map
[
*
xneo
.
NodeTable
]
string
clusterState2Owner
map
[
*
proto
.
ClusterState
]
string
}
...
...
@@ -48,7 +49,7 @@ func NewTraceCollector(rx interface { RxEvent(interface{}) }) *TraceCollector {
pg
:
&
tracing
.
ProbeGroup
{},
rx
:
rx
,
node2Name
:
make
(
map
[
*
xneo
.
NodeApp
]
string
),
node2Name
:
make
(
map
[
interface
{}
]
string
),
nodeTab2Owner
:
make
(
map
[
*
xneo
.
NodeTable
]
string
),
clusterState2Owner
:
make
(
map
[
*
proto
.
ClusterState
]
string
),
}
...
...
@@ -77,15 +78,26 @@ func (t *TraceCollector) Detach() {
//
// This way it can translate e.g. *NodeTable -> owner node name when creating
// corresponding event.
func
(
t
*
TraceCollector
)
RegisterNode
(
node
*
xneo
.
NodeApp
,
name
string
)
{
func
(
t
*
TraceCollector
)
RegisterNode
(
node
/*XXX -> *_MasteredNode*/
interface
{}
,
name
string
)
{
tracing
.
Lock
()
defer
tracing
.
Unlock
()
// XXX verify there is no duplicate names
// XXX verify the same pointer is not registerd twice
switch
node
:=
node
.
(
type
)
{
default
:
panic
(
/*bad type*/
node
)
case
*
xneo
.
NodeApp
:
t
.
node2Name
[
node
]
=
name
t
.
nodeTab2Owner
[
node
.
NodeTab
]
=
name
t
.
clusterState2Owner
[
&
node
.
ClusterState
]
=
name
case
*
_MasteredNode
:
t
.
node2Name
[
node
]
=
name
t
.
nodeTab2Owner
[
node
.
state
.
NodeTab
]
=
name
t
.
clusterState2Owner
[
&
node
.
state
.
Code
]
=
name
}
}
func
(
t
*
TraceCollector
)
TraceNetDial
(
ev
*
xnet
.
TraceDial
)
{
...
...
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