Commit 1c3e590c authored by Forrest Weston's avatar Forrest Weston Committed by ForrestWeston

Add event logging around path resolution

License: MIT
Signed-off-by: default avatarForrest Weston <forrest@protocol.ai>
parent 846c04b1
......@@ -22,6 +22,7 @@ var ErrNoNamesys = errors.New(
// entries and returning the final node.
func Resolve(ctx context.Context, nsys namesys.NameSystem, r *path.Resolver, p path.Path) (node.Node, error) {
if strings.HasPrefix(p.String(), "/ipns/") {
defer log.EventBegin(ctx, "resolveIpnsPath").Done()
// resolve ipns paths
// TODO(cryptix): we sould be able to query the local cache for the path
......
......@@ -135,6 +135,7 @@ func (s *Resolver) ResolvePathComponents(ctx context.Context, fpath Path) ([]nod
if err != nil {
return nil, err
}
defer log.EventBegin(ctx, "resolvePathComponents", logging.LoggableMap{"parts": parts, "cid": h}).Done()
log.Debug("resolve dag get")
nd, err := s.DAG.Get(ctx, h)
......@@ -154,6 +155,7 @@ func (s *Resolver) ResolvePathComponents(ctx context.Context, fpath Path) ([]nod
// would retrieve "baz" in ("bar" in ("foo" in nd.Links).Links).Links
func (s *Resolver) ResolveLinks(ctx context.Context, ndd node.Node, names []string) ([]node.Node, error) {
defer log.EventBegin(ctx, "resolveLinks", logging.LoggableMap{"names": names}).Done()
result := make([]node.Node, 0, len(names)+1)
result = append(result, ndd)
nd := ndd // dup arg workaround
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment