forked from apache/pulsar
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
### Motivation Currently, there is no offload metrics for tiered storage, so it is very hard for us to debug the performance issues. For example , we can not find why offload is slow or why read offload is slow. For above reasons. we need to add some offload metrics for monitoring. ### Modifications Add metrics during offload procedure and read offload data procedure. Including offloadTime, offloadError, offloadRate, readLedgerLatency, writeStoreLatency, writeStoreError, readOffloadIndexLatency, readOffloadDataLatency, readOffloadRate, readOffloadError.
- Loading branch information
Showing
22 changed files
with
996 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/LedgerOffloaderStats.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/** | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
package org.apache.bookkeeper.mledger; | ||
|
||
import java.util.concurrent.ScheduledExecutorService; | ||
import java.util.concurrent.TimeUnit; | ||
import org.apache.bookkeeper.common.annotation.InterfaceAudience; | ||
import org.apache.bookkeeper.common.annotation.InterfaceStability; | ||
import org.apache.bookkeeper.mledger.impl.LedgerOffloaderStatsImpl; | ||
|
||
|
||
/** | ||
* Management Bean for a {@link LedgerOffloader}. | ||
*/ | ||
@InterfaceAudience.LimitedPrivate | ||
@InterfaceStability.Stable | ||
public interface LedgerOffloaderStats extends AutoCloseable { | ||
|
||
void recordOffloadError(String topic); | ||
|
||
void recordOffloadBytes(String topic, long size); | ||
|
||
void recordReadLedgerLatency(String topic, long latency, TimeUnit unit); | ||
|
||
void recordWriteToStorageError(String topic); | ||
|
||
void recordReadOffloadError(String topic); | ||
|
||
void recordReadOffloadBytes(String topic, long size); | ||
|
||
void recordReadOffloadIndexLatency(String topic, long latency, TimeUnit unit); | ||
|
||
void recordReadOffloadDataLatency(String topic, long latency, TimeUnit unit); | ||
|
||
void recordDeleteOffloadOps(String topic, boolean succeed); | ||
|
||
|
||
static LedgerOffloaderStats create(boolean exposeManagedLedgerStats, boolean exposeTopicLevelMetrics, | ||
ScheduledExecutorService scheduler, int interval) { | ||
if (!exposeManagedLedgerStats) { | ||
return LedgerOffloaderStatsDisable.INSTANCE; | ||
} | ||
|
||
return LedgerOffloaderStatsImpl.getInstance(exposeTopicLevelMetrics, scheduler, interval); | ||
} | ||
} |
80 changes: 80 additions & 0 deletions
80
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/LedgerOffloaderStatsDisable.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
/** | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
package org.apache.bookkeeper.mledger; | ||
|
||
import java.util.concurrent.TimeUnit; | ||
|
||
class LedgerOffloaderStatsDisable implements LedgerOffloaderStats { | ||
|
||
static final LedgerOffloaderStats INSTANCE = new LedgerOffloaderStatsDisable(); | ||
|
||
private LedgerOffloaderStatsDisable() { | ||
|
||
} | ||
|
||
@Override | ||
public void recordOffloadError(String topic) { | ||
|
||
} | ||
|
||
@Override | ||
public void recordOffloadBytes(String topic, long size) { | ||
|
||
} | ||
|
||
@Override | ||
public void recordReadLedgerLatency(String topic, long latency, TimeUnit unit) { | ||
|
||
} | ||
|
||
@Override | ||
public void recordWriteToStorageError(String topic) { | ||
|
||
} | ||
|
||
@Override | ||
public void recordReadOffloadError(String topic) { | ||
|
||
} | ||
|
||
@Override | ||
public void recordReadOffloadBytes(String topic, long size) { | ||
|
||
} | ||
|
||
@Override | ||
public void recordReadOffloadIndexLatency(String topic, long latency, TimeUnit unit) { | ||
|
||
} | ||
|
||
@Override | ||
public void recordReadOffloadDataLatency(String topic, long latency, TimeUnit unit) { | ||
|
||
} | ||
|
||
@Override | ||
public void recordDeleteOffloadOps(String topic, boolean succeed) { | ||
|
||
} | ||
|
||
@Override | ||
public void close() throws Exception { | ||
|
||
} | ||
} |
Oops, something went wrong.