Skip to content

Commit

Permalink
Enable other class find all threadpool and logspaces (#201)
Browse files Browse the repository at this point in the history
* update 2.1.1-SNAPSHOT

* enable other class find all threadpool and logspaces

---------

Co-authored-by: “HzjNeverStop” <“[email protected]”>
  • Loading branch information
HzjNeverStop and “HzjNeverStop” authored Mar 22, 2024
1 parent 92bf6aa commit 6155d06
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import org.slf4j.Logger;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

Expand Down Expand Up @@ -361,4 +362,8 @@ private static AbstractLoggerSpaceFactory createILoggerFactory(SpaceId spaceId,

return NOP_LOGGER_FACTORY;
}

public static Map<SpaceId, LogSpace> getLogFactoryMap() {
return new HashMap<>(LOG_FACTORY_MAP);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
import com.alipay.sofa.common.thread.space.ThreadPoolSpace;
import com.alipay.sofa.common.utils.StringUtil;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Map;
import java.util.concurrent.*;

Expand Down Expand Up @@ -366,4 +368,7 @@ public void setMonitorThreadPoolBySpaceName(String spaceName, long period) {
});
ThreadLogger.info("Thread pool with spaceName '{}' rescheduled with period '{}'", spaceName, period);
}
public Collection<ThreadPoolMonitorWrapper> getAllThreadPoolWrappers() {
return new ArrayList<>(registry.values());
}
}

0 comments on commit 6155d06

Please sign in to comment.