RecorderFactory { public static CloseableMeasurementRecorderSource createScalableQuantizedRecorderSource2(final Object forWhat, final String unitOfMeasurement, final int sampleTimeMillis, final int factor, final int lowerMagnitude, final int higherMagnitude, final int quantasPerMagnitude) { ScalableMeasurementRecorderSource mrs = new ScalableMeasurementRecorderSource( new QuantizedAccumulator(forWhat, "", unitOfMeasurement, factor, lowerMagnitude, higherMagnitude, quantasPerMagnitude), sampleTimeMillis, MEASUREMENT_STORE, false); mrs.registerJmx(); return mrs; } private  RecorderFactory(); static MeasurementStore getMeasurementStore(); static CloseableMeasurementRecorder createScalableQuantizedRecorder(
          final Object forWhat, final String unitOfMeasurement, final int sampleTimeMillis,
          final int factor, final int lowerMagnitude,
          final int higherMagnitude, final int quantasPerMagnitude); static CloseableMeasurementRecorder createScalableQuantizedRecorder2(
          final Object forWhat, final String unitOfMeasurement,  final int sampleTimeMillis,
          final int factor, final int lowerMagnitude, final int higherMagnitude,
          final int quantasPerMagnitude); static CloseableMeasurementRecorder createScalableCountingRecorder(
          final Object forWhat, final String unitOfMeasurement, final int bucketTimeMillis); static CloseableMeasurementRecorder createScalableSimpleCountingRecorder(
          final Object forWhat, final String unitOfMeasurement, final int bucketTimeMillis); static CloseableMeasurementRecorder createScalableMinMaxAvgRecorder(
          final Object forWhat, final String unitOfMeasurement, final int sampleTimeMillis); static CloseableMeasurementRecorder createScalableMinMaxAvgRecorder2(
          final Object forWhat, final String unitOfMeasurement, final int sampleTimeMillis); static MeasurementRecorderSource createScalableQuantizedRecorderSource(
          final Object forWhat, final String unitOfMeasurement, final int sampleTimeMillis,
          final int factor, final int lowerMagnitude,
          final int higherMagnitude, final int quantasPerMagnitude); static CloseableMeasurementRecorderSource createScalableQuantizedRecorderSource2(final Object forWhat,
          final String unitOfMeasurement,  final int sampleTimeMillis,
          final int factor, final int lowerMagnitude, final int higherMagnitude,
          final int quantasPerMagnitude); static MeasurementRecorderSource createScalableCountingRecorderSource(
          final Object forWhat, final String unitOfMeasurement, final int sampleTimeMillis); static CloseableMeasurementRecorderSource createScalableSimpleCountingRecorderSource(
          final Object forWhat, final String unitOfMeasurement, final int sampleTimeMillis); static CloseableMeasurementRecorderSource createScalableCountingRecorderSource2(
          final Object forWhat, final String unitOfMeasurement, final int sampleTimeMillis); static MeasurementRecorderSource createScalableMinMaxAvgRecorderSource(
          final Object forWhat, final String unitOfMeasurement, final int sampleTimeMillis); static MultiMeasurementRecorder createDirectRecorder(final Object measuredEntity, final String description,
          final String[] measurementNames, final String[] measurementUnits); static MultiMeasurementRecorder createDirectRecorder(final Object measuredEntity, final String description,
          final String[] measurementNames, final String[] measurementUnits, final MeasurementType type); static CloseableMeasurementRecorder createDirectRecorder(final Object forWhat,
          final String unitOfMeasurement); static CloseableMeasurementRecorder createDirectRecorder(final Object forWhat,
          final String unitOfMeasurement,
          final MeasurementType type); static CloseableMeasurementRecorder createDirectRecorder(final Object forWhat,
          final String unitOfMeasurement, final int sampleTimeMillis); static CloseableMeasurementRecorder createDirectRecorder(final Object forWhat,
          final String unitOfMeasurement, final int sampleTimeMillis, final MeasurementType type); static MeasurementRecorderSource createDirectRecorderSource(final Object forWhat,
          final String unitOfMeasurement); static CloseableMeasurementRecorder createDirectGraphiteUdpRecorder(final Object forWhat,
          final String unitOfMeasurement,
          final String graphiteHost, final int graphitePort); static CloseableMeasurementRecorder createDirectGraphiteTcpRecorder(final Object forWhat,
          final String unitOfMeasurement,
          final String graphiteHost, final int graphitePort); static final MeasurementStore MEASUREMENT_STORE; }
@Test public void testRecorderFactoryDyna() throws InterruptedException, IOException, InstanceNotFoundException, MBeanException, AttributeNotFoundException, ReflectionException { CloseableMeasurementRecorderSource rec = RecorderFactory.createScalableQuantizedRecorderSource2(RsTest.class, "ms", 100000000, 10, 0, 6, 10); MeasurementRecorder recorder = rec.getRecorder("test"); recorder.record(1); int sum = 1; for (int i = 0; i < 10; i++) { recorder.record(i); sum += i; } String ret3 = (String) Client.getAttribute("service:jmx:rmi: "org.spf4j.perf.recorders", "class_" + RecorderFactoryTest.class.getName() + "_RsTest", "measurementsAsString"); Assert.assertThat(ret3, Matchers.containsString("test," + sum + "," + 11)); rec.close(); }