/// <summary>
        /// Initializes a new instance of the <see cref="RingMasterServerInstrumentation"/> class.
        /// </summary>
        /// <param name="metricsFactory">Metrics factory for getting notification of internal state</param>
        public RingMasterServerInstrumentation(IMetricsFactory metricsFactory)
        {
            if (metricsFactory == null)
            {
                throw new ArgumentNullException(nameof(metricsFactory));
            }

            this.sessionCreated  = metricsFactory.Create1D(nameof(this.sessionCreated), "client");
            this.sessionClosed   = metricsFactory.Create1D(nameof(this.sessionClosed), "client");
            this.responseTime    = metricsFactory.Create1D(nameof(this.responseTime), "requestType");
            this.badRequests     = metricsFactory.Create0D(nameof(this.badRequests));
            this.watcherSet      = metricsFactory.Create0D(nameof(this.watcherSet));
            this.watcherNotified = metricsFactory.Create0D(nameof(this.watcherNotified));
        }
Exemplo n.º 2
0
 public WatcherPerformanceInstrumentation(IMetricsFactory metricsFactory)
 {
     this.nodesLoaded         = metricsFactory.Create0D("watcherPerformanceTestNodesLoaded");
     this.setWatcherFailed    = metricsFactory.Create0D("setWatcherFailed");
     this.setWatcherSucceeded = metricsFactory.Create0D("setWatcherSucceded");
     this.setWatcherLatencyMs = metricsFactory.Create0D("setWatcherLatencyMs");
     this.watcherNotified     = metricsFactory.Create1D("watcherNotified", "notificationType");
 }
Exemplo n.º 3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="RingMasterWatchdog"/> class.
        /// </summary>
        /// <param name="context">Service context</param>
        /// <param name="metricsFactory">Metric factory for MDM</param>
        public RingMasterWatchdog(StatelessServiceContext context, IMetricsFactory metricsFactory)
            : base(context)
        {
            if (metricsFactory == null)
            {
                throw new ArgumentNullException(nameof(metricsFactory));
            }

            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }

            System.Diagnostics.Contracts.Contract.EndContractBlock();

            this.ringMasterWatchdogTestSucceeded = metricsFactory.Create1D(nameof(this.ringMasterWatchdogTestSucceeded), "testName");
            this.ringMasterServiceUri            = new Uri($"{context.CodePackageActivationContext.ApplicationName}/RingMasterService");
        }
Exemplo n.º 4
0
 private static void InitializeMetrics()
 {
     operationDurationMetrics = metricsFactory.Create1D(MdmConstants.OperationDuration, nameof(OperationType));
     bytesProcessedMetrics    = metricsFactory.Create1D(MdmConstants.BytesProcessed, nameof(OperationType));
     watcherCountMatrics      = metricsFactory.Create1D(MdmConstants.WatcherCountProcessed, nameof(OperationType));
 }
Exemplo n.º 5
0
        /// <summary>
        /// Initializes a new instance of the <see cref="RingMasterBackendInstrumentation"/> class.
        /// </summary>
        /// <param name="metricsFactory">Interface that can be used to create metrics</param>
        public RingMasterBackendInstrumentation(IMetricsFactory metricsFactory)
        {
            if (metricsFactory == null)
            {
                throw new ArgumentNullException(nameof(metricsFactory));
            }

            this.badRequests        = metricsFactory.Create0D("badRequests");
            this.committed          = metricsFactory.Create0D("committed");
            this.newRequests        = metricsFactory.Create1D("newRequests", Dimensions.RequestType);
            this.requestsExecuting  = metricsFactory.Create1D("requestsExecuting", Dimensions.RequestType);
            this.requestsInQueue    = metricsFactory.Create1D("requestsInQueue", Dimensions.RequestType);
            this.responseTime       = metricsFactory.Create1D("responseTime", Dimensions.RequestType);
            this.sessions           = metricsFactory.Create1D("sessions", Dimensions.Client);
            this.activeSessions     = metricsFactory.Create0D("activeSessions");
            this.sslvalidations     = metricsFactory.Create1D("sslvalidationsPassed", Dimensions.Client);
            this.connectionsRefused = metricsFactory.Create1D("connectionsRefused", Dimensions.Client);
            this.sslErrors          = metricsFactory.Create1D("sslvalidationErrors", Dimensions.Client);
            this.dataSize           = metricsFactory.Create1D("dataSize", Dimensions.NodeType);
            this.totalCount         = metricsFactory.Create1D("totalCount", Dimensions.NodeType);
            this.alertableFailures  = metricsFactory.Create1D("alertableFailures", Dimensions.FailureType);

            this.startupTime = metricsFactory.Create1D("startupTime", Dimensions.Process);

            this.loadStateTimes = metricsFactory.Create0D("loadStateTimes");
            this.saveStateTimes = metricsFactory.Create0D("saveStateTimes");

            this.loadStateCount = metricsFactory.Create0D("loadStateCount");
            this.saveStateCount = metricsFactory.Create0D("saveStateCount");

            this.bulkWatchersCount = metricsFactory.Create1D("bulkWatchersCount", Dimensions.SessionId);

            this.bulkWatcherExecutionBacklogCount = metricsFactory.Create0D("bulkWatcherExecutionBacklogCount");
            this.authFailuresCount = metricsFactory.Create1D("authFailuresCount", Dimensions.SessionData);

            this.lostParent  = metricsFactory.Create0D("lostParent");
            this.orphanFound = metricsFactory.Create0D("orphanFound");
            this.lostChild   = metricsFactory.Create0D("lostChild");

            this.transactionManagerBatchApplied       = metricsFactory.Create0D("transactionManagerBatchApplied");
            this.transactionManagerTransactionApplied = metricsFactory.Create0D("transactionManagerTransactionApplied");
            this.incorrectExternalTransactionId       = metricsFactory.Create0D("incorrectExternalTransactionId");

            this.scheduledCommandFinished = metricsFactory.Create1D("scheduledCommandFinished", Dimensions.CompletionStatus);
            this.scheduledCommandQueued   = metricsFactory.Create0D("scheduledCommandQueued");
            this.scheduledCommandFinishedTimesMilliseconds = metricsFactory.Create0D("scheduledCommandFinishedTimesMilliseconds");

            this.lockDownAccess     = metricsFactory.Create2D("lockDownAccess", Dimensions.NodePath, Dimensions.AccessMode);
            this.lockDownEvents     = metricsFactory.Create1D("lockDownEvents", Dimensions.NodePath);
            this.fullLockDownEvents = metricsFactory.Create0D("fullLockDownEvents");

            this.uptime        = metricsFactory.Create1D("uptime", Dimensions.Version);
            this.isPrimary     = metricsFactory.Create1D("isPrimary", Dimensions.Version);
            this.timeAsPrimary = metricsFactory.Create0D("timeAsPrimary");

            this.appliedTxId   = metricsFactory.Create0D("appliedTxId");
            this.appliedTxTime = metricsFactory.Create0D("appliedTxTime");

            this.subtreeMeasurement  = metricsFactory.Create2D("subtreeMeasurement", Dimensions.NodePath, Dimensions.TransactionId);
            this.treeMeasurementTime = metricsFactory.Create1D("treeMeasurementTime", Dimensions.TransactionId);

            this.unexpectedException = metricsFactory.Create2D("unexpectedException", Dimensions.Component, Dimensions.ExceptionType);

            this.replicaHasCheckpointCoordinationEnabled = metricsFactory.Create0D("replicaHasCheckpointCoordinationEnabled");
            this.replicaHasCheckpointLease = metricsFactory.Create0D("replicaHasCheckpointLease");
            this.replicaIsTakingCheckpoint = metricsFactory.Create0D("replicaIsTakingCheckpoint");
            this.replicaFinishedCheckpoint = metricsFactory.Create0D("replicaFinishedCheckpoint");

            this.acquireLock = metricsFactory.Create3D("acquireLock", "ReadOnly", "Succeeded", "Level");

            this.responseWaitForReplication = metricsFactory.Create0D("responseWaitForReplication");
        }