コード例 #1
0
        private EventData GetAppStatsEventData()
        {
            var e = new AppStatsEvent
            {
                MasterPeerCount = this.PeerCountMaster,
                PlayerCount     = this.PeerCountGameServer,
                GameCount       = this.GameCount
            };

            return(new EventData((byte)EventCode.AppStats, e));
        }
コード例 #2
0
        public void Publish(AppStatsEvent stat)
        {
            Guard.AgainstNull(stat);
            Guard.AgainstEmpty(stat.CheckId);

            var result = new HealthCheckResultNotification
            {
                MinuteBucket = stat.MinuteBucket,
                HourBucket   = stat.HourBucket,
                DayBucket    = stat.DayBucket,
                EventType    = "AppStat",
                Agent        = new AgentInfo
                {
                    SiteId  = stat.SiteId,
                    AgentId = stat.AgentId
                },
                Check = new HealthCheckData
                {
                    Duration = stat.Duration ?? TimeSpan.Zero,
                    Identity = new PluginDescriptor
                    {
                        Name = stat.CheckId
                    },
                    ResultCount = stat.ResultCount,
                    Tags        = stat.Tag
                }
            };

            if (string.IsNullOrEmpty(myDestinationQueue))
            {
                myBus.Send(result);
            }
            else
            {
                myBus.Send(myDestinationQueue, result);
            }
        }
コード例 #3
0
 public static IAppStatsPieChartContinuation <AppStatsEvent> PieChart(this AppStatsEvent stat, string id)
 {
     stat.CheckId = id;
     return(stat);
 }