コード例 #1
0
 void SetDefaultSettings()
 {
     TrackQuality = false;
     TrackDownloadErrors = false;
     AggregationInterval = TimeSpan.Zero;
     PollingInterval = TimeSpan.Zero;
     LatencyAlertThreshold = null;
     QualityConfig = new QualityConfig();
     AdditionalData = new Dictionary<string, string>();
 }
コード例 #2
0
 void SetDefaultSettings()
 {
     TrackQuality          = false;
     TrackDownloadErrors   = false;
     AggregationInterval   = TimeSpan.Zero;
     PollingInterval       = TimeSpan.Zero;
     LatencyAlertThreshold = null;
     QualityConfig         = new QualityConfig();
     AdditionalData        = new Dictionary <string, string>();
 }
コード例 #3
0
        internal static QualityConfig Load(XmlReader reader)
        {
            if (reader == null)
            {
                throw new ArgumentNullException("reader");
            }

            QualityConfig result = new QualityConfig();

            reader.GoToElement();
            if (!reader.IsEmptyElement)
            {
                reader.ReadStartElement();
                while (reader.GoToSibling())
                {
                    switch (reader.LocalName)
                    {
                    case "DroppedFrames":
                        result.DroppedFrames = Convert.ToBoolean(reader.ReadElementContentAsInt());
                        break;

                    case "RenderedFrames":
                        result.RenderedFrames = Convert.ToBoolean(reader.ReadElementContentAsInt());
                        break;

                    case "ProcessCPULoad":
                        result.ProcessCpuLoad = Convert.ToBoolean(reader.ReadElementContentAsInt());
                        break;

                    case "SystemCPULoad":
                        result.SystemCpuLoad = Convert.ToBoolean(reader.ReadElementContentAsInt());
                        break;

                    case "Bitrate":
                        result.Bitrate = Convert.ToBoolean(reader.ReadElementContentAsInt());
                        break;

                    case "BitrateMax":
                        result.BitrateMax = Convert.ToBoolean(reader.ReadElementContentAsInt());
                        break;

                    case "BitrateMaxDuration":
                        result.BitrateMaxDuration = Convert.ToBoolean(reader.ReadElementContentAsInt());
                        break;

                    case "PerceivedBandwidth":
                        result.PerceivedBandwidth = Convert.ToBoolean(reader.ReadElementContentAsInt());
                        break;

                    case "VideoBufferSize":
                        result.VideoBufferSize = Convert.ToBoolean(reader.ReadElementContentAsInt());
                        break;

                    case "AudioBufferSize":
                        result.AudioBufferSize = Convert.ToBoolean(reader.ReadElementContentAsInt());
                        break;

                    case "Buffering":
                        result.Buffering = Convert.ToBoolean(reader.ReadElementContentAsInt());
                        break;

                    case "BitrateChangeCount":
                        result.BitrateChangeCount = Convert.ToBoolean(reader.ReadElementContentAsInt());
                        break;

                    case "VideoDownloadLatency":
                        result.VideoDownloadLatency = Convert.ToBoolean(reader.ReadElementContentAsInt());
                        break;

                    case "AudioDownloadLatency":
                        result.AudioDownloadLatency = Convert.ToBoolean(reader.ReadElementContentAsInt());
                        break;

                    case "DvrOperationCount":
                        result.DvrOperationCount = Convert.ToBoolean(reader.ReadElementContentAsInt());
                        break;

                    case "FullScreenChangeCount":
                        result.FullScreenChangeCount = Convert.ToBoolean(reader.ReadElementContentAsInt());
                        break;

                    case "HttpErrorCount":
                        result.DownloadErrorCount = Convert.ToBoolean(reader.ReadElementContentAsInt());
                        break;

                    default:
                        reader.Skip();
                        break;
                    }
                }
                reader.ReadEndElement();
            }
            else
            {
                reader.Skip();
            }

            return(result);
        }
コード例 #4
0
 public QualityReportAggregator(QualityConfig qualityConfig)
 {
     QualityConfig = qualityConfig;
 }
コード例 #5
0
 public QualityReportAggregator(QualityConfig qualityConfig)
 {
     QualityConfig = qualityConfig;
 }
コード例 #6
0
        /// <summary>
        /// Creates an instance of the main diagnostic config object from an XmlReader
        /// </summary>
        internal static AnalyticsConfig Load(XmlReader reader)
        {
            if (reader == null)
            {
                throw new ArgumentNullException("reader");
            }

            var result = new AnalyticsConfig();

            result.LatencyAlertThreshold = null;

            reader.GoToElement();
            reader.ReadStartElement();
            if (!reader.IsEmptyElement)
            {
                while (reader.GoToSibling())
                {
                    switch (reader.LocalName)
                    {
                    case "AdditionalData":
                        result.AdditionalData = reader.ReadElementContentAsString().Split(',').Select(kvp => kvp.Split('=')).ToDictionary(kvp => kvp[0], kvp => kvp[1]);
                        break;

                    case "Logging":
                        if (!reader.IsEmptyElement)
                        {
                            result.LoggingConfig = LoggingConfig.Load(reader);
                        }
                        else
                        {
                            reader.Skip();
                        }
                        break;

                    case "Diagnostics":
                        if (!reader.IsEmptyElement)
                        {
                            reader.ReadStartElement();
                            while (reader.GoToSibling())
                            {
                                switch (reader.LocalName)
                                {
                                case "TrackQuality":
                                    result.TrackQuality = Convert.ToBoolean(reader.ReadElementContentAsInt());
                                    break;

                                case "TrackDownloadErrors":
                                    result.TrackDownloadErrors = Convert.ToBoolean(reader.ReadElementContentAsInt());
                                    break;

                                case "AggregationIntervalMilliseconds":
                                    result.AggregationInterval = TimeSpan.FromMilliseconds(reader.ReadElementContentAsInt());
                                    break;

                                case "PollingMilliseconds":
                                    result.PollingInterval = TimeSpan.FromMilliseconds(reader.ReadElementContentAsInt());
                                    break;

                                case "LatencyAlertThreshold":
                                    result.LatencyAlertThreshold = reader.ReadElementContentAsDouble();
                                    break;

                                case "QualityTracking":
                                    result.QualityConfig = QualityConfig.Load(reader);
                                    break;

                                default:
                                    reader.Skip();
                                    break;
                                }
                            }
                            reader.ReadEndElement();
                        }
                        else
                        {
                            reader.Skip();
                        }
                        break;

                    default:
                        reader.Skip();
                        break;
                    }
                }
                reader.ReadEndElement();
            }
            else
            {
                reader.Skip();
            }

            return(result);
        }
コード例 #7
0
        internal static QualityConfig Load(XmlReader reader)
        {
            if (reader == null)
                throw new ArgumentNullException("reader");

            QualityConfig result = new QualityConfig();

            reader.GoToElement();
            if (!reader.IsEmptyElement)
            {
                reader.ReadStartElement();
                while (reader.GoToSibling())
                {
                    switch (reader.LocalName)
                    {
                        case "DroppedFrames":
                            result.DroppedFrames = Convert.ToBoolean(reader.ReadElementContentAsInt());
                            break;
                        case "RenderedFrames":
                            result.RenderedFrames = Convert.ToBoolean(reader.ReadElementContentAsInt());
                            break;
                        case "ProcessCPULoad":
                            result.ProcessCpuLoad = Convert.ToBoolean(reader.ReadElementContentAsInt());
                            break;
                        case "SystemCPULoad":
                            result.SystemCpuLoad = Convert.ToBoolean(reader.ReadElementContentAsInt());
                            break;
                        case "Bitrate":
                            result.Bitrate = Convert.ToBoolean(reader.ReadElementContentAsInt());
                            break;
                        case "BitrateMax":
                            result.BitrateMax = Convert.ToBoolean(reader.ReadElementContentAsInt());
                            break;
                        case "BitrateMaxDuration":
                            result.BitrateMaxDuration = Convert.ToBoolean(reader.ReadElementContentAsInt());
                            break;
                        case "PerceivedBandwidth":
                            result.PerceivedBandwidth = Convert.ToBoolean(reader.ReadElementContentAsInt());
                            break;
                        case "VideoBufferSize":
                            result.VideoBufferSize = Convert.ToBoolean(reader.ReadElementContentAsInt());
                            break;
                        case "AudioBufferSize":
                            result.AudioBufferSize = Convert.ToBoolean(reader.ReadElementContentAsInt());
                            break;
                        case "Buffering":
                            result.Buffering = Convert.ToBoolean(reader.ReadElementContentAsInt());
                            break;
                        case "BitrateChangeCount":
                            result.BitrateChangeCount = Convert.ToBoolean(reader.ReadElementContentAsInt());
                            break;
                        case "VideoDownloadLatency":
                            result.VideoDownloadLatency = Convert.ToBoolean(reader.ReadElementContentAsInt());
                            break;
                        case "AudioDownloadLatency":
                            result.AudioDownloadLatency = Convert.ToBoolean(reader.ReadElementContentAsInt());
                            break;
                        case "DvrOperationCount":
                            result.DvrOperationCount = Convert.ToBoolean(reader.ReadElementContentAsInt());
                            break;
                        case "FullScreenChangeCount":
                            result.FullScreenChangeCount = Convert.ToBoolean(reader.ReadElementContentAsInt());
                            break;
                        case "HttpErrorCount":
                            result.DownloadErrorCount = Convert.ToBoolean(reader.ReadElementContentAsInt());
                            break;

                        default:
                            reader.Skip();
                            break;
                    }
                }
                reader.ReadEndElement();
            }
            else
                reader.Skip();

            return result;
        }