Beispiel #1
0
 public void HandleExceptions(Schema.Session session, string exceptions)
 {
     if (string.IsNullOrEmpty(exceptions))
     {
         return;
     }
     exceptions.ToLower();
 }
Beispiel #2
0
        public List <string> Errors = new List <string>();       // todo: print errors

        public void HandleTelemetryEntry(AzureStorageEntry entry)
        {
            var session = new Schema.Session()
            {
                Id            = entry.id,
                Started       = entry.SessionStartDate,
                TotalNrOfLogs = entry.TotalNrOfLogs,
            };

            Sessions.Add(session);
            HandleUsedFeatures(session, entry.usedFeatures);
            HandleExceptions(session, entry.exceptions);
        }
Beispiel #3
0
 public void HandleUsedFeatures(Schema.Session session, string usedFeatures)
 {
     foreach (var featureStr in (usedFeatures ?? "").Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries))
     {
         var featureMatch = featureRegex.Match(featureStr);
         if (!featureMatch.Success)
         {
             Errors.Add("bad feature string: " + featureStr);
             continue;
         }
         var featureId = featureMatch.Groups[1].Value;
         var feature   = new Schema.Feature()
         {
             Session = session,
             Meta    = FeatureMetadata.FromId(featureId)
         };
         if (feature.Meta == null)
         {
             Errors.Add("unknown feature: " + featureId);
             continue;
         }
         session.Features.Add(feature);
         foreach (var subFeatureStr in featureMatch.Groups[3].Value.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries))
         {
             var subFeatureMatch = subFeatureRegex.Match(subFeatureStr);
             if (!subFeatureMatch.Success)
             {
                 Errors.Add("bad subfeature string: " + subFeatureStr);
                 continue;
             }
             SubFeatureMetadata sfm;
             if (!feature.Meta.SubFeatures.TryGetValue(int.Parse(subFeatureMatch.Groups[1].Value), out sfm))
             {
                 Errors.Add("unkonwn subfeature string: " + subFeatureMatch.Groups[1].Value);
                 continue;
             }
             var subFeature = new Schema.SubFeature()
             {
                 Feature  = feature,
                 Meta     = sfm,
                 UseCount = int.Parse(subFeatureMatch.Groups[2].Value)
             };
             SubFeatures.Add(subFeature);
             feature.SubFeatures.Add(subFeature);
         }
     }
 }