Exemplo n.º 1
0
 /// <summary>
 /// Deletes the object using appropriate provider.
 /// </summary>
 protected override void DeleteObject()
 {
     CustomMetricInfoProvider.DeleteCustomMetricInfo(this);
 }
Exemplo n.º 2
0
 /// <summary>
 /// Updates the object using appropriate provider.
 /// </summary>
 protected override void SetObject()
 {
     CustomMetricInfoProvider.SetCustomMetricInfo(this);
 }
Exemplo n.º 3
0
        /// <summary>
        /// Generate metrics.
        /// </summary>
        /// <param name="metrics"></param>
        private void SetMetrics()
        {
            // Root category
            Metric root = AddMetric(MetricDataEnum.support_metrics, null);

            // Top level categories
            Metric system      = AddMetric(MetricDataEnum.support_metrics_system, root);
            Metric environment = AddMetric(MetricDataEnum.support_metrics_environment, root);
            Metric counters    = AddMetric(MetricDataEnum.support_metrics_counters, root);
            Metric tasks       = AddMetric(MetricDataEnum.support_metrics_tasks, root);
            Metric eventlog    = AddMetric(MetricDataEnum.support_metrics_eventlog, root);

            #region System

            AddMetric(MetricDataEnum.support_metrics_system_version, system);
            AddMetric(MetricDataEnum.support_metrics_system_appname, system);
            AddMetric(MetricDataEnum.support_metrics_system_instancename, system);
            AddMetric(MetricDataEnum.support_metrics_system_physicalpath, system);
            AddMetric(MetricDataEnum.support_metrics_system_apppath, system);
            AddMetric(MetricDataEnum.support_metrics_system_uiculture, system);
            AddMetric(MetricDataEnum.support_metrics_system_installtype, system);
            AddMetric(MetricDataEnum.support_metrics_system_portaltemplatepage, system);
            AddMetric(MetricDataEnum.support_metrics_system_timesinceapprestart, system);
            AddMetric(MetricDataEnum.support_metrics_system_discoveredassemblies, system);
            AddMetric(MetricDataEnum.support_metrics_system_targetframework, system);
            AddMetric(MetricDataEnum.support_metrics_system_authmode, system);
            AddMetric(MetricDataEnum.support_metrics_system_sessionmode, system);
            AddMetric(MetricDataEnum.support_metrics_system_debugmode, system);
            AddMetric(MetricDataEnum.support_metrics_system_runallmanagedmodules, system);

            #endregion System

            #region Environment

            AddMetric(MetricDataEnum.support_metrics_environment_trustlevel, environment);
            AddMetric(MetricDataEnum.support_metrics_environment_iisversion, environment);
            AddMetric(MetricDataEnum.support_metrics_environment_https, environment);
            AddMetric(MetricDataEnum.support_metrics_environment_windowsversion, environment);
            AddMetric(MetricDataEnum.support_metrics_environment_netversion, environment);
            AddMetric(MetricDataEnum.support_metrics_environment_sqlserverversion, environment);
            AddMetric(MetricDataEnum.support_metrics_environment_azure, environment);
            AddMetric(MetricDataEnum.support_metrics_environment_amazon, environment);
            AddMetric(MetricDataEnum.support_metrics_environment_services, environment);

            #endregion Environment

            #region Counters

            AddMetric(MetricDataEnum.support_metrics_counters_webfarmservers, counters);
            AddMetric(MetricDataEnum.support_metrics_counters_stagingservers, counters);
            AddMetric(MetricDataEnum.support_metrics_counters_pagemostchildren, counters);
            AddMetric(MetricDataEnum.support_metrics_counters_modules, counters);
            AddMetric(MetricDataEnum.support_metrics_counters_medialibraries, counters);
            AddMetric(MetricDataEnum.support_metrics_counters_activities, counters);
            AddMetric(MetricDataEnum.support_metrics_counters_contacts, counters);
            AddMetric(MetricDataEnum.support_metrics_counters_contactgroups, counters);
            AddMetric(MetricDataEnum.support_metrics_counters_omrules, counters);
            AddMetric(MetricDataEnum.support_metrics_counters_products, counters);

            #endregion Counters

            #region Tasks

            AddMetric(MetricDataEnum.support_metrics_tasks_webfarm, tasks);
            AddMetric(MetricDataEnum.support_metrics_tasks_staging, tasks);
            AddMetric(MetricDataEnum.support_metrics_tasks_integration, tasks);
            AddMetric(MetricDataEnum.support_metrics_tasks_scheduled, tasks);
            AddMetric(MetricDataEnum.support_metrics_tasks_search, tasks);
            AddMetric(MetricDataEnum.support_metrics_tasks_email, tasks);

            #endregion Tasks

            #region Event log

            AddMetric(MetricDataEnum.support_metrics_eventlog_macroerrors, eventlog);
            AddMetric(MetricDataEnum.support_metrics_eventlog_stagingerrors, eventlog);
            AddMetric(MetricDataEnum.support_metrics_eventlog_searcherrors, eventlog);
            AddMetric(MetricDataEnum.support_metrics_eventlog_contenterrors, eventlog);
            AddMetric(MetricDataEnum.support_metrics_eventlog_exceptions, eventlog);
            AddMetric(MetricDataEnum.support_metrics_eventlog_upgrade, eventlog);

            #endregion Event log

            var customMetrics = CustomMetricInfoProvider.GetCustomMetrics();

            if (customMetrics.Count > 0)
            {
                foreach (CustomMetricInfo cmi in customMetrics)
                {
                    switch (cmi.CustomMetricParent)
                    {
                    case MetricDataEnum.support_metrics_system:
                        AddMetric(cmi.CustomMetricDisplayName, system, cmi.CustomMetricAssemblyName, cmi.CustomMetricClassName, cmi.CustomMetricSelected);
                        break;

                    case MetricDataEnum.support_metrics_counters:
                        AddMetric(cmi.CustomMetricDisplayName, counters, cmi.CustomMetricAssemblyName, cmi.CustomMetricClassName, cmi.CustomMetricSelected);
                        break;

                    case MetricDataEnum.support_metrics_tasks:
                        AddMetric(cmi.CustomMetricDisplayName, tasks, cmi.CustomMetricAssemblyName, cmi.CustomMetricClassName, cmi.CustomMetricSelected);
                        break;

                    case MetricDataEnum.support_metrics_eventlog:
                        AddMetric(cmi.CustomMetricDisplayName, eventlog, cmi.CustomMetricAssemblyName, cmi.CustomMetricClassName, cmi.CustomMetricSelected);
                        break;

                    case MetricDataEnum.support_metrics_environment:
                    default:
                        // Fall back to Environment when the parent does not match
                        AddMetric(cmi.CustomMetricDisplayName, environment, cmi.CustomMetricAssemblyName, cmi.CustomMetricClassName, cmi.CustomMetricSelected);
                        break;
                    }
                }
            }
        }