public override void AnalyzeModule(SDModule module)
 {
     if (SDTag.ContainsAgentName(module.FileName))
     {
         module.Tags.Add(SDTag.DynatraceAgentTag);
     }
 }
Exemple #2
0
        public static SDClrVersion ToSDModel(this ClrInfo info)
        {
            var model = new SDClrVersion();

            if (info != null)
            {
                model.Version   = info.Version.ToString();
                model.ClrFlavor = info.Flavor.ToString();

                // save DAC info
                var dac = new SDModule();
                dac.FileSize  = info.DacInfo.FileSize;
                dac.FilePath  = info.DacInfo.FileName;
                dac.ImageBase = info.DacInfo.ImageBase;
                dac.IsManaged = info.DacInfo.IsManaged;
                dac.TimeStamp = info.DacInfo.TimeStamp;
                dac.Version   = info.DacInfo.Version.ToString();

                // save PDB info, if avaliable
                if (info.DacInfo.Pdb != null)
                {
                    dac.PdbInfo = new SDPdbInfo(info.DacInfo.Pdb.FileName,
                                                info.DacInfo.Pdb.Guid.ToString(),
                                                info.DacInfo.Pdb.Revision);
                }

                model.DacFile = dac;
            }
            return(model);
        }
Exemple #3
0
        public override void AnalyzeModule(SDModule module)
        {
            bool hasAddedSpecialAgentTag = false;

            hasAddedSpecialAgentTag |= AddTagIfModuleContains(module, ContainsPhpAgentModule, SDTag.DynatracePhpAgentTag);
            hasAddedSpecialAgentTag |= AddTagIfModuleContains(module, ContainsJavaAgentModule, SDTag.DynatraceJavaAgentTag);
            hasAddedSpecialAgentTag |= AddTagIfModuleContains(module, ContainsDotnetAgentModule, SDTag.DynatraceDotNetAgentTag);
            hasAddedSpecialAgentTag |= AddTagIfModuleContains(module, ContainsProcessAgentModule, SDTag.DynatraceProcessAgentTag);
            hasAddedSpecialAgentTag |= AddTagIfModuleContains(module, ContainsIisAgentModule, SDTag.DynatraceIisAgentTag);
            hasAddedSpecialAgentTag |= AddTagIfModuleContains(module, ContainsLogAgentModule, SDTag.DynatraceLogAgentTag);
            hasAddedSpecialAgentTag |= AddTagIfModuleContains(module, ContainsOsAgentModule, SDTag.DynatraceOsAgentTag);
            hasAddedSpecialAgentTag |= AddTagIfModuleContains(module, ContainsPluginAgentModule, SDTag.DynatracePluginAgentTag);
            hasAddedSpecialAgentTag |= AddTagIfModuleContains(module, ContainsNetworkAgentModule, SDTag.DynatraceNetworkAgentTag);
            hasAddedSpecialAgentTag |= AddTagIfModuleContains(module, ContainsNginxAgentModule, SDTag.DynatraceNginxAgentTag);
            hasAddedSpecialAgentTag |= AddTagIfModuleContains(module, ContainsVarnishAgentModule, SDTag.DynatraceVarnishAgentTag);
            hasAddedSpecialAgentTag |= AddTagIfModuleContains(module, ContainsWatchdogFrame, SDTag.DynatraceWatchdogTag);
            hasAddedSpecialAgentTag |= AddTagIfModuleContains(module, ContainsNodeAgentModule, SDTag.DynatraceNodeAgentTag);
            hasAddedSpecialAgentTag |= AddTagIfModuleContains(module, ContainsAgentLoaderModule, SDTag.DynatraceAgentLoaderTag);

            if (!hasAddedSpecialAgentTag)
            {
                // if no special agent has been detected, add generic dynatrace agent tag
                AddTagIfModuleContains(module, ContainsDynatraceModule, SDTag.DynatraceAgentTag);
            }
        }
Exemple #4
0
        /// <summary>
        /// if <paramref name="func"/> returns true, set <paramref name="tag"/> on frame and thread
        /// </summary>
        private bool AddTagIfModuleContains(SDModule module, Func <string, bool> func, SDTag tag)
        {
            if (!func(module.FileName))
            {
                return(false);
            }

            module.Tags.Add(tag);
            return(true);
        }
Exemple #5
0
        public void PrintCLRVersions()
        {
            context.WriteLine("\n--- CLR version list ---");
            foreach (SDClrVersion version in systemInfo.ClrVersions)
            {
                context.WriteLine("Found CLR Version:" + version.Version);

                // This is the data needed to request the dac from the symbol server:
                SDModule dacInfo = version.DacFile;

                context.WriteLine("Filesize:  {0:X}", dacInfo.FileSize);
                context.WriteLine("Timestamp: {0:X}", dacInfo.TimeStamp);
                context.WriteLine("Dac File:  {0}", dacInfo.FileName);

                context.WriteLine(null);
            }
            context.WriteLine("--- END CLR version list ---");
        }
Exemple #6
0
        public static SDModule ToSDModel(this ModuleInfo info)
        {
            var model = new SDModule();

            model.FilePath  = info.FileName;
            model.FileSize  = info.FileSize;
            model.ImageBase = info.ImageBase;
            model.IsManaged = info.IsManaged;
            model.TimeStamp = info.TimeStamp;
            model.Version   = info.Version.ToString();
            model.PdbInfo   = new SDPdbInfo();
            if (info.Pdb != null)
            {
                model.PdbInfo.FileName = info.Pdb.FileName;
                model.PdbInfo.Guid     = info.Pdb.Guid.ToString();
                model.PdbInfo.Revision = info.Pdb.Revision;
            }
            return(model);
        }
        public void ModuleSerializationTest()
        {
            SystemAnalyzer  analyzer = new SystemAnalyzer(this.context);
            List <SDModule> modules  = new List <SDModule>();

            foreach (SDModule moduleBefore in analyzer.systemInfo.Modules)
            {
                string json = moduleBefore.SerializeToJSON();

                // deserialize module
                SDModule moduleAfter = JsonConvert.DeserializeObject <SDModule>(json);
                modules.Add(moduleAfter);

                // assert
                Assert.AreEqual(moduleBefore, moduleAfter);

                // serialize again and check
                string jsonAfter = moduleAfter.SerializeToJSON();
                StringAssert.Equals(json, jsonAfter);
            }

            Assert.IsTrue(Enumerable.SequenceEqual(analyzer.systemInfo.Modules, modules));
        }
 public virtual void AnalyzeModule(SDModule module)
 {
 }