X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/a56406d730f2a07dd442b9e99ef9dab7b7d81895..5a662d84f00c0c2693c18d333bab9d0fdda7e28e:/services/datamanager/datamanager.go diff --git a/services/datamanager/datamanager.go b/services/datamanager/datamanager.go index cd141eeb16..d3efe62173 100644 --- a/services/datamanager/datamanager.go +++ b/services/datamanager/datamanager.go @@ -66,7 +66,7 @@ func singlerun() { var arvLogger *logger.Logger if logEventTypePrefix != "" { arvLogger = logger.NewLogger(logger.LoggerParams{ - Client: arv, + Client: arv, EventTypePrefix: logEventTypePrefix, WriteInterval: time.Second * time.Duration(logFrequencySeconds)}) } @@ -78,7 +78,7 @@ func singlerun() { var ( readCollections collection.ReadCollections - keepServerInfo keep.ReadServers + keepServerInfo keep.ReadServers ) if !summary.MaybeReadData(arvLogger, &readCollections, &keepServerInfo) { @@ -87,8 +87,8 @@ func singlerun() { go func() { collectionChannel <- collection.GetCollectionsAndSummarize( collection.GetCollectionsParams{ - Client: arv, - Logger: arvLogger, + Client: arv, + Logger: arvLogger, BatchSize: 50}) }() @@ -96,26 +96,41 @@ func singlerun() { keep.GetKeepServersParams{ Client: arv, Logger: arvLogger, - Limit: 1000}) + Limit: 1000}) readCollections = <-collectionChannel } summary.MaybeWriteData(arvLogger, readCollections, keepServerInfo) - replicationSummary := - summary.SummarizeReplication(readCollections, keepServerInfo) + buckets := summary.BucketReplication(readCollections, keepServerInfo) + bucketCounts := buckets.Counts() - log.Printf("Blocks In Collections: %d, " + + replicationSummary := buckets.SummarizeBuckets(readCollections) + replicationCounts := replicationSummary.ComputeCounts() + + log.Printf("Blocks In Collections: %d, "+ "\nBlocks In Keep: %d.", len(readCollections.BlockToReplication), len(keepServerInfo.BlockToServers)) - log.Println(replicationSummary.ComputeCounts().PrettyPrint()) + log.Println(replicationCounts.PrettyPrint()) + + log.Printf("Blocks Histogram:") + for _, rlbss := range bucketCounts { + log.Printf("%+v: %10d", + rlbss.Levels, + rlbss.Count) + } // Log that we're finished. We force the recording, since go will - // not wait for the timer before exiting. + // not wait for the write timer before exiting. if arvLogger != nil { arvLogger.FinalUpdate(func(p map[string]interface{}, e map[string]interface{}) { + summaryInfo := logger.GetOrCreateMap(p, "summary_info") + summaryInfo["block_replication_counts"] = bucketCounts + summaryInfo["replication_summary"] = replicationCounts + p["summary_info"] = summaryInfo + p["run_info"].(map[string]interface{})["finished_at"] = time.Now() }) }