Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neoppod
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Levin Zimmermann
neoppod
Commits
4ba6eacf
Commit
4ba6eacf
authored
4 years ago
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
23e2d875
Changes
2
Hide 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 {
...
@@ -116,7 +116,8 @@ func (cli *Client) Run(ctx context.Context) error {
ctx
,
cancel
:=
context
.
WithCancel
(
ctx
)
ctx
,
cancel
:=
context
.
WithCancel
(
ctx
)
cli
.
talkMasterCancel
=
cancel
cli
.
talkMasterCancel
=
cancel
// cli.node.OnShutdown = cancel // XXX ok?
// cli.node.OnShutdown = cancel // XXX ok?
return
cli
.
talkMaster
(
ctx
)
// return cli.talkMaster(ctx)
return
cli
.
node
.
talkMaster
(
ctx
)
}
}
// Close implements zodb.IStorageDriver.
// Close implements zodb.IStorageDriver.
...
...
This diff is collapsed.
Click to expand it.
go/neo/t_tracego_test.go
View file @
4ba6eacf
...
@@ -38,7 +38,8 @@ type TraceCollector struct {
...
@@ -38,7 +38,8 @@ type TraceCollector struct {
pg
*
tracing
.
ProbeGroup
pg
*
tracing
.
ProbeGroup
rx
interface
{
RxEvent
(
interface
{})
}
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
nodeTab2Owner
map
[
*
xneo
.
NodeTable
]
string
clusterState2Owner
map
[
*
proto
.
ClusterState
]
string
clusterState2Owner
map
[
*
proto
.
ClusterState
]
string
}
}
...
@@ -48,7 +49,7 @@ func NewTraceCollector(rx interface { RxEvent(interface{}) }) *TraceCollector {
...
@@ -48,7 +49,7 @@ func NewTraceCollector(rx interface { RxEvent(interface{}) }) *TraceCollector {
pg
:
&
tracing
.
ProbeGroup
{},
pg
:
&
tracing
.
ProbeGroup
{},
rx
:
rx
,
rx
:
rx
,
node2Name
:
make
(
map
[
*
xneo
.
NodeApp
]
string
),
node2Name
:
make
(
map
[
interface
{}
]
string
),
nodeTab2Owner
:
make
(
map
[
*
xneo
.
NodeTable
]
string
),
nodeTab2Owner
:
make
(
map
[
*
xneo
.
NodeTable
]
string
),
clusterState2Owner
:
make
(
map
[
*
proto
.
ClusterState
]
string
),
clusterState2Owner
:
make
(
map
[
*
proto
.
ClusterState
]
string
),
}
}
...
@@ -77,15 +78,26 @@ func (t *TraceCollector) Detach() {
...
@@ -77,15 +78,26 @@ func (t *TraceCollector) Detach() {
//
//
// This way it can translate e.g. *NodeTable -> owner node name when creating
// This way it can translate e.g. *NodeTable -> owner node name when creating
// corresponding event.
// corresponding event.
func
(
t
*
TraceCollector
)
RegisterNode
(
node
*
xneo
.
NodeApp
,
name
string
)
{
func
(
t
*
TraceCollector
)
RegisterNode
(
node
/*XXX -> *_MasteredNode*/
interface
{}
,
name
string
)
{
tracing
.
Lock
()
tracing
.
Lock
()
defer
tracing
.
Unlock
()
defer
tracing
.
Unlock
()
// XXX verify there is no duplicate names
// XXX verify there is no duplicate names
// XXX verify the same pointer is not registerd twice
// XXX verify the same pointer is not registerd twice
t
.
node2Name
[
node
]
=
name
switch
node
:=
node
.
(
type
)
{
t
.
nodeTab2Owner
[
node
.
NodeTab
]
=
name
default
:
t
.
clusterState2Owner
[
&
node
.
ClusterState
]
=
name
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
)
{
func
(
t
*
TraceCollector
)
TraceNetDial
(
ev
*
xnet
.
TraceDial
)
{
...
...
This diff is collapsed.
Click to expand it.
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