File tree 1 file changed +7
-0
lines changed
gax-java/gax/src/main/java/com/google/api/gax/core
1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change 34
34
import java .util .concurrent .ScheduledThreadPoolExecutor ;
35
35
import java .util .concurrent .ThreadFactory ;
36
36
import java .util .concurrent .atomic .AtomicInteger ;
37
+ import java .util .logging .Level ;
38
+ import java .util .logging .Logger ;
37
39
38
40
/**
39
41
* InstantiatingChannelProvider is an ExecutorProvider which constructs a new
40
42
* ScheduledExecutorService every time getExecutor() is called.
41
43
*/
42
44
@ AutoValue
43
45
public abstract class InstantiatingExecutorProvider implements ExecutorProvider {
46
+ private static final Logger LOGGER =
47
+ Logger .getLogger (InstantiatingExecutorProvider .class .getName ());
48
+
44
49
// Thread factory to use to create our worker threads
45
50
private static final ThreadFactory DEFAULT_THREAD_FACTORY =
46
51
new ThreadFactory () {
@@ -95,6 +100,8 @@ public static Builder newBuilder() {
95
100
public static Builder newIOBuilder () {
96
101
int numCpus = Runtime .getRuntime ().availableProcessors ();
97
102
int numThreads = IO_THREAD_MULTIPLIER * Math .max (MIN_THREAD_AMOUNT , numCpus );
103
+ LOGGER .log (
104
+ Level .CONFIG , String .format ("Thread Pool for requests has Core Pool Size: %d" , numThreads ));
98
105
99
106
return new AutoValue_InstantiatingExecutorProvider .Builder ()
100
107
.setExecutorThreadCount (numThreads )
You can’t perform that action at this time.
0 commit comments