protected override void PerformMainLoopService()
        {
            if (sampleIntervalTimer.Started != BaseState.IsOnline)
            {
                if (BaseState.IsOnline)
                {
                    sampleIntervalTimer.Reset(triggerImmediately: true);
                    sampleRecordingIntervalTimer.Reset(triggerImmediately: true);
                }
                else
                {
                    sampleIntervalTimer.Stop();
                    sampleRecordingIntervalTimer.Stop();
                }
            }

            if (sampleIntervalTimer.IsTriggered)
            {
                NetworkInterface[] netInterfacesArray = NetworkInterface.GetAllNetworkInterfaces();

                bool occurrenceRecorded = false;

                foreach (var netIface in netInterfacesArray)
                {
                    NetIfaceTracker nit = null;
                    if (netIfaceTrackerDictionary.TryGetValue(netIface.Name, out nit) && nit != null)
                    {
                        var deltaType = nit.Service(netIface);

                        if (deltaType != DeltaType.None)
                        {
                            if (deltaType.IsSet(DeltaType.Settings))
                            {
                                var dataVC = nit.SettingsOccurrenceDataVC;
                                mdrfWriter.RecordOccurrence(netIfaceSettingChangeOccurrence, dataVC: nit.SettingsOccurrenceDataVC);
                                Log.Info.Emit("Adapter Settings changed: {0}", dataVC);

                                occurrenceRecorded = true;
                            }

                            if (deltaType.IsSet(DeltaType.Status))
                            {
                                var dataVC = nit.StateOccurrenceDataVC;
                                mdrfWriter.RecordOccurrence(netIfaceStatusChangeOccurrence, dataVC: nit.StateOccurrenceDataVC);
                                Log.Info.Emit("Adapter State changed: {0}", dataVC);

                                occurrenceRecorded = true;
                            }
                        }
                    }
                }

                if (sampleRecordingIntervalTimer.IsTriggered || occurrenceRecorded)
                {
                    mdrfWriter.RecordGroups();
                }
            }
        }
        private void RecordProcessEvent(string eventName, ProcessTracker pt, INamedValueSet extraNVS = null, bool includeExtraProcessInfo = false, bool includeTrackedValues = false, MDRF.Common.DateTimeStampPair dtPair = null)
        {
            if (extraNVS.IsNullOrEmpty())
            {
                Log.Info.Emit("{0} pid:{1} name:{2}", eventName, pt.pid, pt.name);
            }
            else
            {
                Log.Info.Emit("{0} pid:{1} name:{2} {3}", eventName, pt.pid, pt.name, extraNVS);
            }

            INamedValueSet nvs = new NamedValueSet()
            {
                { "eventName", eventName }
            }
            .MergeWith(pt.AsNVS(includeExtraProcessInfo: includeExtraProcessInfo, includeTrackedValues: includeTrackedValues))
            .MergeWith(extraNVS, NamedValueMergeBehavior.AddNewItems)
            .ConvertToReadOnly();

            mdrfWriter.RecordOccurrence(ProcessDeltaOccurrenceInfo, new ValueContainer(nvs), dtPair: dtPair);
        }