Examples of History


Examples of com.mapr.franz.stats.History

        double scale = Math.log(options.ratio) / 2;

        Client client = new Client(Collections.singleton(new PeerInfo(options.host, options.port)));

        History recorder = new History(1, 10, 30).logTicks();

        Random gen = RandomUtils.getRandom();
        ChineseRestaurant topicSampler = new ChineseRestaurant(options.alpha);
        Exponential interval = new Exponential(1, gen);
        double t = 0;
        long t0 = System.nanoTime();
        long messageId = 0;
        while (messageId < options.max) {
            double rate = options.peak * Math.exp(-scale * (Math.cos(2 * Math.PI * t / options.period) + 1));
            double dt = interval.nextDouble() / rate;
            t += dt;
            double now = (System.nanoTime() - t0) / 1e9;
            if (t > now + 0.01) {
                double millis = Math.floor((t - now) * 1000);
                double nanos = Math.rint((t - now) * 1e9 - millis * 1e6);
                Thread.sleep((long) millis, (int) nanos);
            }

            String topic = "topic-" + topicSampler.sample();
            String message = "m-" + (++messageId);
            client.sendMessage(topic, message);
            recorder.message(topic);
            log.debug("Sent {} / {}", topic, message);
            if ((messageId % 10000) == 0) {
                log.warn("Sent {} messages", messageId);
            }
        }
View Full Code Here

Examples of com.mapr.franz.stats.History

    // TODO implement some sort of statistics that records (a) number of
    // clients, (b) transactions per topic, (c) bytes per topic

    public SimpleCatcherService(int port, String basePath) throws FileNotFoundException, SocketException {
        logger = new ProtoLogger(basePath);
        recorder = new History(1, 10, 60, 300)
                .logTicks()
                .addListener(new History.Listener() {
                    @Override
                    public void tick(double t, int interval, int uniqueTopics, int messages) {
                        try {
View Full Code Here

Examples of com.oltpbenchmark.benchmarks.tpcc.pojo.History

    int k = 0;
    int t = 0;

    Customer customer = new Customer();
    History history = new History();
    PrintWriter outHist = null;

    try {

      now = new java.util.Date();
View Full Code Here

Examples of com.ponysdk.core.instruction.History

        newItem(token, true);
    }

    public void newItem(final String token, final boolean fireEvents) {
        this.token = token;
        final History history = new History(token);
        history.put(HISTORY.FIRE_EVENTS, fireEvents);

        Txn.get().getTxnContext().save(history);
    }
View Full Code Here

Examples of com.psddev.cms.db.History

        return null;
    }

    @Override
    protected void doService(final ToolPageContext page) throws IOException, ServletException {
        History history = Query.
                from(History.class).
                where("_id = ?", page.param(UUID.class, "id")).
                first();

        if (page.isFormPost()) {
            try {
                history.setName(page.param(String.class, "name"));
                history.save();

                page.writeStart("script", "type", "text/javascript");
                    page.write("window.location = window.location;");
                page.writeEnd();

                return;

            } catch (Exception error) {
                page.getErrors().add(error);
            }
        }

        page.writeHeader();
            page.writeStart("div", "class", "widget");
                page.writeStart("h1", "class", "icon icon-object-history");
                    page.writeHtml("Name Revision");
                page.writeEnd();

                page.include("/WEB-INF/errors.jsp");

                page.writeStart("form",
                        "method", "post",
                        "action", page.url(""));
                    page.writeStart("div", "class", "inputContainer");
                        page.writeStart("div", "class", "inputLabel");
                            page.writeStart("label", "for", page.createId()).writeHtml("Name").writeEnd();
                        page.writeEnd();

                        page.writeStart("div", "class", "inputSmall");
                            page.writeElement("input",
                                    "type", "text",
                                    "id", page.getId(),
                                    "name", "name",
                                    "value", history.getName());
                        page.writeEnd();
                    page.writeEnd();

                    page.writeStart("div", "class", "actions");
                        page.writeStart("button",
View Full Code Here

Examples of com.sissi.protocol.offline.History

   * @see com.sissi.pipeline.Input#input(com.sissi.context.JIDContext, com.sissi.protocol.Protocol)
   */
  @Override
  public boolean input(JIDContext context, Protocol protocol) {
    Presence presence = Presence.muc();
    presence.findField(XMuc.NAME, XMuc.class).history(new History().setSince(this.format.format(Long.valueOf(this.vcardContext.pull(context.jid(), VCardContext.FIELD_LOGOUT, String.valueOf(System.currentTimeMillis())).getValue()))));
    for (JID jid : super.iSubscribedWho(context.jid())) {
      this.proxy.input(context, presence.setTo(jid));
    }
    return true;
  }
View Full Code Here

Examples of de.axxeed.animosy.gui.history.History

    else if(ae.getActionCommand().equals(MainMenu.ACTION_OPTIONS)) {
      OptionsDialog od = new OptionsDialog();
      od.setVisible(true);
    }
    else if(ae.getActionCommand().equals(MainMenu.ACTION_HISTORY)) {
      History hd = new History();
      hd.setVisible(true);
    }
    else if(ae.getActionCommand().equals(MainMenu.ACTION_TRACKER)) {
      // state is set automatically!
    }
    else if(ae.getActionCommand().equals(MainMenu.ACTION_ABOUT)) {
      AboutDialog ad = new AboutDialog();
      ad.setVisible(true);
    }
    else if(ae.getActionCommand().equals(MainMenu.ACTION_HELP)) {
      HTMLDialog hd = new HTMLDialog("html/help.html", "Help");
      hd.setVisible(true);
    }
    else if(ae.getActionCommand().equals(MainMenu.ACTION_LICENSE)) {
      HTMLDialog hd = new HTMLDialog("html/license.html", "License");
      hd.setVisible(true);
    }
    else if(ae.getActionCommand().equals(MainMenu.ACTION_REVISIONS)) {
      HTMLDialog hd = new HTMLDialog("html/history.html", "Revisions");
      hd.setVisible(true);
    }

  }
View Full Code Here

Examples of de.tuhrig.thofu.gui.History

public class HistoryTest {

  @Test
  public void storageLimit() {
   
    History history = History.instance;
   
    for(int i = 0; i < History.limit * 2; i++) {
     
      history.add(null, new Date(), new Date());

      Assert.assertTrue(history.size() < History.limit);
    }
  }
View Full Code Here

Examples of de.willuhn.util.History

    if (msg.getType() == HBCITraceMessage.Type.ID)
    {
      current = history.get(msg.getData());
      if (current == null)
      {
        current = new History(100);
        history.put(msg.getData(),current);
      }
     
      return;
    }
View Full Code Here

Examples of edu.mayo.bmi.guoqian.claml.History

    /**
     * Create an instance of {@link History }
     *
     */
    public History createHistory() {
        return new History();
    }
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.