コード例 #1
0
 public Measurement(string actionLabel, string actionDetails, long previousPrivateBytesKb)
 {
     _actionLabel            = actionLabel;
     _actionDetails          = actionDetails;
     _previousPrivateBytesKb = previousPrivateBytesKb;
     _start = new PerfPoint();
 }
コード例 #2
0
        public void Compare_3()
        {
            ppA = new PerfPoint(10, 5, false);
            ppB = new PerfPoint(3, 2, false);

            Assert.AreEqual(1, ppA.Compare(ppA, ppB));
        }
コード例 #3
0
        public void Compare_1()
        {
            ppA = new PerfPoint((2 * Math.Sqrt(2)) / 2, 6, false);
            ppB = new PerfPoint((Math.Sqrt(2) / 2) * 2, 7, true);

            Assert.AreEqual(0, ppA.Compare(ppA, ppB));
        }
コード例 #4
0
        public void areColocated_2()
        {
            ppA = new PerfPoint((2 * Math.Sqrt(2)) / 2, 6, false);
            ppB = new PerfPoint((Math.Sqrt(2) / 2) * 2, 7, true);

            Assert.IsTrue(PerfPoint.areColocated(ppA, ppB));
        }
コード例 #5
0
        public void areColocated_1()
        {
            ppA = new PerfPoint(1, 5, false);
            ppB = new PerfPoint(3, 2, false);

            Assert.IsFalse(PerfPoint.areColocated(ppA, ppB));
        }
コード例 #6
0
 public void Finish()
 {
     try
     {
         _end = new PerfPoint();
     }
     catch (Exception e)
     {
         // The OS can get into a state where we can't load performance counters (BL-10689).
         // If we're in such a state, just don't report performance.
         Logger.WriteError("Failed to create Measurement", e);
         // Reporting on the measurement will indicate failure if _end stays null
     }
 }
コード例 #7
0
 public Measurement(string actionLabel, string actionDetails, long previousPrivateBytesKb)
 {
     _actionLabel            = actionLabel;
     _actionDetails          = actionDetails;
     _previousPrivateBytesKb = previousPrivateBytesKb;
     try
     {
         _start = new PerfPoint();
     }
     catch (Exception e)
     {
         // The OS can get into a state where we can't load performance counters (BL-10689).
         // If we're in such a state, just don't report performance.
         Logger.WriteError("Failed to create PerfPoint", e);
         // Reporting will do the right thing if _start is null
     }
 }
コード例 #8
0
        public void getIndexOf_1()
        {
            PerfSerie ps  = new PerfSerie();
            PerfPoint pp1 = new PerfPoint(1, 5, true);
            PerfPoint pp2 = new PerfPoint(-5, 1, true);
            PerfPoint pp3 = new PerfPoint(-1, 15, false);
            PerfPoint pp4 = new PerfPoint(8, 6, false);

            ps.add(pp1);
            ps.add(pp2);
            ps.add(pp3);
            ps.add(pp4);

            Assert.AreEqual(0, ps.getIndexOf(pp2));
            Assert.AreEqual(1, ps.getIndexOf(pp3));
            Assert.AreEqual(2, ps.getIndexOf(pp1));
            Assert.AreEqual(3, ps.getIndexOf(pp4));
        }
コード例 #9
0
        public void selectedCount_1()
        {
            PerfSerie ps  = new PerfSerie();
            PerfPoint pp1 = new PerfPoint(1, 5, true);
            PerfPoint pp2 = new PerfPoint(-5, 1, true);
            PerfPoint pp3 = new PerfPoint(-1, 15, false);
            PerfPoint pp4 = new PerfPoint(8, 6, false);
            PerfPoint pp5 = new PerfPoint(3, 10, false);

            ps.add(pp1);
            ps.add(pp2);
            ps.add(pp3);
            ps.add(pp4);
            ps.add(pp5);
            pp3.selected = true;
            pp4.selected = true;

            Assert.AreEqual(2, ps.selectedCount());
        }
コード例 #10
0
 public void Finish()
 {
     _end = new PerfPoint();
 }