{"id":18286849,"url":"https://github.com/khesualdo/analytics-engine-manager","last_synced_at":"2025-04-09T06:26:55.779Z","repository":{"id":91122613,"uuid":"163038135","full_name":"khesualdo/Analytics-Engine-Manager","owner":"khesualdo","description":":bar_chart: :chart_with_upwards_trend: :chart_with_downwards_trend: Architecture design and implementation for an analytics engine manager. Incorporates the extensibility and reusability software design principles to allow the addition of new analytics engines. The code is also testable and comes with a suite of unit tests.","archived":false,"fork":false,"pushed_at":"2019-03-01T03:02:53.000Z","size":2456,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-12-22T21:44:50.502Z","etag":null,"topics":["analytics","analytics-engine-manager","application-insights","application-insights-sdk","asynchronous","asynchronous-programming","azure","azure-application-insights","csharp","dotnet","events","loggin-manager","logging","microsoft","track-event","uml","uml-diagram"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/khesualdo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2018-12-25T02:28:56.000Z","updated_at":"2024-02-12T08:55:53.000Z","dependencies_parsed_at":null,"dependency_job_id":"b2f310b3-4038-43ef-9aa7-e386b8446a56","html_url":"https://github.com/khesualdo/Analytics-Engine-Manager","commit_stats":null,"previous_names":["khesualdo/analytics-engine-manager"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khesualdo%2FAnalytics-Engine-Manager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khesualdo%2FAnalytics-Engine-Manager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khesualdo%2FAnalytics-Engine-Manager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khesualdo%2FAnalytics-Engine-Manager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/khesualdo","download_url":"https://codeload.github.com/khesualdo/Analytics-Engine-Manager/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238930065,"owners_count":19554122,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["analytics","analytics-engine-manager","application-insights","application-insights-sdk","asynchronous","asynchronous-programming","azure","azure-application-insights","csharp","dotnet","events","loggin-manager","logging","microsoft","track-event","uml","uml-diagram"],"created_at":"2024-11-05T13:22:31.550Z","updated_at":"2025-02-15T00:47:18.569Z","avatar_url":"https://github.com/khesualdo.png","language":"C#","readme":"# :cyclone: :bar_chart: :chart_with_upwards_trend: :chart_with_downwards_trend: Analytics Engine Manager\n\nArchitecture design and implementation for an analytics engine manager. Incorporates the extensibility and reusability software design principles to allow the addition of new analytics engines. The code is also testable and comes with a suite of unit tests.\n\nAn analytics engine provides the means of logging and propagating an event to the cloud. The code has a working example using Azure Application Insights.\n\n# Design Diagram\n![](Diagrams/Design-Diagram.png)\n\n# Detailed Design Diagram\n![](Diagrams/Detailed-Design-Diagram.png)\n\n# How To Run\n\n\u003e Set `ApplicationInsightsInstrumentationKey` in `App.config` to the resource instrumentation key.\n\n\n\u003e Set `ApplicationInsights` in `App.config` to `true` if tracking events, `false` otherwise.\n\n### Packages\n\n```\nInstall-Package Microsoft.ApplicationInsights -Version 2.8.1\n```\n\n### With a Dependency Injection Framework\nThis would require you to register the following mappings to the DI container:\n- `ICustomConfigurationManager` to `CustomConfigurationManager`\n- `IAnalyticsEnginesFactory` to `AnalyticsEnginesFactory`\n- `IAnalyticsEventProcessor` to `AnalyticsEventProcessor`\n\n\u003e Making them a singleton would mean that only a single object is created per project, this is fine, however, if Analytics Engine Manager, for example, is used by multiple endpoints, then all endpoints are dependent on a single resource. Usually this is not ideal.\n\n```C#\nstring eventName = \"\";\nstring userID = \"\";\nstring remoteIPAddress = \"\";\n\nIAnalyticsEvent analyticsEvent = new AnalyticsEvent(eventName, userID, remoteIpAddress);\nAnalyticsEventProcessor.LogEvent(analyticsEvent);\n```\n\n### Without a Dependency Injection Framework\n```C#\nstring eventName = \"\";\nstring userID = \"\";\nstring remoteIPAddress = \"\";\n\nIAnalyticsEvent analyticsEvent = new AnalyticsEvent(eventName, userID, remoteIpAddress);\n\nICustomConfigurationManager analyticsConfigurationManager = new CustomConfigurationManager();\nIAnalyticsEnginesFactory analyticsEnginesFactory = new AnalyticsEnginesFactory();\nIAnalyticsEventProcessor analyticsEventProcessor = new AnalyticsEventProcessor(analyticsConfigurationManager, analyticsEnginesFactory);\n\nanalyticsEventProcessor.LogEvent(analyticsEvent);\n```\n\n# How To Add a New Analytics Engine\nFirst, create a concrete class for the new Analytics Engine.\n```C#\n/// \u003csummary\u003e\n/// Create a concrete class for the new Analytics Engine.\n/// Implement the IAnalyticsEngine interface.\n/// \u003c/summary\u003e\npublic class MyAnalyticsEngine : IAnalyticsEngine\n{\n    public string GetAnalyticsEngineName { get; private set; }\n\n    public void SendEvent(IAnalyticsEvent analyticsEvent)\n    {\n        // Send analyticsEvent to the cloud.\n    }\n}\n```\n\nSecond, add the new concrete class to `AnalyticsEnginesFactory`.\n```C#\npublic class AnalyticsEnginesFactory : IAnalyticsEnginesFactory\n{\n    public List\u003cIAnalyticsEngine\u003e CreateAnalyticsEngines(ICustomConfigurationManager analyticsConfigurationManager)\n    {\n        List\u003cIAnalyticsEngine\u003e analyticsEngines = new List\u003cIAnalyticsEngine\u003e();\n        analyticsEngines.Add(new ApplicationInsightsAnalyticsEngine(analyticsConfigurationManager));\n\n        // Add an instance of the new concrete class to the list of Analytics Engines\n        analyticsEngines.Add(new MyAnalyticsEngine(analyticsConfigurationManager));\n\n        return analyticsEngines;\n    }\n}\n\n```\n\n# Kudos\n- [What is Application Insights?](https://docs.microsoft.com/en-us/azure/application-insights/app-insights-overview)\n- [Application Insights for .NET console applications](https://docs.microsoft.com/en-us/azure/application-insights/application-insights-console)\n- [Application Insights API for custom events and metrics](https://docs.microsoft.com/en-us/azure/azure-monitor/app/api-custom-events-metrics)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkhesualdo%2Fanalytics-engine-manager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkhesualdo%2Fanalytics-engine-manager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkhesualdo%2Fanalytics-engine-manager/lists"}