SaintBacchus commented on code in PR #9725: URL: https://github.com/apache/incubator-doris/pull/9725#discussion_r878984613
########## fe/fe-core/src/main/java/org/apache/doris/common/profile/InMemoryProfileStorage.java: ########## @@ -0,0 +1,159 @@ +// 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.doris.common.profile; + +import org.apache.doris.common.util.ProfileManager; +import org.apache.doris.common.util.ProfileManager.ProfileElement; +import org.apache.doris.common.util.ProfileManager.ProfileType; +import org.apache.doris.common.util.RuntimeProfile; + +import com.google.common.base.Strings; +import com.google.common.collect.Lists; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import java.util.Deque; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.locks.ReentrantReadWriteLock; +import java.util.concurrent.locks.ReentrantReadWriteLock.ReadLock; +import java.util.concurrent.locks.ReentrantReadWriteLock.WriteLock; + +/** + * An inMemory impl of profile storage. It will only keep 100 records in memory. + * If you want to keep more query records, you can use other impl of profile storage. + */ +public class InMemoryProfileStorage implements ProfileStorage { + private static final Logger LOG = LogManager.getLogger(InMemoryProfileStorage.class); + + private static final int ARRAY_SIZE = 100; Review Comment: This is a good idea. But this size is also hard code in web ui which plan to change in the last pr -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
