Examples of Span


Examples of cloudtrace.instrument.Span

          containsMetadataTablet = true;
     
      if (!containsMetadataTablet && us.queuedMutations.size() > 0)
        TabletServer.this.resourceManager.waitUntilCommitsAreEnabled();
     
      Span prep = Trace.start("prep");
      for (Entry<Tablet,? extends List<Mutation>> entry : us.queuedMutations.entrySet()) {
       
        Tablet tablet = entry.getKey();
        List<Mutation> mutations = entry.getValue();
        if (mutations.size() > 0) {
          try {
            if (updateMetrics.isEnabled())
              updateMetrics.add(TabletServerUpdateMetrics.mutationArraySize, mutations.size());
           
            CommitSession commitSession = tablet.prepareMutationsForCommit(mutations);
            if (commitSession == null) {
              if (us.currentTablet == tablet) {
                us.currentTablet = null;
              }
              us.failures.put(tablet.getExtent(), us.successfulCommits.get(tablet));
            } else {
              sendables.put(commitSession, mutations);
              mutationCount += mutations.size();
            }
           
          } catch (TConstraintViolationException e) {
            us.violations.add(e.getViolations());
            if (updateMetrics.isEnabled())
              updateMetrics.add(TabletServerUpdateMetrics.constraintViolations, 0);
           
            if (e.getNonViolators().size() > 0) {
              // only log and commit mutations if there were some that did not
              // violate constraints... this is what prepareMutationsForCommit()
              // expects
              sendables.put(e.getCommitSession(), e.getNonViolators());
            }
           
            mutationCount += mutations.size();
           
          } catch (HoldTimeoutException t) {
            error = t;
            log.debug("Giving up on mutations due to a long memory hold time");
            break;
          } catch (Throwable t) {
            error = t;
            log.error("Unexpected error preparing for commit", error);
            break;
          }
        }
      }
      prep.stop();
     
      Span wal = Trace.start("wal");
      long pt2 = System.currentTimeMillis();
      long avgPrepareTime = (long) ((pt2 - pt1) / (double) us.queuedMutations.size());
      us.prepareTimes.addStat(pt2 - pt1);
      if (updateMetrics.isEnabled())
        updateMetrics.add(TabletServerUpdateMetrics.commitPrep, (avgPrepareTime));
     
      if (error != null) {
        for (Entry<CommitSession,List<Mutation>> e : sendables.entrySet()) {
          e.getKey().abortCommit(e.getValue());
        }
        throw new RuntimeException(error);
      }
      try {
        while (true) {
          try {
            long t1 = System.currentTimeMillis();
           
            logger.logManyTablets(sendables);
           
            long t2 = System.currentTimeMillis();
            us.walogTimes.addStat(t2 - t1);
            if (updateMetrics.isEnabled())
              updateMetrics.add(TabletServerUpdateMetrics.waLogWriteTime, (t2 - t1));
           
            break;
          } catch (IOException ex) {
            log.warn("logging mutations failed, retrying");
          } catch (Throwable t) {
            log.error("Unknown exception logging mutations, counts for mutations in flight not decremented!", t);
            throw new RuntimeException(t);
          }
        }
       
        wal.stop();
       
        Span commit = Trace.start("commit");
        long t1 = System.currentTimeMillis();
        for (Entry<CommitSession,? extends List<Mutation>> entry : sendables.entrySet()) {
          CommitSession commitSession = entry.getKey();
          List<Mutation> mutations = entry.getValue();
         
          commitSession.commit(mutations);
         
          Tablet tablet = commitSession.getTablet();
         
          if (tablet == us.currentTablet) {
            // because constraint violations may filter out some mutations, for proper
            // accounting with the client code, need to increment the count based
            // on the original number of mutations from the client NOT the filtered number
            us.successfulCommits.increment(tablet, us.queuedMutations.get(tablet).size());
          }
        }
        long t2 = System.currentTimeMillis();
       
        long avgCommitTime = (long) ((t2 - t1) / (double) sendables.size());
       
        us.flushTime += (t2 - pt1);
        us.commitTimes.addStat(t2 - t1);
       
        if (updateMetrics.isEnabled())
          updateMetrics.add(TabletServerUpdateMetrics.commitTime, avgCommitTime);
        commit.stop();
      } finally {
        us.queuedMutations.clear();
        if (us.currentTablet != null) {
          us.queuedMutations.put(us.currentTablet, new ArrayList<Mutation>());
        }
View Full Code Here

Examples of com.barchart.feed.api.series.Span

      if(isUpdated()) {
        System.out.println(this + " isUpdated");
        setUpdated(false);
        if(hasAllAncestorUpdates()) {
          System.out.println(this + " hasAllAncestorUpdates()");
          Span span = this.process();
          if(span != null) {
            List<S> outputs = getOutputSubscriptions();
            for(Node<S> nextNode : childNodes) {
              nextNode.setModifiedSpan(span, outputs);
            }
View Full Code Here

Examples of com.dodo.blog.ui.component.simple.Span

        contactWrapper.add( new Anchor( "", localize( "contact.label.linkedin" ), localize( "contact.href.linkedin" ) ) );
        contactWrapper.add( getSeparator() );
        contactWrapper.add( new Anchor( "", localize( "contact.label.facebook" ), localize( "contact.href.facebook" ) ) );

        // copyright
        Span copyright = new Span( localize( "label.copyright", WebApplication.get().getPathByPageClass( About.class ) ) );
        copyright.setClassName( "copyright" );
        add( copyright );
    }
View Full Code Here

Examples of com.mdimension.jchronic.utils.Span

  if (d.compareToIgnoreCase("now")!=0) {
      Options options= new Options(false);
      options.setCompatibilityMode(true);
      options.setNow(now);
      try {
    Span span = Chronic.parse(d, options);
    l = span.getBegin()*1000;
      } catch (Exception e) {
    // exception when parsing
    log.error("parse error for: "+d);   
      }
  }
View Full Code Here

Examples of com.sk89q.jchronic.utils.Span

        checkNotNull(input);

        Time.setTimeZone(getTimeZone());
        Options opt = new com.sk89q.jchronic.Options();
        opt.setNow(Calendar.getInstance(getTimeZone()));
        Span date = Chronic.parse(input, opt);
        if (date == null) {
            return null;
        } else {
            return date.getBeginCalendar();
        }
    }
View Full Code Here

Examples of com.twitter.zipkin.gen.Span

    @Test
    public void testCollect() throws TTransportException {

        final ZipkinSpanCollector zipkinSpanCollector = new ZipkinSpanCollector("localhost", PORT);
        try {
            final Span span = new Span();
            span.setId(SPAN_ID);
            span.setTrace_id(TRACE_ID);
            span.setName(SPAN_NAME);
            zipkinSpanCollector.collect(span);

        } finally {
            zipkinSpanCollector.close();
        }
View Full Code Here

Examples of com.twitter.zipkin.gen.Span

    public void testCollectWithDefaultAnnotation() throws TTransportException {

        final ZipkinSpanCollector zipkinSpanCollector = new ZipkinSpanCollector("localhost", PORT);
        zipkinSpanCollector.addDefaultAnnotation(KEY1, VALUE1);
        try {
            final Span span = new Span();
            span.setId(SPAN_ID);
            span.setTrace_id(TRACE_ID);
            span.setName(SPAN_NAME);
            zipkinSpanCollector.collect(span);

        } finally {
            zipkinSpanCollector.close();
        }
        final List<Span> serverCollectedSpans = zipkinCollectorServer.getReceivedSpans();
        assertEquals(1, serverCollectedSpans.size());
        final Span span = serverCollectedSpans.get(0);
        assertEquals(SPAN_ID, span.getId());
        assertEquals(TRACE_ID, span.getTrace_id());
        assertEquals(SPAN_NAME, span.getName());
        final List<BinaryAnnotation> binary_annotations = span.getBinary_annotations();
        assertEquals("Expect default annotation to have been submitted.", 1, binary_annotations.size());
        final BinaryAnnotation binaryAnnotation = binary_annotations.get(0);
        assertEquals(KEY1, binaryAnnotation.getKey());
        assertEquals(VALUE1, new String(binaryAnnotation.getValue()));
View Full Code Here

Examples of com.twitter.zipkin.gen.Span

        params.setBatchSize(50);

        final ZipkinSpanCollector zipkinSpanCollector = new ZipkinSpanCollector("localhost", PORT, params);
        try {

            final Span span = new Span();
            span.setId(SPAN_ID);
            span.setTrace_id(TRACE_ID);
            span.setName(SPAN_NAME);

            for (int i = 1; i <= FIRST_BURST_OF_SPANS; i++) {
                LOGGER.info("Submitting Span nr " + i + "/" + FIRST_BURST_OF_SPANS);
                zipkinSpanCollector.collect(span);
            }
View Full Code Here

Examples of com.twitter.zipkin.gen.Span

        params.setBatchSize(50);

        final ZipkinSpanCollector zipkinSpanCollector = new ZipkinSpanCollector("localhost", PORT, params);
        try {

            final Span span = new Span();
            span.setId(SPAN_ID);
            span.setTrace_id(TRACE_ID);
            span.setName(SPAN_NAME);

            for (int i = 1; i <= hunderdTen; i++) {
                LOGGER.info("Submitting Span nr " + i + "/" + hunderdTen);
                zipkinSpanCollector.collect(span);
            }
View Full Code Here

Examples of com.twitter.zipkin.gen.Span

        int subsequentEmptyBatches = 0;
        do {

            try {
                final Span span = queue.poll(5, TimeUnit.SECONDS);
                if (span == null) {
                    subsequentEmptyBatches++;

                } else {
                    logEntries.add(create(span));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.