You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@bookkeeper.apache.org by GitBox <gi...@apache.org> on 2022/06/15 07:05:14 UTC

[GitHub] [bookkeeper] eolivelli commented on a diff in pull request #3263: BP-47 (task6): Direct I/O entrylogger support

eolivelli commented on code in PR #3263:
URL: https://github.com/apache/bookkeeper/pull/3263#discussion_r897607221


##########
bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/storage/directentrylogger/DirectEntryLoggerStats.java:
##########
@@ -0,0 +1,174 @@
+/**
+ *
+ * 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.bookie.storage.directentrylogger;
+import static org.apache.bookkeeper.bookie.BookKeeperServerStats.BOOKIE_ADD_ENTRY;
+import static org.apache.bookkeeper.bookie.BookKeeperServerStats.BOOKIE_READ_ENTRY;
+import static org.apache.bookkeeper.bookie.BookKeeperServerStats.BOOKIE_SCOPE;
+import static org.apache.bookkeeper.bookie.BookKeeperServerStats.CATEGORY_SERVER;
+
+import org.apache.bookkeeper.stats.Counter;
+import org.apache.bookkeeper.stats.OpStatsLogger;
+import org.apache.bookkeeper.stats.StatsLogger;
+import org.apache.bookkeeper.stats.annotations.StatsDoc;
+
+@StatsDoc(
+        name = BOOKIE_SCOPE,
+        category = CATEGORY_SERVER,
+        help = "Direct entry logger stats"
+)
+class DirectEntryLoggerStats {
+    private static final String ADD_ENTRY = "entrylog-add-entry";
+    private static final String READ_ENTRY = "entrylog-read-entry";
+    private static final String FLUSH = "entrylog-flush";
+    private static final String WRITER_FLUSH = "entrylog-writer-flush";
+    private static final String READ_BLOCK = "entrylog-read-block";
+    private static final String READER_OPEN = "entrylog-open-reader";
+    private static final String READER_CLOSE = "entrylog-close-reader";
+    private static final String CACHED_READER_SERVED_CLOSED = "entrylog-cached-reader-closed";
+
+    @StatsDoc(
+              name = ADD_ENTRY,
+              help = "Operation stats of adding entries to the entry log",
+              parent = BOOKIE_ADD_ENTRY
+    )
+    private final OpStatsLogger addEntryStats;
+
+    @StatsDoc(
+              name = READ_ENTRY,
+              help = "Operation stats of reading entries from the entry log",
+              parent = BOOKIE_READ_ENTRY
+    )
+    private final ThreadLocal<OpStatsLogger> readEntryStats;

Review Comment:
   ThreadLocal must be static, because it is actually not bound to a specific instance.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@bookkeeper.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org