khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2018-present Open Networking Foundation |
| 3 | |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
npujar | 1d86a52 | 2019-11-14 17:11:16 +0530 | [diff] [blame] | 16 | |
khenaidoo | cfee5f4 | 2018-07-19 22:47:38 -0400 | [diff] [blame] | 17 | package main |
| 18 | |
| 19 | import ( |
khenaidoo | 5c11af7 | 2018-07-20 17:21:05 -0400 | [diff] [blame] | 20 | "context" |
| 21 | "errors" |
khenaidoo | cfee5f4 | 2018-07-19 22:47:38 -0400 | [diff] [blame] | 22 | "fmt" |
| 23 | "os" |
| 24 | "os/signal" |
khenaidoo | cfee5f4 | 2018-07-19 22:47:38 -0400 | [diff] [blame] | 25 | "strconv" |
khenaidoo | cfee5f4 | 2018-07-19 22:47:38 -0400 | [diff] [blame] | 26 | "syscall" |
khenaidoo | 5c11af7 | 2018-07-20 17:21:05 -0400 | [diff] [blame] | 27 | "time" |
npujar | 1d86a52 | 2019-11-14 17:11:16 +0530 | [diff] [blame] | 28 | |
| 29 | "github.com/opencord/voltha-go/rw_core/config" |
| 30 | c "github.com/opencord/voltha-go/rw_core/core" |
| 31 | "github.com/opencord/voltha-go/rw_core/utils" |
| 32 | "github.com/opencord/voltha-lib-go/v2/pkg/db/kvstore" |
| 33 | "github.com/opencord/voltha-lib-go/v2/pkg/kafka" |
| 34 | "github.com/opencord/voltha-lib-go/v2/pkg/log" |
| 35 | "github.com/opencord/voltha-lib-go/v2/pkg/probe" |
| 36 | "github.com/opencord/voltha-lib-go/v2/pkg/version" |
| 37 | ic "github.com/opencord/voltha-protos/v2/go/inter_container" |
khenaidoo | cfee5f4 | 2018-07-19 22:47:38 -0400 | [diff] [blame] | 38 | ) |
| 39 | |
| 40 | type rwCore struct { |
khenaidoo | 5c11af7 | 2018-07-20 17:21:05 -0400 | [diff] [blame] | 41 | kvClient kvstore.Client |
| 42 | config *config.RWCoreFlags |
| 43 | halted bool |
| 44 | exitChannel chan int |
khenaidoo | b920354 | 2018-09-17 22:56:37 -0400 | [diff] [blame] | 45 | //kmp *kafka.KafkaMessagingProxy |
khenaidoo | 43c8212 | 2018-11-22 18:38:28 -0500 | [diff] [blame] | 46 | kafkaClient kafka.Client |
| 47 | core *c.Core |
khenaidoo | abad44c | 2018-08-03 16:58:35 -0400 | [diff] [blame] | 48 | //For test |
khenaidoo | 7923270 | 2018-12-04 11:00:41 -0500 | [diff] [blame] | 49 | receiverChannels []<-chan *ic.InterContainerMessage |
khenaidoo | cfee5f4 | 2018-07-19 22:47:38 -0400 | [diff] [blame] | 50 | } |
| 51 | |
khenaidoo | b920354 | 2018-09-17 22:56:37 -0400 | [diff] [blame] | 52 | func init() { |
npujar | 1d86a52 | 2019-11-14 17:11:16 +0530 | [diff] [blame] | 53 | _, err := log.AddPackage(log.JSON, log.DebugLevel, nil) |
| 54 | if err != nil { |
| 55 | log.Errorw("unable-to-register-package-to-the-log-map", log.Fields{"error": err}) |
| 56 | } |
khenaidoo | b920354 | 2018-09-17 22:56:37 -0400 | [diff] [blame] | 57 | } |
| 58 | |
khenaidoo | cfee5f4 | 2018-07-19 22:47:38 -0400 | [diff] [blame] | 59 | func newKVClient(storeType string, address string, timeout int) (kvstore.Client, error) { |
| 60 | |
khenaidoo | 5c11af7 | 2018-07-20 17:21:05 -0400 | [diff] [blame] | 61 | log.Infow("kv-store-type", log.Fields{"store": storeType}) |
khenaidoo | cfee5f4 | 2018-07-19 22:47:38 -0400 | [diff] [blame] | 62 | switch storeType { |
| 63 | case "consul": |
| 64 | return kvstore.NewConsulClient(address, timeout) |
| 65 | case "etcd": |
| 66 | return kvstore.NewEtcdClient(address, timeout) |
| 67 | } |
| 68 | return nil, errors.New("unsupported-kv-store") |
| 69 | } |
| 70 | |
Scott Baker | ee6a087 | 2019-10-29 15:59:52 -0700 | [diff] [blame] | 71 | func newKafkaClient(clientType string, host string, port int, instanceID string, livenessChannelInterval time.Duration) (kafka.Client, error) { |
khenaidoo | 43c8212 | 2018-11-22 18:38:28 -0500 | [diff] [blame] | 72 | |
| 73 | log.Infow("kafka-client-type", log.Fields{"client": clientType}) |
| 74 | switch clientType { |
| 75 | case "sarama": |
| 76 | return kafka.NewSaramaClient( |
| 77 | kafka.Host(host), |
khenaidoo | 9084792 | 2018-12-03 14:47:51 -0500 | [diff] [blame] | 78 | kafka.Port(port), |
khenaidoo | ca30132 | 2019-01-09 23:06:32 -0500 | [diff] [blame] | 79 | kafka.ConsumerType(kafka.GroupCustomer), |
khenaidoo | 9084792 | 2018-12-03 14:47:51 -0500 | [diff] [blame] | 80 | kafka.ProducerReturnOnErrors(true), |
| 81 | kafka.ProducerReturnOnSuccess(true), |
| 82 | kafka.ProducerMaxRetries(6), |
khenaidoo | ca30132 | 2019-01-09 23:06:32 -0500 | [diff] [blame] | 83 | kafka.NumPartitions(3), |
| 84 | kafka.ConsumerGroupName(instanceID), |
| 85 | kafka.ConsumerGroupPrefix(instanceID), |
khenaidoo | 54e0ddf | 2019-02-27 16:21:33 -0500 | [diff] [blame] | 86 | kafka.AutoCreateTopic(true), |
khenaidoo | ca30132 | 2019-01-09 23:06:32 -0500 | [diff] [blame] | 87 | kafka.ProducerFlushFrequency(5), |
Scott Baker | ee6a087 | 2019-10-29 15:59:52 -0700 | [diff] [blame] | 88 | kafka.ProducerRetryBackoff(time.Millisecond*30), |
| 89 | kafka.LivenessChannelInterval(livenessChannelInterval), |
| 90 | ), nil |
khenaidoo | 43c8212 | 2018-11-22 18:38:28 -0500 | [diff] [blame] | 91 | } |
| 92 | return nil, errors.New("unsupported-client-type") |
| 93 | } |
| 94 | |
khenaidoo | cfee5f4 | 2018-07-19 22:47:38 -0400 | [diff] [blame] | 95 | func newRWCore(cf *config.RWCoreFlags) *rwCore { |
| 96 | var rwCore rwCore |
| 97 | rwCore.config = cf |
| 98 | rwCore.halted = false |
| 99 | rwCore.exitChannel = make(chan int, 1) |
khenaidoo | 7923270 | 2018-12-04 11:00:41 -0500 | [diff] [blame] | 100 | rwCore.receiverChannels = make([]<-chan *ic.InterContainerMessage, 0) |
khenaidoo | cfee5f4 | 2018-07-19 22:47:38 -0400 | [diff] [blame] | 101 | return &rwCore |
| 102 | } |
| 103 | |
khenaidoo | b920354 | 2018-09-17 22:56:37 -0400 | [diff] [blame] | 104 | func (rw *rwCore) setKVClient() error { |
| 105 | addr := rw.config.KVStoreHost + ":" + strconv.Itoa(rw.config.KVStorePort) |
| 106 | client, err := newKVClient(rw.config.KVStoreType, addr, rw.config.KVStoreTimeout) |
khenaidoo | cfee5f4 | 2018-07-19 22:47:38 -0400 | [diff] [blame] | 107 | if err != nil { |
Richard Jankowski | e4d7766 | 2018-10-17 13:53:21 -0400 | [diff] [blame] | 108 | rw.kvClient = nil |
khenaidoo | cfee5f4 | 2018-07-19 22:47:38 -0400 | [diff] [blame] | 109 | log.Error(err) |
| 110 | return err |
| 111 | } |
khenaidoo | b920354 | 2018-09-17 22:56:37 -0400 | [diff] [blame] | 112 | rw.kvClient = client |
khenaidoo | cfee5f4 | 2018-07-19 22:47:38 -0400 | [diff] [blame] | 113 | return nil |
| 114 | } |
| 115 | |
npujar | 1d86a52 | 2019-11-14 17:11:16 +0530 | [diff] [blame] | 116 | func (rw *rwCore) start(ctx context.Context, instanceID string) { |
khenaidoo | 5c11af7 | 2018-07-20 17:21:05 -0400 | [diff] [blame] | 117 | log.Info("Starting RW Core components") |
khenaidoo | b920354 | 2018-09-17 22:56:37 -0400 | [diff] [blame] | 118 | |
khenaidoo | 9084792 | 2018-12-03 14:47:51 -0500 | [diff] [blame] | 119 | // Setup KV Client |
Richard Jankowski | e4d7766 | 2018-10-17 13:53:21 -0400 | [diff] [blame] | 120 | log.Debugw("create-kv-client", log.Fields{"kvstore": rw.config.KVStoreType}) |
| 121 | err := rw.setKVClient() |
| 122 | if err == nil { |
| 123 | // Setup KV transaction context |
khenaidoo | 9cdc1a6 | 2019-01-24 21:57:40 -0500 | [diff] [blame] | 124 | txnPrefix := rw.config.KVStoreDataPrefix + "/transactions/" |
npujar | 1d86a52 | 2019-11-14 17:11:16 +0530 | [diff] [blame] | 125 | if err = c.SetTransactionContext(instanceID, |
khenaidoo | 9cdc1a6 | 2019-01-24 21:57:40 -0500 | [diff] [blame] | 126 | txnPrefix, |
Richard Jankowski | e4d7766 | 2018-10-17 13:53:21 -0400 | [diff] [blame] | 127 | rw.kvClient, |
khenaidoo | 09771ef | 2019-10-11 14:25:02 -0400 | [diff] [blame] | 128 | rw.config.KVStoreTimeout); err != nil { |
khenaidoo | 9cdc1a6 | 2019-01-24 21:57:40 -0500 | [diff] [blame] | 129 | log.Fatal("creating-transaction-context-failed") |
| 130 | } |
Richard Jankowski | e4d7766 | 2018-10-17 13:53:21 -0400 | [diff] [blame] | 131 | } |
| 132 | |
khenaidoo | 9084792 | 2018-12-03 14:47:51 -0500 | [diff] [blame] | 133 | // Setup Kafka Client |
Scott Baker | ee6a087 | 2019-10-29 15:59:52 -0700 | [diff] [blame] | 134 | if rw.kafkaClient, err = newKafkaClient("sarama", |
| 135 | rw.config.KafkaAdapterHost, |
| 136 | rw.config.KafkaAdapterPort, |
npujar | 1d86a52 | 2019-11-14 17:11:16 +0530 | [diff] [blame] | 137 | instanceID, |
Girish Kumar | 4d3887d | 2019-11-22 14:22:05 +0000 | [diff] [blame] | 138 | rw.config.LiveProbeInterval/2); err != nil { |
khenaidoo | 43c8212 | 2018-11-22 18:38:28 -0500 | [diff] [blame] | 139 | log.Fatal("Unsupported-kafka-client") |
| 140 | } |
| 141 | |
khenaidoo | b920354 | 2018-09-17 22:56:37 -0400 | [diff] [blame] | 142 | // Create the core service |
npujar | 1d86a52 | 2019-11-14 17:11:16 +0530 | [diff] [blame] | 143 | rw.core = c.NewCore(instanceID, rw.config, rw.kvClient, rw.kafkaClient) |
khenaidoo | b920354 | 2018-09-17 22:56:37 -0400 | [diff] [blame] | 144 | |
| 145 | // start the core |
| 146 | rw.core.Start(ctx) |
khenaidoo | cfee5f4 | 2018-07-19 22:47:38 -0400 | [diff] [blame] | 147 | } |
| 148 | |
David K. Bainbridge | b4a9ab0 | 2019-09-20 15:12:16 -0700 | [diff] [blame] | 149 | func (rw *rwCore) stop(ctx context.Context) { |
khenaidoo | cfee5f4 | 2018-07-19 22:47:38 -0400 | [diff] [blame] | 150 | // Stop leadership tracking |
khenaidoo | b920354 | 2018-09-17 22:56:37 -0400 | [diff] [blame] | 151 | rw.halted = true |
khenaidoo | cfee5f4 | 2018-07-19 22:47:38 -0400 | [diff] [blame] | 152 | |
| 153 | // send exit signal |
khenaidoo | b920354 | 2018-09-17 22:56:37 -0400 | [diff] [blame] | 154 | rw.exitChannel <- 0 |
khenaidoo | cfee5f4 | 2018-07-19 22:47:38 -0400 | [diff] [blame] | 155 | |
| 156 | // Cleanup - applies only if we had a kvClient |
khenaidoo | b920354 | 2018-09-17 22:56:37 -0400 | [diff] [blame] | 157 | if rw.kvClient != nil { |
khenaidoo | cfee5f4 | 2018-07-19 22:47:38 -0400 | [diff] [blame] | 158 | // Release all reservations |
khenaidoo | b920354 | 2018-09-17 22:56:37 -0400 | [diff] [blame] | 159 | if err := rw.kvClient.ReleaseAllReservations(); err != nil { |
khenaidoo | 5c11af7 | 2018-07-20 17:21:05 -0400 | [diff] [blame] | 160 | log.Infow("fail-to-release-all-reservations", log.Fields{"error": err}) |
khenaidoo | cfee5f4 | 2018-07-19 22:47:38 -0400 | [diff] [blame] | 161 | } |
| 162 | // Close the DB connection |
khenaidoo | b920354 | 2018-09-17 22:56:37 -0400 | [diff] [blame] | 163 | rw.kvClient.Close() |
khenaidoo | cfee5f4 | 2018-07-19 22:47:38 -0400 | [diff] [blame] | 164 | } |
khenaidoo | 43c8212 | 2018-11-22 18:38:28 -0500 | [diff] [blame] | 165 | |
David K. Bainbridge | b4a9ab0 | 2019-09-20 15:12:16 -0700 | [diff] [blame] | 166 | rw.core.Stop(ctx) |
khenaidoo | 43c8212 | 2018-11-22 18:38:28 -0500 | [diff] [blame] | 167 | |
| 168 | //if rw.kafkaClient != nil { |
| 169 | // rw.kafkaClient.Stop() |
| 170 | //} |
khenaidoo | cfee5f4 | 2018-07-19 22:47:38 -0400 | [diff] [blame] | 171 | } |
| 172 | |
| 173 | func waitForExit() int { |
| 174 | signalChannel := make(chan os.Signal, 1) |
| 175 | signal.Notify(signalChannel, |
| 176 | syscall.SIGHUP, |
| 177 | syscall.SIGINT, |
| 178 | syscall.SIGTERM, |
| 179 | syscall.SIGQUIT) |
| 180 | |
| 181 | exitChannel := make(chan int) |
| 182 | |
| 183 | go func() { |
| 184 | s := <-signalChannel |
| 185 | switch s { |
| 186 | case syscall.SIGHUP, |
| 187 | syscall.SIGINT, |
| 188 | syscall.SIGTERM, |
| 189 | syscall.SIGQUIT: |
khenaidoo | 5c11af7 | 2018-07-20 17:21:05 -0400 | [diff] [blame] | 190 | log.Infow("closing-signal-received", log.Fields{"signal": s}) |
khenaidoo | cfee5f4 | 2018-07-19 22:47:38 -0400 | [diff] [blame] | 191 | exitChannel <- 0 |
| 192 | default: |
khenaidoo | 5c11af7 | 2018-07-20 17:21:05 -0400 | [diff] [blame] | 193 | log.Infow("unexpected-signal-received", log.Fields{"signal": s}) |
khenaidoo | cfee5f4 | 2018-07-19 22:47:38 -0400 | [diff] [blame] | 194 | exitChannel <- 1 |
| 195 | } |
| 196 | }() |
| 197 | |
| 198 | code := <-exitChannel |
| 199 | return code |
| 200 | } |
| 201 | |
khenaidoo | 5c11af7 | 2018-07-20 17:21:05 -0400 | [diff] [blame] | 202 | func printBanner() { |
| 203 | fmt.Println(" ") |
| 204 | fmt.Println(" ______ ______ ") |
| 205 | fmt.Println("| _ \\ \\ / / ___|___ _ __ ___ ") |
| 206 | fmt.Println("| |_) \\ \\ /\\ / / | / _ \\| '__/ _ \\ ") |
| 207 | fmt.Println("| _ < \\ V V /| |__| (_) | | | __/ ") |
| 208 | fmt.Println("|_| \\_\\ \\_/\\_/ \\____\\___/|_| \\___| ") |
| 209 | fmt.Println(" ") |
| 210 | } |
| 211 | |
David K. Bainbridge | f430cd5 | 2019-05-28 15:00:35 -0700 | [diff] [blame] | 212 | func printVersion() { |
| 213 | fmt.Println("VOLTHA Read-Write Core") |
| 214 | fmt.Println(version.VersionInfo.String(" ")) |
| 215 | } |
| 216 | |
khenaidoo | cfee5f4 | 2018-07-19 22:47:38 -0400 | [diff] [blame] | 217 | func main() { |
| 218 | start := time.Now() |
| 219 | |
| 220 | cf := config.NewRWCoreFlags() |
| 221 | cf.ParseCommandArguments() |
| 222 | |
khenaidoo | 631fe54 | 2019-05-31 15:44:43 -0400 | [diff] [blame] | 223 | // Set the instance ID as the hostname |
npujar | 1d86a52 | 2019-11-14 17:11:16 +0530 | [diff] [blame] | 224 | var instanceID string |
khenaidoo | 631fe54 | 2019-05-31 15:44:43 -0400 | [diff] [blame] | 225 | hostName := utils.GetHostName() |
| 226 | if len(hostName) > 0 { |
npujar | 1d86a52 | 2019-11-14 17:11:16 +0530 | [diff] [blame] | 227 | instanceID = hostName |
khenaidoo | 631fe54 | 2019-05-31 15:44:43 -0400 | [diff] [blame] | 228 | } else { |
| 229 | log.Fatal("HOSTNAME not set") |
| 230 | } |
khenaidoo | b920354 | 2018-09-17 22:56:37 -0400 | [diff] [blame] | 231 | |
| 232 | //Setup default logger - applies for packages that do not have specific logger set |
npujar | 1d86a52 | 2019-11-14 17:11:16 +0530 | [diff] [blame] | 233 | if _, err := log.SetDefaultLogger(log.JSON, cf.LogLevel, log.Fields{"instanceId": instanceID}); err != nil { |
khenaidoo | cfee5f4 | 2018-07-19 22:47:38 -0400 | [diff] [blame] | 234 | log.With(log.Fields{"error": err}).Fatal("Cannot setup logging") |
| 235 | } |
khenaidoo | b920354 | 2018-09-17 22:56:37 -0400 | [diff] [blame] | 236 | |
khenaidoo | 631fe54 | 2019-05-31 15:44:43 -0400 | [diff] [blame] | 237 | // Update all loggers (provisioned via init) with a common field |
npujar | 1d86a52 | 2019-11-14 17:11:16 +0530 | [diff] [blame] | 238 | if err := log.UpdateAllLoggers(log.Fields{"instanceId": instanceID}); err != nil { |
khenaidoo | b920354 | 2018-09-17 22:56:37 -0400 | [diff] [blame] | 239 | log.With(log.Fields{"error": err}).Fatal("Cannot setup logging") |
| 240 | } |
| 241 | |
khenaidoo | 631fe54 | 2019-05-31 15:44:43 -0400 | [diff] [blame] | 242 | // Update all loggers to log level specified as input parameter |
| 243 | log.SetAllLogLevel(cf.LogLevel) |
khenaidoo | 2c6a099 | 2019-04-29 13:46:56 -0400 | [diff] [blame] | 244 | |
khenaidoo | 631fe54 | 2019-05-31 15:44:43 -0400 | [diff] [blame] | 245 | //log.SetPackageLogLevel("github.com/opencord/voltha-go/rw_core/core", log.DebugLevel) |
khenaidoo | b920354 | 2018-09-17 22:56:37 -0400 | [diff] [blame] | 246 | |
npujar | 1d86a52 | 2019-11-14 17:11:16 +0530 | [diff] [blame] | 247 | defer func() { |
| 248 | err := log.CleanUp() |
| 249 | if err != nil { |
| 250 | log.Errorw("unable-to-flush-any-buffered-log-entries", log.Fields{"error": err}) |
| 251 | } |
| 252 | }() |
khenaidoo | cfee5f4 | 2018-07-19 22:47:38 -0400 | [diff] [blame] | 253 | |
khenaidoo | 631fe54 | 2019-05-31 15:44:43 -0400 | [diff] [blame] | 254 | // Print version / build information and exit |
David K. Bainbridge | f430cd5 | 2019-05-28 15:00:35 -0700 | [diff] [blame] | 255 | if cf.DisplayVersionOnly { |
| 256 | printVersion() |
| 257 | return |
| 258 | } |
| 259 | |
khenaidoo | 5c11af7 | 2018-07-20 17:21:05 -0400 | [diff] [blame] | 260 | // Print banner if specified |
| 261 | if cf.Banner { |
| 262 | printBanner() |
| 263 | } |
| 264 | |
| 265 | log.Infow("rw-core-config", log.Fields{"config": *cf}) |
| 266 | |
David K. Bainbridge | b4a9ab0 | 2019-09-20 15:12:16 -0700 | [diff] [blame] | 267 | // Create the core |
| 268 | rw := newRWCore(cf) |
| 269 | |
| 270 | // Create a context adding the status update channel |
khenaidoo | 5c11af7 | 2018-07-20 17:21:05 -0400 | [diff] [blame] | 271 | ctx, cancel := context.WithCancel(context.Background()) |
| 272 | defer cancel() |
khenaidoo | cfee5f4 | 2018-07-19 22:47:38 -0400 | [diff] [blame] | 273 | |
David K. Bainbridge | b4a9ab0 | 2019-09-20 15:12:16 -0700 | [diff] [blame] | 274 | /* |
| 275 | * Create and start the liveness and readiness container management probes. This |
| 276 | * is done in the main function so just in case the main starts multiple other |
| 277 | * objects there can be a single probe end point for the process. |
| 278 | */ |
| 279 | p := &probe.Probe{} |
Kent Hagerman | c461883 | 2019-10-07 12:24:36 -0400 | [diff] [blame] | 280 | go p.ListenAndServe(fmt.Sprintf("%s:%d", rw.config.ProbeHost, rw.config.ProbePort)) |
David K. Bainbridge | b4a9ab0 | 2019-09-20 15:12:16 -0700 | [diff] [blame] | 281 | |
| 282 | // Add the probe to the context to pass to all the services started |
| 283 | probeCtx := context.WithValue(ctx, probe.ProbeContextKey, p) |
| 284 | |
| 285 | // Start the core |
npujar | 1d86a52 | 2019-11-14 17:11:16 +0530 | [diff] [blame] | 286 | go rw.start(probeCtx, instanceID) |
khenaidoo | cfee5f4 | 2018-07-19 22:47:38 -0400 | [diff] [blame] | 287 | |
| 288 | code := waitForExit() |
khenaidoo | 5c11af7 | 2018-07-20 17:21:05 -0400 | [diff] [blame] | 289 | log.Infow("received-a-closing-signal", log.Fields{"code": code}) |
khenaidoo | cfee5f4 | 2018-07-19 22:47:38 -0400 | [diff] [blame] | 290 | |
| 291 | // Cleanup before leaving |
David K. Bainbridge | b4a9ab0 | 2019-09-20 15:12:16 -0700 | [diff] [blame] | 292 | rw.stop(probeCtx) |
khenaidoo | cfee5f4 | 2018-07-19 22:47:38 -0400 | [diff] [blame] | 293 | |
| 294 | elapsed := time.Since(start) |
npujar | 1d86a52 | 2019-11-14 17:11:16 +0530 | [diff] [blame] | 295 | log.Infow("rw-core-run-time", log.Fields{"core": instanceID, "time": elapsed / time.Second}) |
khenaidoo | cfee5f4 | 2018-07-19 22:47:38 -0400 | [diff] [blame] | 296 | } |