code: func (s *State) enableTsMon(c context.Context) {
  	t := s.Target(c)
  	t.TaskNum = -1 // will be assigned later via TaskNumAllocator
  
  	s.state.SetStore(store.NewInMemory(&t))
  
  	// Request the flush to be executed ASAP, so it registers a claim for a task
  	// number via NotifyTaskIsAlive. Also reset 'lastFlush', so that we don't get
  	// invalid logging that the last flush was long time ago.
  	s.nextFlush = clock.Now(c)
  	s.lastFlush = s.nextFlush
  	// Set initial value for retry delay.
  	s.flushRetry = flushInitialRetry
  }
docs: // enableTsMon puts in-memory metrics store in the context's tsmon state.
  //
  // Called with 's.lock' locked.