当前位置: 首页>>代码示例>>Java>>正文


Java MetricManagementService类代码示例

本文整理汇总了Java中org.wso2.carbon.metrics.core.MetricManagementService的典型用法代码示例。如果您正苦于以下问题:Java MetricManagementService类的具体用法?Java MetricManagementService怎么用?Java MetricManagementService使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


MetricManagementService类属于org.wso2.carbon.metrics.core包,在下文中一共展示了MetricManagementService类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setMetricManagementService

import org.wso2.carbon.metrics.core.MetricManagementService; //导入依赖的package包/类
/**
 * This bind method will be called when {@link MetricManagementService} is registered.
 *
 * @param metricManagementService The {@link MetricManagementService} instance registered as an OSGi service
 */
@Reference(
        name = "carbon.metrics.management.service",
        service = MetricManagementService.class,
        cardinality = ReferenceCardinality.MANDATORY,
        policy = ReferencePolicy.DYNAMIC,
        unbind = "unsetMetricManagementService"
)
protected void setMetricManagementService(MetricManagementService metricManagementService) {
    DataHolder.getInstance().setMetricManagementService(metricManagementService);
}
 
开发者ID:wso2,项目名称:carbon-metrics,代码行数:16,代码来源:ServiceComponent.java

示例2: deactivate

import org.wso2.carbon.metrics.core.MetricManagementService; //导入依赖的package包/类
/**
 * Remove DAS Reporters.
 */
@Override
public void deactivate(MetricService metricService, MetricManagementService metricManagementService) {
    if (names != null) {
        Arrays.stream(names).forEach(metricManagementService::removeReporter);
    }
}
 
开发者ID:wso2,项目名称:carbon-metrics,代码行数:10,代码来源:DasMetricsExtension.java

示例3: deactivate

import org.wso2.carbon.metrics.core.MetricManagementService; //导入依赖的package包/类
/**
 * Remove JDBC Reporters.
 */
@Override
public void deactivate(MetricService metricService, MetricManagementService metricManagementService) {
    if (names != null) {
        Arrays.stream(names).forEach(metricManagementService::removeReporter);
    }
}
 
开发者ID:wso2,项目名称:carbon-metrics,代码行数:10,代码来源:JdbcMetricsExtension.java

示例4: testJDBCReporterCustomDatasource

import org.wso2.carbon.metrics.core.MetricManagementService; //导入依赖的package包/类
@Test
public void testJDBCReporterCustomDatasource() throws ConfigurationException {
    // reload with custom jdbc config
    Metrics metrics = new Metrics(TestUtils.getConfigProvider("metrics-jdbc.yaml"));
    metrics.activate();
    MetricService metricService = metrics.getMetricService();
    MetricManagementService metricManagementService = metrics.getMetricManagementService();
    Assert.assertTrue(metricManagementService.isReporterRunning("JDBC"));

    String meterName = MetricService.name(this.getClass(), "test-jdbc-datasource");
    Meter meter = metricService.meter(meterName, Level.INFO);
    meter.mark();

    metricManagementService.report("JDBC");
    List<Map<String, Object>> meterResult =
            template.queryForList("SELECT * FROM METRIC_METER WHERE NAME = ?", meterName);
    Assert.assertEquals(meterResult.size(), 1);
    Assert.assertEquals(meterResult.get(0).get("NAME"), meterName);
    Assert.assertEquals(meterResult.get(0).get("COUNT"), 1L);

    meter.mark();
    metricManagementService.report();
    List<Map<String, Object>> meterResult2 =
            template.queryForList("SELECT * FROM METRIC_METER WHERE NAME = ? ORDER BY TIMESTAMP DESC", meterName);
    Assert.assertEquals(meterResult2.size(), 2);
    Assert.assertEquals(meterResult2.get(0).get("NAME"), meterName, "Meter should be available");
    Assert.assertEquals(meterResult2.get(0).get("COUNT"), 2L, "Meter count should be two");
    Assert.assertEquals(meterResult2.get(1).get("COUNT"), 1L, "Meter count should be one");

    metricManagementService.stopReporter("JDBC");
    Assert.assertFalse(metricManagementService.isReporterRunning("JDBC"));
    metrics.deactivate();
}
 
开发者ID:wso2,项目名称:carbon-metrics,代码行数:34,代码来源:ReporterTest.java

示例5: activate

import org.wso2.carbon.metrics.core.MetricManagementService; //导入依赖的package包/类
@Activate
protected void activate(BundleContext bundleContext) {
    if (logger.isDebugEnabled()) {
        logger.debug("Metrics Component activated");
    }
    Utils.setCarbonEnvironment(true);
    metrics = new Metrics(configProvider);
    metrics.activate();
    metricServiceRegistration = bundleContext.registerService(MetricService.class, metrics.getMetricService(),
            null);
    metricManagementServiceRegistration = bundleContext.registerService(MetricManagementService.class,
            metrics.getMetricManagementService(), null);
}
 
开发者ID:wso2,项目名称:carbon-metrics,代码行数:14,代码来源:MetricsComponent.java

示例6: setMetricManagementService

import org.wso2.carbon.metrics.core.MetricManagementService; //导入依赖的package包/类
/**
 * This bind method will be called when {@link MetricManagementService} is registered.
 *
 * @param metricManagementService The {@link MetricManagementService} instance registered as an OSGi service
 */
@Reference(
        name = "carbon.metrics.management.service",
        service = MetricManagementService.class,
        cardinality = ReferenceCardinality.MANDATORY,
        policy = ReferencePolicy.DYNAMIC,
        unbind = "unsetMetricManagementService"
)
protected void setMetricManagementService(MetricManagementService metricManagementService) {
    if (logger.isDebugEnabled()) {
        logger.debug("Setting MetricManagementService reference");
    }
    Metrics.getInstance().setMetricManagementService(metricManagementService);
}
 
开发者ID:wso2,项目名称:msf4j,代码行数:19,代码来源:MetricsComponent.java

示例7: getMetricManagementService

import org.wso2.carbon.metrics.core.MetricManagementService; //导入依赖的package包/类
/**
 * Returns the {@link MetricManagementService}
 *
 * @return The {@link MetricManagementService} instance
 */
public MetricManagementService getMetricManagementService() {
    if (metricManagementService == null) {
        synchronized (this) {
            if (metricManagementService == null) {
                initializeServices();
            }
        }
    }
    return metricManagementService;
}
 
开发者ID:wso2,项目名称:msf4j,代码行数:16,代码来源:Metrics.java

示例8: activate

import org.wso2.carbon.metrics.core.MetricManagementService; //导入依赖的package包/类
void activate(ConfigProvider configProvider, MetricService metricService,
MetricManagementService metricManagementService);
 
开发者ID:wso2,项目名称:carbon-metrics,代码行数:3,代码来源:MetricsExtension.java

示例9: MetricsMXBeanImpl

import org.wso2.carbon.metrics.core.MetricManagementService; //导入依赖的package包/类
public MetricsMXBeanImpl(MetricManagementService metricManagementService) {
    this.metricManagementService = metricManagementService;
}
 
开发者ID:wso2,项目名称:carbon-metrics,代码行数:4,代码来源:MetricsMXBeanImpl.java

示例10: unsetMetricManagementService

import org.wso2.carbon.metrics.core.MetricManagementService; //导入依赖的package包/类
/**
 * This is the unbind method which gets called at the un-registration of {@link MetricManagementService}
 *
 * @param metricManagementService The {@link MetricManagementService} instance registered as an OSGi service
 */
protected void unsetMetricManagementService(MetricManagementService metricManagementService) {
    DataHolder.getInstance().setMetricManagementService(null);
}
 
开发者ID:wso2,项目名称:carbon-metrics,代码行数:9,代码来源:ServiceComponent.java

示例11: getMetricManagementService

import org.wso2.carbon.metrics.core.MetricManagementService; //导入依赖的package包/类
/**
 * Returns the {@link MetricManagementService}, which is set by the service component
 *
 * @return The {@link MetricManagementService} instance
 */
public MetricManagementService getMetricManagementService() {
    return metricManagementService;
}
 
开发者ID:wso2,项目名称:carbon-metrics,代码行数:9,代码来源:DataHolder.java

示例12: setMetricManagementService

import org.wso2.carbon.metrics.core.MetricManagementService; //导入依赖的package包/类
/**
 * Set the {@link MetricManagementService} when the service component gets a reference to the
 * {@link MetricManagementService} instance.
 *
 * @param metricManagementService The {@link MetricManagementService} reference being passed through the service
 *                                component
 */
public void setMetricManagementService(MetricManagementService metricManagementService) {
    this.metricManagementService = metricManagementService;
}
 
开发者ID:wso2,项目名称:carbon-metrics,代码行数:11,代码来源:DataHolder.java

示例13: unsetMetricManagementService

import org.wso2.carbon.metrics.core.MetricManagementService; //导入依赖的package包/类
/**
 * This is the unbind method which gets called at the un-registration of {@link MetricManagementService}
 *
 * @param metricManagementService The {@link MetricManagementService} instance registered as an OSGi service
 */
protected void unsetMetricManagementService(MetricManagementService metricManagementService) {
    Metrics.getInstance().setMetricManagementService(null);
}
 
开发者ID:wso2,项目名称:msf4j,代码行数:9,代码来源:MetricsComponent.java

示例14: setMetricManagementService

import org.wso2.carbon.metrics.core.MetricManagementService; //导入依赖的package包/类
/**
 * Set the {@link MetricManagementService} service
 *
 * @param metricManagementService The {@link MetricManagementService} reference
 */
void setMetricManagementService(MetricManagementService metricManagementService) {
    this.metricManagementService = metricManagementService;
}
 
开发者ID:wso2,项目名称:msf4j,代码行数:9,代码来源:Metrics.java

示例15: deactivate

import org.wso2.carbon.metrics.core.MetricManagementService; //导入依赖的package包/类
void deactivate(MetricService metricService, MetricManagementService metricManagementService); 
开发者ID:wso2,项目名称:carbon-metrics,代码行数:2,代码来源:MetricsExtension.java


注:本文中的org.wso2.carbon.metrics.core.MetricManagementService类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。