You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by wu...@apache.org on 2018/04/08 15:14:50 UTC
[incubator-servicecomb-java-chassis] 05/09: SCB-422 define
threadPool publish model
This is an automated email from the ASF dual-hosted git repository.
wujimin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-java-chassis.git
commit 02e392a9859d7d56e104473f657256fb0e792437
Author: wujimin <wu...@huawei.com>
AuthorDate: Mon Apr 2 11:30:07 2018 +0800
SCB-422 define threadPool publish model
---
.../core/publish/model/DefaultPublishModel.java | 21 +++++
.../core/publish/model/ThreadPoolPublishModel.java | 89 ++++++++++++++++++++++
2 files changed, 110 insertions(+)
diff --git a/metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/publish/model/DefaultPublishModel.java b/metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/publish/model/DefaultPublishModel.java
index 8258425..b33ab58 100644
--- a/metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/publish/model/DefaultPublishModel.java
+++ b/metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/publish/model/DefaultPublishModel.java
@@ -16,16 +16,37 @@
*/
package org.apache.servicecomb.metrics.core.publish.model;
+import java.util.HashMap;
+import java.util.Map;
+
public class DefaultPublishModel {
private ConsumerPublishModel consumer = new ConsumerPublishModel();
private ProducerPublishModel producer = new ProducerPublishModel();
+ private Map<String, ThreadPoolPublishModel> threadPools = new HashMap<>();
+
public ConsumerPublishModel getConsumer() {
return consumer;
}
+ public void setConsumer(ConsumerPublishModel consumer) {
+ this.consumer = consumer;
+ }
+
public ProducerPublishModel getProducer() {
return producer;
}
+
+ public void setProducer(ProducerPublishModel producer) {
+ this.producer = producer;
+ }
+
+ public Map<String, ThreadPoolPublishModel> getThreadPools() {
+ return threadPools;
+ }
+
+ public void setThreadPools(Map<String, ThreadPoolPublishModel> threadPools) {
+ this.threadPools = threadPools;
+ }
}
diff --git a/metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/publish/model/ThreadPoolPublishModel.java b/metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/publish/model/ThreadPoolPublishModel.java
new file mode 100644
index 0000000..70c288b
--- /dev/null
+++ b/metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/publish/model/ThreadPoolPublishModel.java
@@ -0,0 +1,89 @@
+/*
+ * 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.servicecomb.metrics.core.publish.model;
+
+public class ThreadPoolPublishModel {
+ private double avgTaskCount;
+
+ private double avgCompletedTaskCount;
+
+ private int currentThreadsBusy;
+
+ private int maxThreads;
+
+ private int poolSize;
+
+ private int corePoolSize;
+
+ private int queueSize;
+
+ public double getAvgTaskCount() {
+ return avgTaskCount;
+ }
+
+ public void setAvgTaskCount(double avgTaskCount) {
+ this.avgTaskCount = avgTaskCount;
+ }
+
+ public double getAvgCompletedTaskCount() {
+ return avgCompletedTaskCount;
+ }
+
+ public void setAvgCompletedTaskCount(double avgCompletedTaskCount) {
+ this.avgCompletedTaskCount = avgCompletedTaskCount;
+ }
+
+ public int getCurrentThreadsBusy() {
+ return currentThreadsBusy;
+ }
+
+ public void setCurrentThreadsBusy(int currentThreadsBusy) {
+ this.currentThreadsBusy = currentThreadsBusy;
+ }
+
+ public int getMaxThreads() {
+ return maxThreads;
+ }
+
+ public void setMaxThreads(int maxThreads) {
+ this.maxThreads = maxThreads;
+ }
+
+ public int getPoolSize() {
+ return poolSize;
+ }
+
+ public void setPoolSize(int poolSize) {
+ this.poolSize = poolSize;
+ }
+
+ public int getCorePoolSize() {
+ return corePoolSize;
+ }
+
+ public void setCorePoolSize(int corePoolSize) {
+ this.corePoolSize = corePoolSize;
+ }
+
+ public int getQueueSize() {
+ return queueSize;
+ }
+
+ public void setQueueSize(int queueSize) {
+ this.queueSize = queueSize;
+ }
+}
--
To stop receiving notification emails like this one, please contact
wujimin@apache.org.