internal void Merge(CDiscoveredMetrics attributesToMerge)
 {
     foreach (int k in attributesToMerge.Metrics.Keys)
     {
         _metrics[k] = attributesToMerge.Metrics[k];
     }
 }
        internal static CDiscoveredConfig Deserialize(string str)
        {
            CDiscoveredConfig result = new CDiscoveredConfig();

            if (str.Length > 0 && str != "{}")
            {
                result.Attributes = CDiscoveredAttributes.Deserialize(str);
                result.Metrics    = CDiscoveredMetrics.Deserialize(str);
            }
            return(result);
        }
        internal static CDiscoveredMetrics Deserialize(string str)
        {
            CDiscoveredMetrics result = new CDiscoveredMetrics();

            str = str.Replace("{", "");
            str = str.Replace("}", "");
            string[] arr = str.Split(',');
            foreach (string attr in arr)
            {
                string[] ad    = attr.Replace("\"", "").Split(':');
                int      index = Convert.ToInt32(ad[0]);
                if (index >= 1000)
                {
                    long val = Convert.ToInt64(ad[1]);

                    int subtype;
                    int type = Math.DivRem(index, 1000, out subtype) - 1;

                    result.Set(type, subtype, val);
                }
            }
            return(result);
        }