Skip to content

Commit 5c8e135

Browse files
committed
Add event logging around path resolution
1 parent ff2a3e8 commit 5c8e135

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

core/pathresolver.go

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ var ErrNoNamesys = errors.New(
2222
// entries and returning the final node.
2323
func Resolve(ctx context.Context, nsys namesys.NameSystem, r *path.Resolver, p path.Path) (node.Node, error) {
2424
if strings.HasPrefix(p.String(), "/ipns/") {
25+
defer log.EventBegin(ctx, "resolveIpnsPath").Done()
2526
// resolve ipns paths
2627

2728
// TODO(cryptix): we sould be able to query the local cache for the path

path/resolver.go

+2
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ func (s *Resolver) ResolvePathComponents(ctx context.Context, fpath Path) ([]nod
135135
if err != nil {
136136
return nil, err
137137
}
138+
defer log.EventBegin(ctx, "resolvePathComponents", logging.LoggableMap{"parts": parts, "cid": h}).Done()
138139

139140
log.Debug("resolve dag get")
140141
nd, err := s.DAG.Get(ctx, h)
@@ -154,6 +155,7 @@ func (s *Resolver) ResolvePathComponents(ctx context.Context, fpath Path) ([]nod
154155
// would retrieve "baz" in ("bar" in ("foo" in nd.Links).Links).Links
155156
func (s *Resolver) ResolveLinks(ctx context.Context, ndd node.Node, names []string) ([]node.Node, error) {
156157

158+
defer log.EventBegin(ctx, "resolveLinks", logging.LoggableMap{"names": names}).Done()
157159
result := make([]node.Node, 0, len(names)+1)
158160
result = append(result, ndd)
159161
nd := ndd // dup arg workaround

0 commit comments

Comments
 (0)