Переглянути джерело

Log time taken to set sandbox key

Signed-off-by: Alessandro Boch <aboch@docker.com>
Alessandro Boch 9 роки тому
батько
коміт
df975778fc
1 змінених файлів з 6 додано та 0 видалено
  1. 6 0
      libnetwork/sandbox.go

+ 6 - 0
libnetwork/sandbox.go

@@ -7,6 +7,7 @@ import (
 	"net"
 	"net"
 	"strings"
 	"strings"
 	"sync"
 	"sync"
+	"time"
 
 
 	log "github.com/Sirupsen/logrus"
 	log "github.com/Sirupsen/logrus"
 	"github.com/docker/libnetwork/etchosts"
 	"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 {
 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 == "" {
 	if basePath == "" {
 		return types.BadRequestErrorf("invalid sandbox key")
 		return types.BadRequestErrorf("invalid sandbox key")
 	}
 	}