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 @@ -117,6 +117,7 @@ public class MetadataManagerStats
private final AtomicLong getMetadataResolverCalls = new AtomicLong();
private final AtomicLong getConnectorCapabilitiesCalls = new AtomicLong();
private final AtomicLong dropBranchCalls = new AtomicLong();
private final AtomicLong createBranchCalls = new AtomicLong();
private final AtomicLong dropTagCalls = new AtomicLong();
private final AtomicLong dropConstraintCalls = new AtomicLong();
private final AtomicLong addConstraintCalls = new AtomicLong();
Expand Down Expand Up @@ -225,6 +226,7 @@ public class MetadataManagerStats
private final TimeStat getMetadataResolverTime = new TimeStat(TimeUnit.NANOSECONDS);
private final TimeStat getConnectorCapabilitiesTime = new TimeStat(TimeUnit.NANOSECONDS);
private final TimeStat dropBranchTime = new TimeStat(TimeUnit.NANOSECONDS);
private final TimeStat createBranchTime = new TimeStat(TimeUnit.NANOSECONDS);
private final TimeStat dropTagTime = new TimeStat(TimeUnit.NANOSECONDS);
private final TimeStat dropConstraintTime = new TimeStat(TimeUnit.NANOSECONDS);
private final TimeStat addConstraintTime = new TimeStat(TimeUnit.NANOSECONDS);
Expand Down Expand Up @@ -1725,6 +1727,12 @@ public void recordDropBranchCall(long duration)
dropBranchTime.add(duration, TimeUnit.NANOSECONDS);
}

public void recordCreateBranchCall(long duration)
{
createBranchCalls.incrementAndGet();
createBranchTime.add(duration, TimeUnit.NANOSECONDS);
}

public void recordDropTagCall(long duration)
{
dropTagCalls.incrementAndGet();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -999,6 +999,26 @@ public void dropBranch(Session session, TableHandle tableHandle, String branchNa
}
}

@Override
public void createBranch(Session session,
TableHandle tableHandle,
String branchName,
boolean replace,
boolean ifNotExists,
Optional<ConnectorTableVersion> tableVersion,
Optional<Long> retainDays,
Optional<Integer> minSnapshotsToKeep,
Optional<Long> maxSnapshotAgeDays)
{
long startTime = System.nanoTime();
try {
delegate.createBranch(session, tableHandle, branchName, replace, ifNotExists, tableVersion, retainDays, minSnapshotsToKeep, maxSnapshotAgeDays);
}
finally {
stats.recordCreateBranchCall(System.nanoTime() - startTime);
}
}

@Override
public void dropTag(Session session, TableHandle tableHandle, String tagName, boolean tagExists)
{
Expand Down
Loading