Skip to content

Commit e22b4b1

Browse files
committed
add logs
1 parent 2a7c1a7 commit e22b4b1

File tree

1 file changed

+6
-3
lines changed
  • cmd/mt-whisper-importer-writer

1 file changed

+6
-3
lines changed

cmd/mt-whisper-importer-writer/main.go

+6-3
Original file line numberDiff line numberDiff line change
@@ -224,15 +224,18 @@ func (s *Server) chunksHandler(w http.ResponseWriter, req *http.Request) {
224224
s.index.AddOrUpdate(mkey, &data.MetricData, partition)
225225

226226
var wg sync.WaitGroup
227-
cb := func() {
228-
wg.Done()
229-
}
230227
for _, cwr := range data.ChunkWriteRequests {
231228
wg.Add(1)
229+
cb := func() {
230+
wg.Done()
231+
log.Debugf("Cwr has been written: %s / %s / %d", data.MetricData.Name, cwr.Archive.String(), cwr.T0)
232+
}
232233
cwrWithOrg := cwr.GetChunkWriteRequest(cb, mkey)
233234
s.store.Add(&cwrWithOrg)
234235
}
236+
235237
wg.Wait()
238+
log.Infof("Successfully wrote %d cwrs for metric %s", len(data.ChunkWriteRequests), data.MetricData.Name)
236239
}
237240

238241
func getOrgId(req *http.Request) (int, error) {

0 commit comments

Comments
 (0)