Examples of Profiler


Examples of helma.scripting.rhino.debug.Profiler

        context = core.contextFactory.enterContext();

        if (core.hasTracer) {
            context.setDebugger(new Tracer(getResponse()), null);
        } else if (useProfiler()) {
            context.setDebugger(new Profiler(), null);
        }

        // register the engine with the current thread
        engines.set(this);
        // update prototypes
View Full Code Here

Examples of helma.scripting.rhino.debug.Profiler

     *   execution context has terminated.
     */
    public synchronized void exitContext() {
        if (useProfiler()) {
            try {
                Profiler profiler = (Profiler) Context.getCurrentContext().getDebugger();
                String result = profiler.getResult();
                ResponseTrans res = getResponse();
                if (res != null) {
                    getResponse().debug("<pre>" + result + "</pre>");
                }
                app.logEvent("Profiler data for " + getRequest() + ":\n" + result);
View Full Code Here

Examples of io.fabric8.insight.camel.profiler.Profiler

*/
public class ContainerTest {

    @Test
    public void testProfilerStrategy() throws Exception {
        Profiler profiler = new Profiler();
        Breadcrumbs breadcrumbs = new Breadcrumbs();

        CamelContext context = new DefaultCamelContext();
        profiler.manage(context);
        breadcrumbs.manage(context);
        context.addRoutes(new RouteBuilder() {
            @Override
            public void configure() throws Exception {
                from("direct:a")
                        .doTry()
                        .to("seda:polyglot")
                        .choice()
                        .when(body().isEqualTo("<hello/>"))
                        .to("seda:english")
                        .throwException(new Exception("Error processing exchange"))
                        .endChoice()
                        .when(body().isEqualTo("<hallo/>"))
                        .to("seda:dutch")
                        .delay(2)
                        .to("seda:german")
                        .endChoice()
                        .otherwise()
                        .to("seda:french").endDoTry()
                        .doCatch(Throwable.class)
                        .to("seda:errors");

                String[] eps = { "polyglot", "english", "dutch", "german", "french", "errors" };
                for (String s : eps) {
                    from("seda:" + s)
                            .aggregate(constant("ok"), new BodyInAggregatingStrategy()).completionSize(3)
                            .to("mock:" + s);
                }

            }
        });
        context.start();

        final ProducerTemplate template = new DefaultProducerTemplate(context);
        template.start();

        final String[] values = { "<hello/>", "<hallo/>", "<bonjour/>" };
        final Random rnd = new Random();

        for (int i = 0; i < 100; i++) {
            template.sendBody("direct:a", values[rnd.nextInt(values.length)]);
        }
        profiler.reset();

        long t0 = System.nanoTime();
        int nbThreads = 10;
        final CountDownLatch latch = new CountDownLatch(nbThreads);
        for (int t = 0; t < nbThreads; t++) {
            new Thread() {
                public void run() {
                    for (int i = 0; i < 1000; i++) {
                        template.sendBody("direct:a", values[rnd.nextInt(values.length)]);
                    }
                    latch.countDown();
                }
            }.start();
        }
        latch.await();
        long t1 = System.nanoTime();
        System.out.println("Total time: " + TimeUnit.MILLISECONDS.convert(t1 - t0, TimeUnit.NANOSECONDS));
        print(profiler.getStatistics());

        System.out.println();

        MBeanServer mbeanServer = context.getManagementStrategy().getManagementAgent().getMBeanServer();
        ObjectName on = context.getManagementStrategy().getManagementNamingStrategy().getObjectNameForCamelContext(context);
View Full Code Here

Examples of net.minecraft.profiler.Profiler

    return new Vector3((float) renderEntity.posX - pos.x, (float) renderEntity.posY + renderEntity.getEyeHeight() - pos.y, (float) renderEntity.posZ - pos.z);
  }

  @SubscribeEvent
  public void onRenderWorldLast(RenderWorldLastEvent event) {
    Profiler profiler = Minecraft.getMinecraft().mcProfiler;
    profiler.startSection("botania-particles");
    ParticleRenderDispatcher.dispatch();
    profiler.startSection("lightning");

    float frame = event.partialTicks;
    Entity entity = Minecraft.getMinecraft().thePlayer;
    TextureManager render = Minecraft.getMinecraft().renderEngine;

    interpPosX = entity.lastTickPosX + (entity.posX - entity.lastTickPosX) * frame;
    interpPosY = entity.lastTickPosY + (entity.posY - entity.lastTickPosY) * frame;
    interpPosZ = entity.lastTickPosZ + (entity.posZ - entity.lastTickPosZ) * frame;

    GL11.glTranslated(-interpPosX, -interpPosY, -interpPosZ);

    Tessellator tessellator = Tessellator.instance;

    GL11.glDepthMask(false);
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);

    ParticleRenderDispatcher.lightningCount = 0;

    render.bindTexture(outsideResource);
    tessellator.startDrawingQuads();
    tessellator.setBrightness(0xF000F0);
    for(LightningBolt bolt : LightningBolt.boltlist)
      renderBolt(bolt, tessellator, frame, ActiveRenderInfo.rotationX, ActiveRenderInfo.rotationXZ, ActiveRenderInfo.rotationZ, ActiveRenderInfo.rotationXY, 0, false);
    tessellator.draw();

    render.bindTexture(insideResource);
    tessellator.startDrawingQuads();
    tessellator.setBrightness(0xF000F0);
    for(LightningBolt bolt : LightningBolt.boltlist)
      renderBolt(bolt, tessellator, frame, ActiveRenderInfo.rotationX, ActiveRenderInfo.rotationXZ, ActiveRenderInfo.rotationZ, ActiveRenderInfo.rotationXY, 1, true);
    tessellator.draw();

    GL11.glDisable(GL11.GL_BLEND);
    GL11.glDepthMask(true);

    GL11.glTranslated(interpPosX, interpPosY, interpPosZ);
    profiler.endSection();
    profiler.endSection();

  }
View Full Code Here

Examples of net.sf.regain.crawler.Profiler

    } catch (Throwable thr) {
      mLog.error("Initializing preparator failed", thr);
    }

    mLog.info("Testing preparator " + prepName + "...");
    Profiler profiler = new Profiler(prepName, "docs");

    File typeDir = new File(docDir, fileType);
    File prepOutputDir = new File(outputDir, prepName);
    if (!prepOutputDir.exists()) {
      if (!prepOutputDir.mkdir()) {
        mLog.error("Could not create output dir: " + prepOutputDir.getAbsolutePath());
        System.exit(1);
      }
    }

    String sourceUrl = RegainToolkit.fileToUrl(typeDir);
    File[] docFileArr = typeDir.listFiles();
    if (docFileArr == null) {
      mLog.info("No test docs for preparator " + prepName + " found in " + typeDir.getAbsolutePath());
      return;
    }
    for (int i = 0; i < docFileArr.length; i++) {
      if (docFileArr[i].isFile()) {
        String url = RegainToolkit.fileToUrl(docFileArr[i]);
        mLog.info("Preparing document: " + url);
        try {
          RawDocument doc = new RawDocument(url, sourceUrl, null, null);

          profiler.startMeasuring();
          String content;
          try {
            prep.prepare(doc);
            content = prep.getCleanedContent();
            prep.cleanUp();
            profiler.stopMeasuring(docFileArr[i].length());
          } catch (Throwable thr) {
            profiler.abortMeasuring();
            throw thr;
          }

          File outFile = new File(prepOutputDir, docFileArr[i].getName() + ".txt");
          RegainToolkit.writeToFile(content, outFile);
View Full Code Here

Examples of net.sf.regain.crawler.Profiler

    // Create a profiler for each preparator
    mPreparatorProfilerArr = new Profiler[mPreparatorArr.length];
    for (int i = 0; i < mPreparatorProfilerArr.length; i++) {
      String name = mPreparatorArr[i].getClass().getName();
      mPreparatorProfilerArr[i] = new Profiler("Preparator " + name, "docs");
    }

    // Create the CrawlerAccessController
    String accessClass = config.getCrawlerAccessControllerClass();
    if (accessClass != null) {
View Full Code Here

Examples of org.apache.isis.core.runtime.profiler.Profiler

    private Profiler profiler;

    @Override
    public void setUp() {
        Profiler.setProfilerSystem(new ProfilerTestSystem());
        profiler = new Profiler("name");
    }
View Full Code Here

Examples of org.apache.jackrabbit.oak.benchmark.util.Profiler

        this.running = true;

        beforeSuite();
        if (PROFILE) {
            profiler = new Profiler().startCollecting();
        }
    }
View Full Code Here

Examples of org.apache.jetspeed.profiler.Profiler

                        if(!StringUtils.isEmpty(requiredRole))
                        {
                            roleManager.addRoleToUser(getUserName(), requiredRole);
                        }
                       
                        Profiler profiler = getServiceLocator().getProfiler();
                       
                        if (!StringUtils.isEmpty(getProfilingRule()))
                        {
                            ProfilingRule profilingRule = profiler.getRule(getProfilingRule());
                           
                            if (profilingRule != null)
                            {
                                profiler.setRuleForPrincipal(principal, profilingRule, "default");
                            }
                            else
                            {
                                log.error("Failed to set profiling rule for principal. Invalid profiling rule: " + getProfilingRule());
                            }
                        }
                        else if (!StringUtils.isEmpty(defaultProfile))
                        {
                            ProfilingRule defaultProfilingRule = profiler.getRule(defaultProfile);
                           
                            if (defaultProfilingRule != null)
                            {
                                profiler.setRuleForPrincipal(principal, defaultProfilingRule, "default");
                            }
                            else
                            {
                                if (log.isDebugEnabled())
                                {
View Full Code Here

Examples of org.apache.jetspeed.profiler.Profiler

                    if (locatorName != null && locatorName.trim().length() > 0)
                    {
                        try
                        {
                            String ruleName = getRuleName();
                            Profiler profiler = getServiceLocator().getProfiler();
                            ProfilingRule profilingRule = profiler.getRule(ruleName);
                            if (profilingRule != null)
                            {
                                profiler.setRuleForPrincipal(getPrincipal(), profilingRule, locatorName);
                            }
                            else
                            {
                                log.error("Failed to set profiling rule for the principal. Invalid profiling rule: " + ruleName);
                            }
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.