public SimilarityController(SimilarityService similarityService, DumpRepository dumpRepository, BundleRepository bundleRepository, ILoggerFactory loggerFactory)
 {
     this.similarityService = similarityService;
     this.dumpRepository    = dumpRepository;
     this.bundleRepository  = bundleRepository;
     logger = loggerFactory.CreateLogger <SimilarityController>();
 }
Exemplo n.º 2
0
 public HomeController(
     SuperDumpRepository superDumpRepo,
     BundleRepository bundleRepo,
     DumpRepository dumpRepo,
     IDumpStorage dumpStorage,
     IOptions <SuperDumpSettings> settings,
     PathHelper pathHelper,
     RelationshipRepository relationshipRepo,
     SimilarityService similarityService,
     ElasticSearchService elasticService,
     ILoggerFactory loggerFactory,
     IAuthorizationHelper authorizationHelper,
     JiraIssueRepository jiraIssueRepository,
     SearchService searchService,
     DownloadService downloadService)
 {
     this.superDumpRepo     = superDumpRepo;
     this.bundleRepo        = bundleRepo;
     this.dumpRepo          = dumpRepo;
     this.dumpStorage       = dumpStorage;
     this.settings          = settings.Value;
     this.pathHelper        = pathHelper;
     this.relationshipRepo  = relationshipRepo;
     this.similarityService = similarityService;
     logger = loggerFactory.CreateLogger <HomeController>();
     this.authorizationHelper = authorizationHelper;
     this.jiraIssueRepository = jiraIssueRepository;
     this.searchService       = searchService;
     this.downloadService     = downloadService;
 }
Exemplo n.º 3
0
        public AnalyzerPipeline(
            DumpRepository dumpRepo,
            BundleRepository bundleRepo,
            PathHelper pathHelper,
            IOptions <SuperDumpSettings> settings,
            ElasticSearchService elasticSearch,
            SimilarityService similarityService,
            FaultReportingService faultReportingService,
            IOneAgentSdk dynatraceSdk)
        {
            var analyzers = new List <AnalyzerJob>();

            analyzers.Add(new DumpAnalyzerJob(dumpRepo, settings, pathHelper, dynatraceSdk));
            analyzers.Add(new EmptyAnalyzerJob(dumpRepo));

            var postAnalyzers = new List <PostAnalysisJob>();

            postAnalyzers.Add(new ElasticSearchJob(bundleRepo, dumpRepo, elasticSearch));
            postAnalyzers.Add(new SimilarityAnalyzerJob(similarityService, settings));
            postAnalyzers.Add(new FaultReportJob(faultReportingService, settings));

            Analyzers        = analyzers;
            InitialAnalyzers = analyzers.Where(analyzerJob => analyzerJob is InitalAnalyzerJob).Cast <InitalAnalyzerJob>();
            PostAnalysisJobs = postAnalyzers;
        }
Exemplo n.º 4
0
        public void PelletSimilarity2()
        {
            PelletServer server  = new PelletServer(PelletTestServer);
            Type         svcType = typeof(SimilarityService);

            foreach (KnowledgeBase kb in server.KnowledgeBases)
            {
                if (kb.SupportsService(svcType))
                {
                    Console.WriteLine(kb.Name + " supports Similarity");
                    SimilarityService svc = (SimilarityService)kb.GetService(svcType);

                    List <KeyValuePair <INode, double> > results = svc.Similarity(5, "wine:Red");
                    foreach (KeyValuePair <INode, double> kvp in results)
                    {
                        Console.WriteLine(kvp.Key.ToString() + " (Similarity = " + kvp.Value + ")");
                    }
                }
                else
                {
                    Console.WriteLine(kb.Name + " does not support the Similarity Service");
                }
                Console.WriteLine();
            }
        }
Exemplo n.º 5
0
 public HomeController(IHostingEnvironment environment, SuperDumpRepository superDumpRepo, BundleRepository bundleRepo, DumpRepository dumpRepo, DumpStorageFilebased dumpStorage, IOptions <SuperDumpSettings> settings, PathHelper pathHelper, RelationshipRepository relationshipRepo, SimilarityService similarityService)
 {
     this.environment       = environment;
     this.superDumpRepo     = superDumpRepo;
     this.bundleRepo        = bundleRepo;
     this.dumpRepo          = dumpRepo;
     this.dumpStorage       = dumpStorage;
     this.settings          = settings.Value;
     this.pathHelper        = pathHelper;
     this.relationshipRepo  = relationshipRepo;
     this.similarityService = similarityService;
 }
Exemplo n.º 6
0
 public HomeController(IHostingEnvironment environment, SuperDumpRepository superDumpRepo, BundleRepository bundleRepo, DumpRepository dumpRepo, DumpStorageFilebased dumpStorage, IOptions <SuperDumpSettings> settings, PathHelper pathHelper, RelationshipRepository relationshipRepo, SimilarityService similarityService, ILoggerFactory loggerFactory, IAuthorizationHelper authorizationHelper)
 {
     this.environment       = environment;
     this.superDumpRepo     = superDumpRepo;
     this.bundleRepo        = bundleRepo;
     this.dumpRepo          = dumpRepo;
     this.dumpStorage       = dumpStorage;
     this.settings          = settings.Value;
     this.pathHelper        = pathHelper;
     this.relationshipRepo  = relationshipRepo;
     this.similarityService = similarityService;
     logger = loggerFactory.CreateLogger <HomeController>();
     this.authorizationHelper = authorizationHelper;
 }
Exemplo n.º 7
0
 public AdminController(SimilarityService similarityService,
                        DumpRepository dumpRepository,
                        BundleRepository bundleRepository,
                        ILoggerFactory loggerFactory,
                        IdenticalDumpRepository identicalDumpRepository,
                        JiraIssueRepository jiraIssueRepository,
                        IOptions <SuperDumpSettings> settings,
                        ElasticSearchService elasticService)
 {
     this.similarityService       = similarityService;
     this.bundleRepository        = bundleRepository;
     this.identicalDumpRepository = identicalDumpRepository;
     this.jiraIssueRepository     = jiraIssueRepository;
     this.elasticService          = elasticService;
     logger        = loggerFactory.CreateLogger <AdminController>();
     this.settings = settings.Value;
 }
Exemplo n.º 8
0
        public SimilarityServiceBenchmarks()
        {
            /// fake a repository of N very similar dumps. Then let similarity calculation run
            /// simulate filesystem access with Thread.Sleep in FakeDumpStorage
            N = 1000;

            var settings = Options.Create(new SuperDumpSettings {
                SimilarityDetectionEnabled = true,
                SimilarityDetectionMaxDays = 30
            });

            this.pathHelper          = new PathHelper("", "", "");
            this.dumpStorage         = new FakeDumpStorage(CreateFakeDumps(N));
            this.dumpRepo            = new DumpRepository(dumpStorage, pathHelper, settings);
            this.relationshipStorage = new FakeRelationshipStorage();
            this.relationshipRepo    = new RelationshipRepository(relationshipStorage, dumpRepo, settings);
            this.similarityService   = new SimilarityService(dumpRepo, relationshipRepo, settings, Dynatrace.OneAgent.Sdk.Api.OneAgentSdkFactory.CreateInstance());
        }
Exemplo n.º 9
0
        public void PelletSimilarity()
        {
            PelletServer server  = new PelletServer(PelletTestServer);
            Type         svcType = typeof(SimilarityService);

            foreach (KnowledgeBase kb in server.KnowledgeBases)
            {
                if (kb.SupportsService(svcType))
                {
                    Console.WriteLine(kb.Name + " supports Similarity");
                    SimilarityService svc = (SimilarityService)kb.GetService(svcType);

                    IGraph g = svc.SimilarityRaw(5, "wine:Red");
                    TestTools.ShowGraph(g);
                }
                else
                {
                    Console.WriteLine(kb.Name + " does not support the Similarity Service");
                }
                Console.WriteLine();
            }
        }
Exemplo n.º 10
0
 public SimilarityAnalyzerJob(SimilarityService similarityService, IOptions <SuperDumpSettings> settings)
 {
     this.similarityService = similarityService;
     this.settings          = settings;
 }
Exemplo n.º 11
0
 public SimilarityController(SimilarityService similarityService, DumpRepository dumpRepository)
 {
     this.similarityService = similarityService;
     this.dumpRepository    = dumpRepository;
 }