Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public ContentBrowseController( final StoreDataManager storeManager, final Conte
this.contentManager = contentManager;
}

@Measure( timers = @MetricNamed( DEFAULT ), exceptions = @MetricNamed( DEFAULT ) )
@Measure
public ContentBrowseResult browseContent( final StoreKey storeKey, final String path, final String browseBaseUri,
final String contentBaseUri, final UriFormatter uriFormatter,
EventMetadata eventMetadata )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public FoloRecordCache( final Cache<TrackedContentEntry, TrackedContentEntry> in
* @param entry The TrackedContentEntry which will be cached
* @return True if a new record was stored, otherwise false
*/
@Measure( timers = @MetricNamed( DEFAULT ) )
@Measure
public synchronized boolean recordArtifact( final TrackedContentEntry entry )
throws FoloContentException,IndyWorkflowException
{
Expand All @@ -123,7 +123,7 @@ public synchronized boolean recordArtifact( final TrackedContentEntry entry )
} );
}

@Measure( timers = @MetricNamed( DEFAULT ) )
@Measure
public synchronized void delete( final TrackingKey key )
{
sealedRecordCache.remove( key );
Expand All @@ -148,7 +148,7 @@ public synchronized boolean hasSealedRecord( final TrackingKey key )
return sealedRecordCache.containsKey( key );
}

@Measure( timers = @MetricNamed( DEFAULT ) )
@Measure
public synchronized boolean hasInProgressRecord( final TrackingKey key )
{
return !sealedRecordCache.containsKey( key ) && inProgressByTrackingKey( key, (qb, cacheHandle)->qb.build().getResultSize() > 0);
Expand All @@ -159,7 +159,7 @@ public synchronized TrackedContent get( final TrackingKey key )
return sealedRecordCache.get( key );
}

@Measure( timers = @MetricNamed( DEFAULT ) )
@Measure
public TrackedContent seal( final TrackingKey trackingKey )
{
TrackedContent record = sealedRecordCache.get( trackingKey );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
import org.commonjava.indy.data.ArtifactStoreQuery;
import org.commonjava.indy.implrepo.conf.ImpliedRepoConfig;
import org.commonjava.indy.model.core.ArtifactStore;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.decorator.Decorator;
import javax.decorator.Delegate;
Expand Down Expand Up @@ -46,6 +48,8 @@ public abstract class ImpliedReposStoreDataManagerDecorator

public ArtifactStoreQuery<ArtifactStore> query()
{
Logger logger = LoggerFactory.getLogger( getClass() );
logger.trace( "WRAP in implied-repo ArtifactStoreQuery" );
return new ImpliedReposQueryDelegate( delegate.query(), this, config );
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public boolean isAuthorized( String path, EventMetadata eventMetadata, ProjectRe
return isAuthorized( path, eventMetadata, ref, build, session, new HashMap<>() );
}

@Measure( timers = @MetricNamed( DEFAULT ) )
@Measure
public boolean isAuthorized( String path, EventMetadata eventMetadata, ProjectRef ref, KojiBuildInfo build,
KojiSessionInfo session, Map<Integer, KojiBuildArchiveCollection> seenBuildArchives )
throws KojiClientException
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public abstract class KojiContentManagerDecorator
private KojiPathPatternFormatter pathFormatter;

@Override
@Measure( timers = @MetricNamed( DEFAULT ) )
@Measure
public boolean exists( ArtifactStore store, String path )
throws IndyWorkflowException
{
Expand Down Expand Up @@ -172,7 +172,7 @@ public Transfer retrieve( final ArtifactStore store, final String path )
}

@Override
@Measure( timers = @MetricNamed( DEFAULT ) )
@Measure
public Transfer retrieve( final ArtifactStore store, final String path, final EventMetadata eventMetadata )
throws IndyWorkflowException
{
Expand Down Expand Up @@ -258,7 +258,7 @@ public Transfer getTransfer( final ArtifactStore store, final String path, final
return result;
}

@Measure( timers = @MetricNamed( DEFAULT ), exceptions = @MetricNamed( DEFAULT ) )
@Measure
private <T> T findKojiBuildAnd( ArtifactStore store, String path, EventMetadata eventMetadata, T defValue, KojiBuildAction<T> action )
throws IndyWorkflowException
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ public void onDataFileEvent( @Observes final DataFileEvent event )
}
}

@Measure( timers = @MetricNamed( DEFAULT ) )
@Measure
private void addOrDeleteFiles( DataFileEvent event ) throws GitSubsystemException
{
if ( event.getType() == DataFileEventType.deleted )
Expand All @@ -236,7 +236,7 @@ public void pullDataUpdates()
// FIXME: fire events to signal data owners to reload...
}

@Measure( timers = @MetricNamed( DEFAULT ) )
@Measure
public int commitDataUpdates()
throws GitSubsystemException
{
Expand All @@ -248,7 +248,7 @@ public int commitDataUpdates()
return dataFileGit.commit();
}

@Measure( timers = @MetricNamed( DEFAULT ) )
@Measure
public void pushDataUpdates()
throws GitSubsystemException
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class DelegatingArtifactStoreQuery<T extends ArtifactStore>
implements ArtifactStoreQuery<T>
{

private ArtifactStoreQuery<T> delegate;
private ArtifactStoreQuery<T> delegate ;

protected DelegatingArtifactStoreQuery( ArtifactStoreQuery delegate )
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public static long getRawIoWriteNanos()
public static final String REQUEST_LATENCY_NS = "request-latency-ns";

@Thread
public static final String REQUEST_LATENCY_MILLIS = "request-latency";
public static final String REQUEST_LATENCY_MILLIS = "latency_ms";

@MDC
public static final String REQUEST_PHASE = "request-phase";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public Transfer retrieveFirst( final List<? extends ArtifactStore> stores, final
}

@Override
@Measure( timers = @MetricNamed( "retrieve.first" ) )
@Measure
public Transfer retrieveFirst( final List<? extends ArtifactStore> stores, final String path,
final EventMetadata eventMetadata )
throws IndyWorkflowException
Expand All @@ -160,7 +160,7 @@ public List<Transfer> retrieveAll( final List<? extends ArtifactStore> stores, f
}

@Override
@Measure( timers = @MetricNamed( "retrieve.all" ) )
@Measure
public List<Transfer> retrieveAll( final List<? extends ArtifactStore> stores, final String path,
final EventMetadata eventMetadata )
throws IndyWorkflowException
Expand Down Expand Up @@ -418,7 +418,7 @@ protected void clearNFCEntries( final KeyedLocation kl, final String path )
}

@Override
@Measure( timers = @MetricNamed( "store.all" ) )
@Measure
public Transfer store( final List<? extends ArtifactStore> stores, final StoreKey topKey, final String path, final InputStream stream,
final TransferOperation op, final EventMetadata eventMetadata )
throws IndyWorkflowException
Expand Down Expand Up @@ -639,7 +639,7 @@ else if ( eventMetadata.get( TransferManager.ALLOW_REMOTE_LISTING_DOWNLOAD ) ==
}

@Override
@Measure( timers = @MetricNamed( "list.all" ) )
@Measure
public List<StoreResource> list( final List<? extends ArtifactStore> stores, final String path )
throws IndyWorkflowException
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ public List<StoreResource> list( final ArtifactStore store, final String path )
}

@Override
@Measure( timers = @MetricNamed() )
@Measure
public List<StoreResource> list( final ArtifactStore store, final String path, final EventMetadata eventMetadata )
throws IndyWorkflowException
{
Expand Down Expand Up @@ -299,7 +299,7 @@ public List<StoreResource> list( final List<? extends ArtifactStore> stores, fin
}

@Override
@Measure( timers = @MetricNamed() )
@Measure
public List<StoreResource> list( final List<? extends ArtifactStore> stores, final String path, final EventMetadata eventMetadata )
throws IndyWorkflowException
{
Expand Down Expand Up @@ -355,7 +355,7 @@ public Transfer retrieveFirst( final List<? extends ArtifactStore> stores, final
}

@Override
@Measure( timers = @MetricNamed() )
@Measure
public Transfer retrieveFirst( final List<? extends ArtifactStore> stores, final String path,
final EventMetadata eventMetadata )
throws IndyWorkflowException
Expand Down Expand Up @@ -407,7 +407,7 @@ public List<Transfer> retrieveAll( final List<? extends ArtifactStore> stores, f
* @see org.commonjava.indy.core.rest.util.FileManager#downloadAll(java.util.List, java.lang.String)
*/
@Override
@Measure( timers = @MetricNamed() )
@Measure
public List<Transfer> retrieveAll( final List<? extends ArtifactStore> stores, final String path,
final EventMetadata eventMetadata )
throws IndyWorkflowException
Expand Down Expand Up @@ -446,7 +446,7 @@ public Transfer retrieve( final ArtifactStore store, final String path )
* java.lang.String)
*/
@Override
@Measure( timers = @MetricNamed() )
@Measure
public Transfer retrieve( final ArtifactStore store, final String path, final EventMetadata eventMetadata )
throws IndyWorkflowException
{
Expand Down Expand Up @@ -513,7 +513,7 @@ private Transfer retrieve( final ArtifactStore store, final String path, final b
}

@Override
@Measure( timers = @MetricNamed() )
@Measure
public boolean exists(final ArtifactStore store, String path)
throws IndyWorkflowException
{
Expand Down Expand Up @@ -915,7 +915,7 @@ public Transfer getStorageReference( final ArtifactStore store, final String pat
}

@Override
@Measure( timers = @MetricNamed() )
@Measure
public Transfer getStorageReference( final ArtifactStore store, final String... path )
{
Logger logger = LoggerFactory.getLogger( getClass() );
Expand All @@ -926,7 +926,7 @@ public Transfer getStorageReference( final ArtifactStore store, final String...
}

@Override
@Measure( timers = @MetricNamed() )
@Measure
public Transfer getStorageReference( final StoreKey key, final String... path )
throws IndyWorkflowException
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,49 +37,49 @@ public abstract class NFCMetricsDecorator
@Inject
private NotFoundCache delegate;

@Measure( timers = @MetricNamed( "indy.nfc.addMissing" ) )
@Measure
@Override
public void addMissing( final ConcreteResource resource )
{
delegate.addMissing( resource );
}

@Measure( timers = @MetricNamed( "indy.nfc.isMissing" ) )
@Measure
@Override
public boolean isMissing( final ConcreteResource resource )
{
return delegate.isMissing( resource );
}

@Measure( timers = @MetricNamed( "indy.nfc.clearMissing.location" ) )
@Measure
@Override
public void clearMissing( final Location location )
{
delegate.clearMissing( location );
}

@Measure( timers = @MetricNamed( "indy.nfc.clearMissing.resource" ) )
@Measure
@Override
public void clearMissing( final ConcreteResource resource )
{
delegate.clearMissing( resource );
}

@Measure( timers = @MetricNamed( "indy.nfc.clearAllMissing" ) )
@Measure
@Override
public void clearAllMissing()
{
delegate.clearAllMissing();
}

@Measure( timers = @MetricNamed( "indy.nfc.getAllMissing" ) )
@Measure
@Override
public Map<Location, Set<String>> getAllMissing()
{
return delegate.getAllMissing();
}

@Measure( timers = @MetricNamed( "indy.nfc.getMissing.location" ) )
@Measure
@Override
public Set<String> getMissing( final Location location )
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,15 @@ public class DefaultArtifactStoreQuery<T extends ArtifactStore>

public DefaultArtifactStoreQuery( StoreDataManager dataManager )
{
logger.info( "CREATE new default store query with data manager only" );
this.dataManager = dataManager;
}

private DefaultArtifactStoreQuery( final StoreDataManager dataManager, final String packageType,
final Boolean enabled, final Class<T> storeCls )
{
logger.info( "CREATE new default store query with params (internal?)" );

this.dataManager = dataManager;
this.packageType = packageType;
this.enabled = enabled;
Expand Down Expand Up @@ -380,7 +383,15 @@ public List<RemoteRepository> getRemoteRepositoryByUrl( String url )
public List<ArtifactStore> getOrderedConcreteStoresInGroup( final String groupName )
throws IndyDataException
{
return getGroupOrdering( groupName, false, true );
logger.trace( "START: default store-query ordered-concrete-stores-in-group" );
try
{
return getGroupOrdering( groupName, false, true );
}
finally
{
logger.trace( "END: default store-query ordered-concrete-stores-in-group" );
}
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
import org.commonjava.indy.data.StoreDataManager;
import org.commonjava.indy.metrics.IndyMetricsManager;
import org.commonjava.indy.model.core.ArtifactStore;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.decorator.Decorator;
import javax.decorator.Delegate;
Expand All @@ -38,6 +40,8 @@ public abstract class MeasuringArtifactStoreQueryInterceptor
@Override
public ArtifactStoreQuery<ArtifactStore> query()
{
Logger logger = LoggerFactory.getLogger( getClass() );
logger.trace( "WRAP in metered ArtifactStoreQuery" );
ArtifactStoreQuery<ArtifactStore> query = dataManager.query();
return new MeasuringStoreQuery( query, metricsManager );
}
Expand Down
Loading