public JsfPerformancePhaseListener() { LOG.debug("Activated JSF phase performance monitoring."); }
private Method getGenerateBeanNameMethodSinceSpring25() throws NoSuchMethodException { LOG.debug("Using BeanDefinitionReaderUtils.generateBeanName() method for spring >= 2.5"); return BeanDefinitionReaderUtils.class.getMethod("generateBeanName", new Class[] {BeanDefinition.class, BeanDefinitionRegistry.class, Boolean.TYPE}); }
private Method getGenerateBeanNameMethodSinceSpring11() throws NoSuchMethodException { LOG.debug("Using BeanDefinitionReaderUtils.generateBeanName() method for spring < 2.5 and >= 1.1"); return BeanDefinitionReaderUtils.class.getMethod("generateBeanName", new Class[] {AbstractBeanDefinition.class, BeanDefinitionRegistry.class, Boolean.TYPE}); }
public DelegatingEtmViewHandler(ViewHandler aDelegate) { delegate = aDelegate; LOG.debug("Activated " + getClass().getSimpleName() + "."); }
public DelegatingEtmApplicationFactory(ApplicationFactory aDelegate) { delegate = aDelegate; if (!isEnabled()) { LOG.info("JSF converter/validator monitoring disabled."); } else { LOG.debug("JSF converter/validator monitoring enabled."); } }
/** * Locates a given template and returns a URL to the template. Translates pre defined * templates to their url within the classpat. * * @param aTemplate A template name, might be predefined template, a classpath resource or file. * @return The URL to the resource * @throws EtmException Thrown to indicate that the given template could not be found. */ public URL locateTemplate(String aTemplate) { if (templates.containsKey(aTemplate)) { aTemplate = (String) templates.get(aTemplate); LOG.debug("Using template " + aTemplate + " from classpath."); } ClassLoader loader = EtmMonitor.class.getClassLoader(); URL resource = loader.getResource(aTemplate); if (resource != null) { return resource; } File file = new File(aTemplate); if (file.exists()) { try { return file.toURL(); } catch (MalformedURLException e) { throw new EtmException(e); } } throw new EtmException("Unable to locate template " + aTemplate + " in ClassPath or Filesystem."); }
public void start() { // validate whether we find required aggregator doValidateChain(); RrdDestination[] tmp = getDestinations(); List dest = new ArrayList(); for (int i = 0; i < tmp.length; i++) { RrdDestination rrdDestination = tmp[i]; try { rrdDestination.start(); dest.add(rrdDestination); LOG.debug("Added RRD destination " + rrdDestination); } catch (Exception e) { LOG.warn("Error activation RRD destination " + rrdDestination, e); } } destinations = (RrdDestination[]) dest.toArray(new RrdDestination[dest.size()]); }
protected AnnotatedMethod<? super T> processAnnotatedMethod(AnnotatedMethod<? super T> method) { // TODO String name = method.getJavaMember().getName(); if (getClassLevelMeasurementAttribute() == null && !name.startsWith("get") && !name.startsWith("set") && !name.startsWith("is") && !method.isAnnotationPresent(Measure.class)) { LOG.debug("Public Method Monitoring enabled for " + method.getJavaMember()); return new DelegatingAnnotatedMethod(this, method, new AnnotationLiteral<Measure>() { }); } else { return method; } }
public DelegatingEtmRenderKitFactory(RenderKitFactory aKitFactory) { // default value, may be overridden delegate = aKitFactory; if (!isEnabled()) { LOG.info("JSF component monitoring disabled."); } else if (isCglibAvailable()) { try { Class<RenderKitFactory> aClass = (Class<RenderKitFactory>) Class.forName(CGLIB_DELEGATE_CLASS_NAME); Constructor<RenderKitFactory> constructor = aClass.getConstructor(new Class[]{RenderKitFactory.class}); delegate = constructor.newInstance(aKitFactory); LOG.debug("Activated JSF component monitoring."); } catch (Exception e) { LOG.warn("Unable to create CGLIB proxy for " + aKitFactory.getClass() + ". Component monitoring disabled: " + e.getMessage()); } } else { LOG.warn("CGLIB not found. Component monitoring disabled."); } }
public <T> void addMeasurement(@Observes ProcessAnnotatedType<T> event) { AnnotatedType<T> annotatedType = event.getAnnotatedType(); if (!annotatedType.isAnnotationPresent(Measure.class)) { AnnotationLiteral<Measure> annotationLiteral = new AnnotationLiteral<Measure>() { }; if (resolver.isQualifiedApiType(annotatedType)) { LOG.debug("Adding public API performance monitoring to " + annotatedType.getJavaClass()); event.setAnnotatedType(new DelegatingAnnotatedType<T>(annotatedType, annotationLiteral)); } else if (resolver.isQualifiedMethodType(annotatedType)) { LOG.debug("Adding public method performance monitoring to " + annotatedType.getJavaClass()); event.setAnnotatedType(new PublicMethodApplyToDelegatingAnnotatedType<T>(annotatedType)); } } }
public void run() { while (shouldRun) { try { Socket clientSocket = socket.accept(); ConsoleWorker worker = getWorker(); if (worker != null) { worker.setClientSocket(clientSocket); } else { // process in current thread new ConsoleWorker().process(clientSocket); } } catch (Exception e) { if (shouldRun) { LOG.warn("Error processing HTTP request", e); } else { // don't do anything. we are shutting down probably // so there is no need to LOG the exception LOG.debug("Error during shutdown" + e.toString()); } } } }
LOG.debug("Using JETM configuration file " + resource);
LOG.debug("Processing " + action.getClass()); action.execute(consoleRequest, consoleResponse); consoleResponse.flush();
/** * Creates a new writer that stores * * @param aDb A writeable RRD DB. * @throws IllegalArgumentException If the rrd db definition does not contain all required * datasources */ public Rrd4jAggregationWriter(RrdDb aDb) { super(extractLastTimestamp(aDb), extractStep(aDb)); transactionsEnabled = validateDataSource(aDb, "transactions!"); minEnabled = validateDataSource(aDb, "min"); maxEnabled = validateDataSource(aDb, "max"); averageEnabled = validateDataSource(aDb, "average"); if (!(transactionsEnabled || minEnabled || maxEnabled || averageEnabled)) { throw new EtmException("Invalid datasource. " + "One of the datasources 'transactions', 'min', 'max' or 'average' should exist in " + aDb.getPath() + "."); } db = aDb; LOG.debug("Using Rrd4j destination " + aDb.getPath() + " starting at " + new Date(startInterval * 1000) + " with step " + increment + " seconds."); }