Package com.dianping.cat.message

Examples of com.dianping.cat.message.Transaction.addData()


    while (true) {

      for (int i = 0; i < 1000; i++) {
        Transaction t = Cat.newTransaction("URL", "/index");
        Cat.logEvent("RemoteLink", "sina", Event.SUCCESS, "http://sina.com.cn/");
        t.addData("channel=channel" + i % 5);

        t.complete();
      }
      for (int i = 0; i < 900; i++) {
        Transaction t = Cat.newTransaction("URL", "/detail");
View Full Code Here


        t.complete();
      }
      for (int i = 0; i < 900; i++) {
        Transaction t = Cat.newTransaction("URL", "/detail");
        t.addData("channel=channel" + i % 5);
        t.complete();
      }
      for (int i = 0; i < 500; i++) {
        Transaction t = Cat.newTransaction("URL", "/order/submitOrder");
        Cat.logMetric("order", "quantity", 1, "channel", "channel" + i % 5);
View Full Code Here

      for (int i = 0; i < 500; i++) {
        Transaction t = Cat.newTransaction("URL", "/order/submitOrder");
        Cat.logMetric("order", "quantity", 1, "channel", "channel" + i % 5);
        Cat.logMetric("payment.pending", "amount", i, "channel", "channel" + i % 5);
        Cat.logMetric("payment.success", "amount", i, "channel", "channel" + i % 5);
        t.addData("channel=channel" + i % 5);
        t.complete();
      }

      Thread.sleep(1000);
      break;
View Full Code Here

    final Transaction t = Cat.getProducer().newTransaction("ModelService", getClass().getSimpleName());
    final List<MetricReport> reports = Collections.synchronizedList(new ArrayList<MetricReport>());
    final List<String> ips = Collections.synchronizedList(new ArrayList<String>());
    int count = 0;
    t.setStatus(Message.SUCCESS);
    t.addData("request", request);
    t.addData("thread", Thread.currentThread());

    setParentTransaction(t);

    for (Pair<String, Integer> temp : m_servers) {
View Full Code Here

    final List<MetricReport> reports = Collections.synchronizedList(new ArrayList<MetricReport>());
    final List<String> ips = Collections.synchronizedList(new ArrayList<String>());
    int count = 0;
    t.setStatus(Message.SUCCESS);
    t.addData("request", request);
    t.addData("thread", Thread.currentThread());

    setParentTransaction(t);

    for (Pair<String, Integer> temp : m_servers) {
      final Pair<String, Integer> server = temp;
View Full Code Here

    Transaction t = newTransaction("ModelService", getClass().getSimpleName());

    try {
      URL url = buildUrl(request, hostPorts);

      t.addData(url.toString());

      InputStream in = Urls.forIO().connectTimeout(300).readTimeout(3000).openStream(url.toExternalForm());
      GZIPInputStream gzip = new GZIPInputStream(in);
      String xml = Files.forIO().readFrom(gzip, "utf-8");
      int len = xml == null ? 0 : xml.length();
View Full Code Here

      InputStream in = Urls.forIO().connectTimeout(300).readTimeout(3000).openStream(url.toExternalForm());
      GZIPInputStream gzip = new GZIPInputStream(in);
      String xml = Files.forIO().readFrom(gzip, "utf-8");
      int len = xml == null ? 0 : xml.length();

      t.addData("length", len);

      if (len > 0) {
        MetricReport report = buildModel(xml);

        t.setStatus(Message.SUCCESS);
View Full Code Here

      String domain = request.getDomain();
      String report = getReport(request, period, domain);

      response.setModel(report);

      t.addData("period", period);
      t.addData("domain", domain);
      t.setStatus(Message.SUCCESS);
    } catch (Exception e) {
      Cat.logError(e);
      t.setStatus(e);
View Full Code Here

      String report = getReport(request, period, domain);

      response.setModel(report);

      t.addData("period", period);
      t.addData("domain", domain);
      t.setStatus(Message.SUCCESS);
    } catch (Exception e) {
      Cat.logError(e);
      t.setStatus(e);
      response.setException(e);
View Full Code Here

    Transaction t = newTransaction("ModelService", getClass().getSimpleName());

    try {
      URL url = buildUrl(request);

      t.addData(url.toString());

      InputStream in = Urls.forIO().connectTimeout(1000).readTimeout(5000).openStream(url.toExternalForm());
      GZIPInputStream gzip = new GZIPInputStream(in);
      String xml = Files.forIO().readFrom(gzip, "utf-8");
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.