You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@servicecomb.apache.org by GitBox <gi...@apache.org> on 2018/01/09 11:11:25 UTC

[GitHub] little-cui closed pull request #246: SCB-155 Optimize metric.go

little-cui closed pull request #246: SCB-155 Optimize metric.go
URL: https://github.com/apache/incubator-servicecomb-service-center/pull/246
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/pkg/etcdsync/mutex.go b/pkg/etcdsync/mutex.go
index 0ef019f6..96adcf8d 100644
--- a/pkg/etcdsync/mutex.go
+++ b/pkg/etcdsync/mutex.go
@@ -163,7 +163,7 @@ func (m *DLock) Lock(wait bool) error {
 					func(message string, evt *registry.PluginResponse) error {
 						if evt != nil && evt.Action == registry.Delete {
 							// break this for-loop, and try to create the node again.
-							return fmt.Errorf("Lock released, id=%s", m.id)
+							return fmt.Errorf("Lock released")
 						}
 						return nil
 					}))
diff --git a/server/rest/metric.go b/server/rest/metric.go
index 350aed81..56423822 100644
--- a/server/rest/metric.go
+++ b/server/rest/metric.go
@@ -62,7 +62,7 @@ func init() {
 
 func ReportRequestCompleted(w http.ResponseWriter, r *http.Request, start time.Time) {
 	instance := fmt.Sprint(core.Instance.Endpoints)
-	elapsed := float64(time.Since(start).Nanoseconds()) / 1000
+	elapsed := float64(time.Since(start).Nanoseconds()) / float64(time.Microsecond)
 	route, _ := r.Context().Value(rest.CTX_MATCH_PATTERN).(string)
 
 	if strings.Index(r.Method, "WATCH") != 0 {


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services