Search in sources :

Example 31 with Registry

use of org.bf2.srs.fleetmanager.rest.publicapi.beans.Registry in project cos-fleetshard by bf2fc6cc711aee1a0c2a.

the class MetricsRecorder method record.

public void record(Runnable action, String subId, Iterable<Tag> additionalTags) {
    try {
        Timer.builder(id + subId + ".time").tags(tags).tags(additionalTags).publishPercentiles(0.3, 0.5, 0.95).publishPercentileHistogram().register(registry).record(action);
        Counter.builder(id + subId + ".count").tags(tags).tags(additionalTags).register(registry).increment();
    } catch (Exception e) {
        Counter.builder(id + subId + ".count.failure").tags(tags).tags(additionalTags).tag("exception", e.getClass().getName()).register(registry).increment();
        throw new RuntimeException("Failure recording method execution (id: " + id + subId + ")", e);
    }
}
Also used : WrappedRuntimeException(org.bf2.cos.fleetshard.support.exceptions.WrappedRuntimeException) WrappedRuntimeException(org.bf2.cos.fleetshard.support.exceptions.WrappedRuntimeException)

Aggregations

RegistryData (org.bf2.srs.fleetmanager.storage.sqlPanacheImpl.model.RegistryData)13 Transactional (javax.transaction.Transactional)8 Test (org.junit.jupiter.api.Test)7 AccountInfo (org.bf2.srs.fleetmanager.spi.common.model.AccountInfo)6 TenantNotFoundServiceException (org.bf2.srs.fleetmanager.spi.tenants.TenantNotFoundServiceException)5 RegistryDeploymentData (org.bf2.srs.fleetmanager.storage.sqlPanacheImpl.model.RegistryDeploymentData)5 Secret (io.fabric8.kubernetes.api.model.Secret)4 MeterRegistry (io.micrometer.core.instrument.MeterRegistry)4 ManagedConnector (org.bf2.cos.fleetshard.api.ManagedConnector)4 TenantManagerClient (io.apicurio.multitenant.client.TenantManagerClient)3 IOException (java.io.IOException)3 HashMap (java.util.HashMap)3 List (java.util.List)3 Optional (java.util.Optional)3 ApplicationScoped (javax.enterprise.context.ApplicationScoped)3 Inject (javax.inject.Inject)3 ConnectorDeployment (org.bf2.cos.fleet.manager.model.ConnectorDeployment)3 FleetShardSyncConfig (org.bf2.cos.fleetshard.sync.FleetShardSyncConfig)3 FleetManagerClient (org.bf2.cos.fleetshard.sync.client.FleetManagerClient)3 FleetShardClient (org.bf2.cos.fleetshard.sync.client.FleetShardClient)3