示例#1
0
       function () {
      var TRACE_NAME = 'Custom/Test06'
        , SLEEP_DURATION = 43
        , tt = new Transaction(agent)
        ;

      tt.measure(TRACE_NAME, null, SLEEP_DURATION);
      tt.measure(TRACE_NAME, null, SLEEP_DURATION - 5);

      var statistics = tt.metrics.getMetric(TRACE_NAME);
      expect(statistics.callCount).to.equal(2);
      expect(statistics.max).above((SLEEP_DURATION - 1) / 1000);
    });
示例#2
0
    it("should add metrics by name", function () {
      var tt = new Transaction(agent);

      tt.measure('Custom/Test01');
      should.exist(tt.metrics.getMetric('Custom/Test01'));

      tt.end();
    });
示例#3
0
    it("should allow manual setting of metric durations", function () {
      var tt = new Transaction(agent);

      tt.measure('Custom/Test16', null, 65);
      tt.end();

      var metrics = tt.metrics.getMetric('Custom/Test16');
      expect(metrics.total).equal(0.065);
    });