浏览代码

Merge pull request #1058 from aboch/hdbg

Log time taken to set sandbox key
Jana Radhakrishnan 9 年之前
父节点
当前提交
9ca3964233
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      libnetwork/sandbox.go

+ 6 - 0
libnetwork/sandbox.go

@@ -7,6 +7,7 @@ import (
 	"net"
 	"strings"
 	"sync"
+	"time"
 
 	log "github.com/Sirupsen/logrus"
 	"github.com/docker/libnetwork/etchosts"
@@ -536,6 +537,11 @@ func (sb *sandbox) resolveName(req string, networkName string, epList []*endpoin
 }
 
 func (sb *sandbox) SetKey(basePath string) error {
+	start := time.Now()
+	defer func() {
+		log.Debugf("sandbox set key processing took %s for container %s", time.Now().Sub(start), sb.ContainerID())
+	}()
+
 	if basePath == "" {
 		return types.BadRequestErrorf("invalid sandbox key")
 	}