[ARVADOS] updated: 6100a423c0a75736238747224d72afb112793fdb

git at public.curoverse.com git at public.curoverse.com
Tue Feb 17 16:32:12 EST 2015


Summary of changes:
 sdk/go/logger/logger.go                       | 15 ++++++++-------
 services/datamanager/datamanager.go           |  2 +-
 services/datamanager/keep/keep.go             | 26 +++++++++++++++-----------
 services/datamanager/loggerutil/loggerutil.go |  4 ++--
 4 files changed, 26 insertions(+), 21 deletions(-)

       via  6100a423c0a75736238747224d72afb112793fdb (commit)
      from  f3250432a47c835f4c594348b0d4904a247c3365 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 6100a423c0a75736238747224d72afb112793fdb
Author: mishaz <misha at curoverse.com>
Date:   Tue Feb 17 19:06:29 2015 +0000

    More changes in response to Peter's review.
    
    Started referencing keep servers by uuid.
    Moved more logger init code into constructor call.
    Switched logged timestamp label from time_* to *_at.

diff --git a/sdk/go/logger/logger.go b/sdk/go/logger/logger.go
index e7bc8d1..361e34f 100644
--- a/sdk/go/logger/logger.go
+++ b/sdk/go/logger/logger.go
@@ -77,16 +77,17 @@ func NewLogger(params LoggerParams) *Logger {
 		log.Fatal("Empty event type prefix in LoggerParams passed in to NewLogger()")
 	}
 
-	l := &Logger{data: make(map[string]interface{}),
-		params: params}
-	l.entry = make(map[string]interface{})
+	l := &Logger{
+		data: make(map[string]interface{}),
+		entry: make(map[string]interface{}),
+		properties: make(map[string]interface{}),
+		params: params,
+		workToDo: make(chan LogMutator, 10),
+		writeTicker: time.NewTicker(params.WriteInterval)}
+
 	l.data["log"] = l.entry
-	l.properties = make(map[string]interface{})
 	l.entry["properties"] = l.properties
 
-	l.workToDo = make(chan LogMutator, 10)
-	l.writeTicker = time.NewTicker(params.WriteInterval)
-
 	// Start the worker goroutine.
 	go l.work()
 
diff --git a/services/datamanager/datamanager.go b/services/datamanager/datamanager.go
index 2c5c36d..5b45153 100644
--- a/services/datamanager/datamanager.go
+++ b/services/datamanager/datamanager.go
@@ -77,7 +77,7 @@ func main() {
 	// not wait for the timer before exiting.
 	if arvLogger != nil {
 		arvLogger.FinalUpdate(func(p map[string]interface{}, e map[string]interface{}) {
-			p["run_info"].(map[string]interface{})["time_finished"] = time.Now()
+			p["run_info"].(map[string]interface{})["finished_at"] = time.Now()
 		})
 	}
 }
diff --git a/services/datamanager/keep/keep.go b/services/datamanager/keep/keep.go
index dcd6c49..93246bc 100644
--- a/services/datamanager/keep/keep.go
+++ b/services/datamanager/keep/keep.go
@@ -24,6 +24,7 @@ import (
 type ServerAddress struct {
 	Host string `json:"service_host"`
 	Port int    `json:"service_port"`
+	Uuid string `json:"uuid"`
 }
 
 // Info about a particular block returned by the server
@@ -84,6 +85,7 @@ func init() {
 		"File with the API token we should use to contact keep servers.")
 }
 
+// TODO(misha): Change this to include the UUID as well.
 func (s ServerAddress) String() string {
 	return fmt.Sprintf("%s:%d", s.Host, s.Port)
 }
@@ -239,9 +241,11 @@ func GetServerStatus(arvLogger *logger.Logger,
 		arvLogger.Update(func(p map[string]interface{}, e map[string]interface{}) {
 			keepInfo := p["keep_info"].(map[string]interface{})
 			serverInfo := make(map[string]interface{})
-			serverInfo["time_status_request_sent"] = now
+			serverInfo["status_request_sent_at"] = now
+			serverInfo["host"] = keepServer.Host
+			serverInfo["port"] = keepServer.Port
 
-			keepInfo[keepServer.String()] = serverInfo
+			keepInfo[keepServer.Uuid] = serverInfo
 		})
 	}
 
@@ -269,8 +273,8 @@ func GetServerStatus(arvLogger *logger.Logger,
 		now := time.Now()
 		arvLogger.Update(func(p map[string]interface{}, e map[string]interface{}) {
 			keepInfo := p["keep_info"].(map[string]interface{})
-			serverInfo := keepInfo[keepServer.String()].(map[string]interface{})
-			serverInfo["time_status_response_processed"] = now
+			serverInfo := keepInfo[keepServer.Uuid].(map[string]interface{})
+			serverInfo["status_response_processed_at"] = now
 			serverInfo["status"] = keepStatus
 		})
 	}
@@ -285,8 +289,8 @@ func CreateIndexRequest(arvLogger *logger.Logger,
 		now := time.Now()
 		arvLogger.Update(func(p map[string]interface{}, e map[string]interface{}) {
 			keepInfo := p["keep_info"].(map[string]interface{})
-			serverInfo := keepInfo[keepServer.String()].(map[string]interface{})
-			serverInfo["time_index_request_sent"] = now
+			serverInfo := keepInfo[keepServer.Uuid].(map[string]interface{})
+			serverInfo["index_request_sent_at"] = now
 		})
 	}
 
@@ -316,8 +320,8 @@ func ReadServerResponse(arvLogger *logger.Logger,
 		now := time.Now()
 		arvLogger.Update(func(p map[string]interface{}, e map[string]interface{}) {
 			keepInfo := p["keep_info"].(map[string]interface{})
-			serverInfo := keepInfo[keepServer.String()].(map[string]interface{})
-			serverInfo["time_index_response_received"] = now
+			serverInfo := keepInfo[keepServer.Uuid].(map[string]interface{})
+			serverInfo["index_response_received_at"] = now
 		})
 	}
 
@@ -352,7 +356,7 @@ func ReadServerResponse(arvLogger *logger.Logger,
 				if arvLogger != nil {
 					arvLogger.Update(func(p map[string]interface{}, e map[string]interface{}) {
 						keepInfo := p["keep_info"].(map[string]interface{})
-						serverInfo := keepInfo[keepServer.String()].(map[string]interface{})
+						serverInfo := keepInfo[keepServer.Uuid].(map[string]interface{})
 						var error_list []string
 						read_error_list, has_list := serverInfo["error_list"]
 						if has_list {
@@ -390,9 +394,9 @@ func ReadServerResponse(arvLogger *logger.Logger,
 			now := time.Now()
 			arvLogger.Update(func(p map[string]interface{}, e map[string]interface{}) {
 				keepInfo := p["keep_info"].(map[string]interface{})
-				serverInfo := keepInfo[keepServer.String()].(map[string]interface{})
+				serverInfo := keepInfo[keepServer.Uuid].(map[string]interface{})
 
-				serverInfo["time_processing_finished"] = now
+				serverInfo["processing_finished_at"] = now
 				serverInfo["lines_received"] = numLines
 				serverInfo["duplicates_seen"] = numDuplicates
 				serverInfo["size_disagreements_seen"] = numSizeDisagreements
diff --git a/services/datamanager/loggerutil/loggerutil.go b/services/datamanager/loggerutil/loggerutil.go
index 1514922..58abb11 100644
--- a/services/datamanager/loggerutil/loggerutil.go
+++ b/services/datamanager/loggerutil/loggerutil.go
@@ -17,7 +17,7 @@ func LogRunInfo(arvLogger *logger.Logger) {
 		now := time.Now()
 		arvLogger.Update(func(p map[string]interface{}, e map[string]interface{}) {
 			runInfo := make(map[string]interface{})
-			runInfo["time_started"] = now
+			runInfo["started_at"] = now
 			runInfo["args"] = os.Args
 			hostname, err := os.Hostname()
 			if err != nil {
@@ -45,7 +45,7 @@ func FatalWithMessage(arvLogger *logger.Logger, message string) {
 	if arvLogger != nil {
 		arvLogger.FinalUpdate(func(p map[string]interface{}, e map[string]interface{}) {
 			p["FATAL"] = message
-			p["run_info"].(map[string]interface{})["time_finished"] = time.Now()
+			p["run_info"].(map[string]interface{})["finished_at"] = time.Now()
 		})
 	}
 

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list