Example #1
0
 public override void LogNodeHealthEvent(NodeEntity node, EntityHealthEvent healthEvent)
 {
     AppendHealthEventToFile(
         string.Format(
             "LogNodeHealthEvent: ClusterName: {0}, NodeName: {1}",
             node.ClusterName,
             node.NodeName),
         healthEvent);
 }
Example #2
0
 public override void LogClusterHealthEvent(
     ClusterEntity cluster, EntityHealthEvent healthEvent)
 {
     AppendHealthEventToFile(
         string.Format(
             "LogClusterHealthEvent: ClusterName: {0}",
             cluster.ClusterName),
         healthEvent);
 }
 public override void EmitAppHealthEvent(
     ApplicationEntity app, EntityHealthEvent healthEvent)
 {
     AppendHealthEventToFile(
         string.Format(
             "appHealthEventMetric: ClusterName: {0}, AppName: {1}",
             app.ClusterName,
             app.ApplicationName),
         healthEvent);
 }
 public override void EmitDeployedAppHealthEvent(
     DeployedApplicationEntity deployedApp, EntityHealthEvent healthEvent)
 {
     AppendHealthEventToFile(
         string.Format(
             "deployedAppHealthEventMetric: ClusterName: {0}, AppName: {1}, NodeName: {2}",
             deployedApp.ClusterName,
             deployedApp.ApplicationName,
             deployedApp.NodeName),
         healthEvent);
 }
Example #5
0
 public override void LogServiceHealthEvent(
     ServiceEntity service, EntityHealthEvent healthEvent)
 {
     AppendHealthEventToFile(
         string.Format(
             "LogServiceHealthEvent: ClusterName: {0}, AppName: {1}, ServiceName: {2}",
             service.ClusterName,
             service.ApplicationName,
             service.ServiceName),
         healthEvent);
 }
Example #6
0
 public virtual void LogNodeHealthEvent(NodeEntity node, EntityHealthEvent healthEvent)
 {
     MonitoringEventSource.Current.LogNodeHealthEvent(
         node.ClusterName,
         node.NodeName,
         healthEvent.HealthState.ToString(),
         healthEvent.Description,
         healthEvent.Property,
         healthEvent.SequenceNumber.ToString(),
         healthEvent.SourceId,
         healthEvent.IsExpired.ToString());
 }
Example #7
0
 public virtual void LogApplicationHealthEvent(ApplicationEntity application, EntityHealthEvent healthEvent)
 {
     MonitoringEventSource.Current.LogApplicationHealthEvent(
         application.ClusterName,
         application.ApplicationName,
         healthEvent.HealthState.ToString(),
         healthEvent.Description,
         healthEvent.Property,
         healthEvent.SequenceNumber.ToString(),
         healthEvent.SourceId,
         healthEvent.IsExpired.ToString());
 }
Example #8
0
    private void EntityHealth(IHealthTrackingEntity entity, int delta, bool heal, bool attack, bool regen)
    {
        EntityHealthEvent evt = CreateEvent <EntityHealthEvent>();

        evt.name     = entity.Name;
        evt.isPlayer = true;
        evt.isHeal   = heal;
        evt.isAttack = attack;
        evt.isRegen  = regen;
        evt.delta    = delta;
        AddEvent(evt);
    }
 public override void EmitDeployedServicePackageHealthEvent(
     DeployedServicePackageEntity deployedServicePackage, EntityHealthEvent healthEvent)
 {
     AppendHealthEventToFile(
         string.Format(
             "deployedServicePackageHealthEventMetric: ClusterName: {0}, AppName: {1}, ServiceManifestName: {2}, NodeName: {3}",
             deployedServicePackage.ClusterName,
             deployedServicePackage.ApplicationName,
             deployedServicePackage.ServiceManifestName,
             deployedServicePackage.NodeName),
         healthEvent);
 }
Example #10
0
 public virtual void LogClusterHealthEvent(
     ClusterEntity cluster, EntityHealthEvent healthEvent)
 {
     MonitoringEventSource.Current.LogClusterHealthEvent(
         cluster.ClusterName,
         healthEvent.HealthState.ToString(),
         healthEvent.Description,
         healthEvent.Property,
         healthEvent.SequenceNumber.ToString(),
         healthEvent.SourceId,
         healthEvent.IsExpired.ToString());
 }
Example #11
0
 public override void LogDeployedApplicationHealthEvent(
     DeployedApplicationEntity deployedApplication,
     EntityHealthEvent healthEvent)
 {
     AppendHealthEventToFile(
         string.Format(
             "LogDeployedApplicationHealthEvent: ClusterName: {0}, AppName: {1}, NodeName: {2}",
             deployedApplication.ClusterName,
             deployedApplication.ApplicationName,
             deployedApplication.NodeName),
         healthEvent);
 }
Example #12
0
 public override void LogPartitionHealthEvent(
     PartitionEntity partition, EntityHealthEvent healthEvent)
 {
     AppendHealthEventToFile(
         string.Format(
             "LogPartitionHealthEvent: ClusterName: {0}, AppName: {1}, ServiceName: {2}, PartitionId: {3}",
             partition.ClusterName,
             partition.ApplicationName,
             partition.ServiceName,
             partition.PartitionId.ToString()),
         healthEvent);
 }
Example #13
0
 public override void LogReplicaHealthEvent(
     ReplicaEntity replica, EntityHealthEvent healthEvent)
 {
     AppendHealthEventToFile(
         string.Format(
             "LogReplicaHealthEvent: ClusterName: {0}, AppName: {1}, ServiceName: {2}, PartitionId: {3}, ReplicaId: {4}",
             replica.ClusterName,
             replica.ApplicationName,
             replica.ServiceName,
             replica.PartitionId.ToString(),
             replica.ReplicaId.ToString()),
         healthEvent);
 }
        private static void AppendHealthEventToFile(string stringToLog, EntityHealthEvent healthEvent)
        {
            var eventString = string.Format(
                "HealthState: {0}, Property: {1}, SourceId: {2}, IsExpired: {3}",
                healthEvent.HealthState.ToString(),
                healthEvent.Property,
                healthEvent.SourceId,
                healthEvent.IsExpired.ToString());

            var finalString = string.Format("{0}, {1}", stringToLog, eventString);

            File.AppendAllLines(MetricsFileName, new string[] { finalString });
        }
Example #15
0
 public virtual void LogServiceHealthEvent(
     ServiceEntity service, EntityHealthEvent healthEvent)
 {
     MonitoringEventSource.Current.LogServiceHealthEvent(
         service.ClusterName,
         service.ApplicationName,
         service.ServiceName,
         healthEvent.HealthState.ToString(),
         healthEvent.Description,
         healthEvent.Property,
         healthEvent.SequenceNumber.ToString(),
         healthEvent.SourceId,
         healthEvent.IsExpired.ToString());
 }
Example #16
0
 public virtual void LogReplicaHealthEvent(
     ReplicaEntity replica, EntityHealthEvent healthEvent)
 {
     MonitoringEventSource.Current.LogReplicaHealthEvent(
         replica.ClusterName,
         replica.ApplicationName,
         replica.ServiceName,
         replica.PartitionId.ToString(),
         replica.ReplicaId.ToString(),
         healthEvent.HealthState.ToString(),
         healthEvent.Description,
         healthEvent.Property,
         healthEvent.SequenceNumber.ToString(),
         healthEvent.SourceId,
         healthEvent.IsExpired.ToString());
 }
Example #17
0
 public virtual void LogDeployedServicePackageHealthEvent(
     DeployedServicePackageEntity deployedServicePackage,
     EntityHealthEvent healthEvent)
 {
     MonitoringEventSource.Current.LogDeployedServicePackageHealthEvent(
         deployedServicePackage.ClusterName,
         deployedServicePackage.ApplicationName,
         deployedServicePackage.ServiceManifestName,
         deployedServicePackage.NodeName,
         healthEvent.HealthState.ToString(),
         healthEvent.Description,
         healthEvent.Property,
         healthEvent.SequenceNumber.ToString(),
         healthEvent.SourceId,
         healthEvent.IsExpired.ToString());
 }
Example #18
0
        public virtual void EmitClusterHealthEvent(
            ClusterEntity cluster, EntityHealthEvent healthEvent)
        {
            if (!this.isMetricsEnabled)
            {
                return;
            }

            this.clusterHealthEventMetric.LogValue(
                1,
                cluster.ClusterName,
                healthEvent.HealthState.ToString(),
                healthEvent.SourceId,
                healthEvent.Property,
                healthEvent.IsExpired.ToString());
        }
Example #19
0
        public virtual void EmitAppHealthEvent(
            ApplicationEntity app, EntityHealthEvent healthEvent)
        {
            if (!this.isMetricsEnabled)
            {
                return;
            }

            this.appHealthEventMetric.LogValue(
                1,
                app.ClusterName,
                app.ApplicationName,
                healthEvent.HealthState.ToString(),
                healthEvent.SourceId,
                healthEvent.Property,
                healthEvent.IsExpired.ToString());
        }
Example #20
0
        public virtual void EmitNodeHealthEvent(
            NodeEntity node, EntityHealthEvent healthEvent)
        {
            if (!this.isMetricsEnabled)
            {
                return;
            }

            this.nodeHealthEventMetric.LogValue(
                1,
                node.ClusterName,
                node.NodeName,
                healthEvent.HealthState.ToString(),
                healthEvent.SourceId,
                healthEvent.Property,
                healthEvent.IsExpired.ToString());
        }
Example #21
0
        public virtual void EmitServiceHealthEvent(
            ServiceEntity service, EntityHealthEvent healthEvent)
        {
            if (!this.isMetricsEnabled)
            {
                return;
            }

            this.serviceHealthEventMetric.LogValue(
                1,
                service.ClusterName,
                service.ApplicationName,
                service.ServiceName,
                healthEvent.HealthState.ToString(),
                healthEvent.SourceId,
                healthEvent.Property,
                healthEvent.IsExpired.ToString());
        }
Example #22
0
        public virtual void EmitDeployedServicePackageHealthEvent(
            DeployedServicePackageEntity deployedServicePackage, EntityHealthEvent healthEvent)
        {
            if (!this.isMetricsEnabled)
            {
                return;
            }

            this.deployedServicePackageHealthEventMetric.LogValue(
                1,
                deployedServicePackage.ClusterName,
                deployedServicePackage.ApplicationName,
                deployedServicePackage.ServiceManifestName,
                deployedServicePackage.NodeName,
                healthEvent.HealthState.ToString(),
                healthEvent.SourceId,
                healthEvent.Property,
                healthEvent.IsExpired.ToString());
        }
Example #23
0
        public virtual void EmitPartitionHealthEvent(
            PartitionEntity partition, EntityHealthEvent healthEvent)
        {
            if (!this.isMetricsEnabled)
            {
                return;
            }

            this.partitionHealthEventMetric.LogValue(
                1,
                partition.ClusterName,
                partition.ApplicationName,
                partition.ServiceName,
                partition.PartitionId.ToString(),
                healthEvent.HealthState.ToString(),
                healthEvent.SourceId,
                healthEvent.Property,
                healthEvent.IsExpired.ToString());
        }
Example #24
0
        public virtual void EmitReplicaHealthEvent(
            ReplicaEntity replica, EntityHealthEvent healthEvent)
        {
            if (!this.isMetricsEnabled)
            {
                return;
            }

            this.replicaHealthEventMetric.LogValue(
                1,
                replica.ClusterName,
                replica.ApplicationName,
                replica.ServiceName,
                replica.PartitionId.ToString(),
                replica.ReplicaId.ToString(),
                healthEvent.HealthState.ToString(),
                healthEvent.SourceId,
                healthEvent.Property,
                healthEvent.IsExpired.ToString());
        }
Example #25
0
 public override void LogApplicationHealthEvent(ApplicationEntity application, EntityHealthEvent healthEvent)
 {
     AppendHealthEventToFile(
         string.Format(
             "LogApplicationHealthEvent: ClusterName: {0}, AppName: {1}",
             application.ClusterName,
             application.ApplicationName),
         healthEvent);
 }