Ejemplo n.º 1
0
        protected override void OnEventWritten(EventWrittenEventArgs eventData)
        {
            if (eventData.EventId == EventGcSuspendBegin)
            {
                _gcStart = eventData.TimeStamp;
            }
            else if (eventData.EventId == EventGcRestartEnd)
            {
                var start = _gcStart;

                if (start != null)
                {
                    GcPauseTime?.Invoke(eventData.TimeStamp - start.Value);
                }
            }
            else if (eventData.EventId == EventGcHeapStats)
            {
                GcHeapStats?.Invoke(HeapStats.FromPayload(eventData.Payload));
            }
            else if (eventData.EventId == EventContentionStop)
            {
                Contention?.Invoke((double)eventData.Payload[2]);
            }
            else if (eventData.EventId == EventGcGlobalHeapHistory)
            {
                GcHeapHistory?.Invoke(HeapHistory.FromPayload(eventData.Payload));
            }
        }
        public String SaveContention(Contention c)
        {
            FinancialERPDAL finanDal = new FinancialERPDAL();

            finanDal.Contentions.Add(c);
            finanDal.SaveChanges();
            return("提交成功");
        }
Ejemplo n.º 3
0
        public async Task <IActionResult> CreateCPUDatapoint([FromBody] Contention c)
        {
            Contention point = new Contention
            {
                type      = c.type,
                timestamp = c.timestamp.ToUniversalTime(),
            };

            _MetricContext.Contention.Add(point);
            await _MetricContext.SaveChangesAsync();

            return(CreatedAtAction("CPU Data Created", new { date = point.timestamp }, null));
        }
Ejemplo n.º 4
0
        public ActionResult AddTitle(Title t, Contention c)
        {
            ContentionBusinessLayer cbl = new ContentionBusinessLayer();

            string s   = System.Web.HttpContext.Current.Session["UserID"].ToString();
            int    UID = int.Parse(s);

            t.TDate         = DateTime.Now;
            t.UserID        = UID;
            c.TitleID       = cbl.SaveTitle(t);
            c.UserID        = t.UserID;
            c.CDate         = t.TDate;
            c.CIsFirstFloor = true;
            cbl.SaveContention(c);
            return(RedirectToAction("Title"));
        }
Ejemplo n.º 5
0
        public ActionResult AddContention(int titleID, String Reply)
        {
            ContentionBusinessLayer cbl = new ContentionBusinessLayer();

            string s   = System.Web.HttpContext.Current.Session["UserID"].ToString();
            int    UID = int.Parse(s);

            Contention c = new Contention();

            c.CDate         = DateTime.Now;
            c.Contentions   = Reply;
            c.TitleID       = titleID;
            c.UserID        = UID;
            c.CIsFirstFloor = false;

            cbl.SaveContention(c);
            return(Redirect("/Contention/Contention/" + titleID.ToString()));
        }
Ejemplo n.º 6
0
        public async Task <IActionResult> GetContentionDataByTime(DateTime d, Session sess)
        {
            Contention point = await _MetricContext.Contention.SingleOrDefaultAsync(cont => (cont.timestamp.ToUniversalTime() == d.ToUniversalTime() && sess.Id == cont.AppId));

            return(Ok(point));
        }
 // Constructor that will take in values that are taken from Http_Request to make
 // a Detailed_Http_Request object.
 public Client_Contention(Contention c)
 {
     this.StartTimestamp = c.timestamp; //will always be the start time when using this constructor
 }