You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: cglmon.go
    path of file: ./repos/the-way-to-go_ZH_CN/eBook/examples/chapter_11/tideland-cgl.googlecode.com/hg
    
    the code of the file until where you have to start completion: /*
	Tideland Common Go Library - Monitoring

	Copyright (C) 2009-2011 Frank Mueller / Oldenburg / Germany

	Redistribution and use in source and binary forms, with or
	modification, are permitted provided that the following conditions are
	met:

	Redistrib
    
func (sm *SystemMonitor) backend() {
	defer func() {
		HelpIfNeeded(sm, recover())
	}()

	for {
		select {
		case measuring := <-sm.measuringChan:
			// Received a new measuring.
			if mp, ok := sm.etmData[measuring.id]; ok {
				// Measuring point found.
				mp.update(measuring)
			} else {
				// New measuring point.
				sm.etmData[measuring.id] = newMeasuringPoint(measuring)
			}
		case value := <-sm.valueChan:
			// Received a new value.
			if ssv, ok := sm.ssiData[value.id]; ok {
				// Variable found.
				ssv.update(value)
			} else {
				// New stay-set variable.
				sm.ssiData[value.id] = newStaySetVariable(value)
			}
		case registration := <-sm.retrieverRegistrationChan:
			// Received a new retriever for registration.
			if registration.dsr != nil {
				// Register a new retriever.
				sm.dsrData[registration.id] = registration.dsr
			} else {
				// Deregister a retriever.
				if dsr, ok := sm.dsrData[registration.id]; ok {
					sm.dsrData[registration.id] = dsr, false
				}
			}
		case cmd := <-sm.commandChan:
			// Receivedd a command to process.
			sm.processCommand(cmd)
		}
	}
}