提交 63e9c54f 编写于 作者: P peng-yongsheng

Memory pool metric pyramid aggregate.

上级 2428e8a8
......@@ -55,6 +55,16 @@ public class WorkerIdDefine {
public static final int MEMORY_MONTH_METRIC_PERSISTENCE_WORKER_ID = 3208;
public static final int MEMORY_MONTH_METRIC_TRANSFORM_NODE_ID = 3209;
public static final int MEMORY_POOL_METRIC_BRIDGE_NODE_ID = 3300;
public static final int MEMORY_POOL_SECOND_METRIC_PERSISTENCE_WORKER_ID = 3301;
public static final int MEMORY_POOL_MINUTE_METRIC_PERSISTENCE_WORKER_ID = 3302;
public static final int MEMORY_POOL_MINUTE_METRIC_TRANSFORM_NODE_ID = 3303;
public static final int MEMORY_POOL_HOUR_METRIC_PERSISTENCE_WORKER_ID = 3304;
public static final int MEMORY_POOL_HOUR_METRIC_TRANSFORM_NODE_ID = 3305;
public static final int MEMORY_POOL_DAY_METRIC_PERSISTENCE_WORKER_ID = 3306;
public static final int MEMORY_POOL_DAY_METRIC_TRANSFORM_NODE_ID = 3307;
public static final int MEMORY_POOL_MONTH_METRIC_PERSISTENCE_WORKER_ID = 3308;
public static final int MEMORY_POOL_MONTH_METRIC_TRANSFORM_NODE_ID = 3309;
public static final int INST_HEART_BEAT_PERSISTENCE_WORKER_ID = 302;
public static final int MEMORY_POOL_METRIC_PERSISTENCE_WORKER_ID = 303;
}
......@@ -34,7 +34,7 @@ import org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.cpu.CpuM
import org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.gc.GCMetricPersistenceGraph;
import org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.InstanceHeartBeatPersistenceGraph;
import org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.memory.MemoryMetricPersistenceGraph;
import org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.MemoryPoolMetricPersistenceGraph;
import org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.memorypool.MemoryPoolMetricPersistenceGraph;
import org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerCreateListener;
import org.apache.skywalking.apm.collector.analysis.worker.timer.PersistenceTimer;
import org.apache.skywalking.apm.collector.core.module.Module;
......
/*
* 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.skywalking.apm.collector.analysis.jvm.provider.worker.memorypool;
import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.WorkerIdDefine;
import org.apache.skywalking.apm.collector.analysis.worker.model.impl.PersistenceWorker;
import org.apache.skywalking.apm.collector.analysis.worker.model.impl.PersistenceWorkerProvider;
import org.apache.skywalking.apm.collector.core.module.ModuleManager;
import org.apache.skywalking.apm.collector.storage.StorageModule;
import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO;
import org.apache.skywalking.apm.collector.storage.dao.mpoolmp.IMemoryPoolDayMetricPersistenceDAO;
import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetric;
/**
* @author peng-yongsheng
*/
public class MemoryPoolDayMetricPersistenceWorker extends PersistenceWorker<MemoryPoolMetric> {
@Override public int id() {
return WorkerIdDefine.MEMORY_POOL_DAY_METRIC_PERSISTENCE_WORKER_ID;
}
public MemoryPoolDayMetricPersistenceWorker(ModuleManager moduleManager) {
super(moduleManager);
}
@Override protected boolean needMergeDBData() {
return true;
}
@SuppressWarnings("unchecked")
@Override protected IPersistenceDAO<?, ?, MemoryPoolMetric> persistenceDAO() {
return getModuleManager().find(StorageModule.NAME).getService(IMemoryPoolDayMetricPersistenceDAO.class);
}
public static class Factory extends PersistenceWorkerProvider<MemoryPoolMetric, MemoryPoolDayMetricPersistenceWorker> {
public Factory(ModuleManager moduleManager) {
super(moduleManager);
}
@Override public MemoryPoolDayMetricPersistenceWorker workerInstance(ModuleManager moduleManager) {
return new MemoryPoolDayMetricPersistenceWorker(moduleManager);
}
@Override
public int queueSize() {
return 1024;
}
}
}
/*
* 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.skywalking.apm.collector.analysis.jvm.provider.worker.memorypool;
import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.WorkerIdDefine;
import org.apache.skywalking.apm.collector.core.graph.Next;
import org.apache.skywalking.apm.collector.core.graph.NodeProcessor;
import org.apache.skywalking.apm.collector.core.util.Const;
import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils;
import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetric;
/**
* @author peng-yongsheng
*/
public class MemoryPoolDayMetricTransformNode implements NodeProcessor<MemoryPoolMetric, MemoryPoolMetric> {
@Override public int id() {
return WorkerIdDefine.MEMORY_POOL_DAY_METRIC_TRANSFORM_NODE_ID;
}
@Override public void process(MemoryPoolMetric memoryPoolMetric, Next<MemoryPoolMetric> next) {
long timeBucket = TimeBucketUtils.INSTANCE.secondToDay(memoryPoolMetric.getTimeBucket());
memoryPoolMetric.setId(String.valueOf(timeBucket) + Const.ID_SPLIT + memoryPoolMetric.getMetricId());
memoryPoolMetric.setTimeBucket(timeBucket);
next.execute(memoryPoolMetric);
}
}
/*
* 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.skywalking.apm.collector.analysis.jvm.provider.worker.memorypool;
import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.WorkerIdDefine;
import org.apache.skywalking.apm.collector.analysis.worker.model.impl.PersistenceWorker;
import org.apache.skywalking.apm.collector.analysis.worker.model.impl.PersistenceWorkerProvider;
import org.apache.skywalking.apm.collector.core.module.ModuleManager;
import org.apache.skywalking.apm.collector.storage.StorageModule;
import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO;
import org.apache.skywalking.apm.collector.storage.dao.mpoolmp.IMemoryPoolHourMetricPersistenceDAO;
import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetric;
/**
* @author peng-yongsheng
*/
public class MemoryPoolHourMetricPersistenceWorker extends PersistenceWorker<MemoryPoolMetric> {
@Override public int id() {
return WorkerIdDefine.MEMORY_POOL_HOUR_METRIC_PERSISTENCE_WORKER_ID;
}
public MemoryPoolHourMetricPersistenceWorker(ModuleManager moduleManager) {
super(moduleManager);
}
@Override protected boolean needMergeDBData() {
return true;
}
@SuppressWarnings("unchecked")
@Override protected IPersistenceDAO<?, ?, MemoryPoolMetric> persistenceDAO() {
return getModuleManager().find(StorageModule.NAME).getService(IMemoryPoolHourMetricPersistenceDAO.class);
}
public static class Factory extends PersistenceWorkerProvider<MemoryPoolMetric, MemoryPoolHourMetricPersistenceWorker> {
public Factory(ModuleManager moduleManager) {
super(moduleManager);
}
@Override public MemoryPoolHourMetricPersistenceWorker workerInstance(ModuleManager moduleManager) {
return new MemoryPoolHourMetricPersistenceWorker(moduleManager);
}
@Override
public int queueSize() {
return 1024;
}
}
}
/*
* 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.skywalking.apm.collector.analysis.jvm.provider.worker.memorypool;
import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.WorkerIdDefine;
import org.apache.skywalking.apm.collector.core.graph.Next;
import org.apache.skywalking.apm.collector.core.graph.NodeProcessor;
import org.apache.skywalking.apm.collector.core.util.Const;
import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils;
import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetric;
/**
* @author peng-yongsheng
*/
public class MemoryPoolHourMetricTransformNode implements NodeProcessor<MemoryPoolMetric, MemoryPoolMetric> {
@Override public int id() {
return WorkerIdDefine.MEMORY_POOL_HOUR_METRIC_TRANSFORM_NODE_ID;
}
@Override public void process(MemoryPoolMetric memoryPoolMetric, Next<MemoryPoolMetric> next) {
long timeBucket = TimeBucketUtils.INSTANCE.secondToHour(memoryPoolMetric.getTimeBucket());
memoryPoolMetric.setId(String.valueOf(timeBucket) + Const.ID_SPLIT + memoryPoolMetric.getMetricId());
memoryPoolMetric.setTimeBucket(timeBucket);
next.execute(memoryPoolMetric);
}
}
/*
* 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.skywalking.apm.collector.analysis.jvm.provider.worker.memorypool;
import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.WorkerIdDefine;
import org.apache.skywalking.apm.collector.core.graph.Next;
import org.apache.skywalking.apm.collector.core.graph.NodeProcessor;
import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetric;
/**
* @author peng-yongsheng
*/
public class MemoryPoolMetricBridgeNode implements NodeProcessor<MemoryPoolMetric, MemoryPoolMetric> {
@Override public int id() {
return WorkerIdDefine.MEMORY_POOL_METRIC_BRIDGE_NODE_ID;
}
@Override public void process(MemoryPoolMetric metric, Next<MemoryPoolMetric> next) {
next.execute(metric);
}
}
......@@ -16,11 +16,12 @@
*
*/
package org.apache.skywalking.apm.collector.analysis.jvm.provider.worker;
package org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.memorypool;
import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.GraphIdDefine;
import org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerCreateListener;
import org.apache.skywalking.apm.collector.core.graph.GraphManager;
import org.apache.skywalking.apm.collector.core.graph.Node;
import org.apache.skywalking.apm.collector.core.module.ModuleManager;
import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetric;
......@@ -38,7 +39,21 @@ public class MemoryPoolMetricPersistenceGraph {
}
public void create() {
GraphManager.INSTANCE.createIfAbsent(GraphIdDefine.MEMORY_POOL_METRIC_PERSISTENCE_GRAPH_ID, MemoryPoolMetric.class)
.addNode(new MemoryPoolMetricPersistenceWorker.Factory(moduleManager).create(workerCreateListener));
Node<MemoryPoolMetric, MemoryPoolMetric> bridgeNode = GraphManager.INSTANCE.createIfAbsent(GraphIdDefine.MEMORY_POOL_METRIC_PERSISTENCE_GRAPH_ID, MemoryPoolMetric.class)
.addNode(new MemoryPoolMetricBridgeNode());
bridgeNode.addNext(new MemoryPoolSecondMetricPersistenceWorker.Factory(moduleManager).create(workerCreateListener));
bridgeNode.addNext(new MemoryPoolMinuteMetricTransformNode())
.addNext(new MemoryPoolMinuteMetricPersistenceWorker.Factory(moduleManager).create(workerCreateListener));
bridgeNode.addNext(new MemoryPoolHourMetricTransformNode())
.addNext(new MemoryPoolHourMetricPersistenceWorker.Factory(moduleManager).create(workerCreateListener));
bridgeNode.addNext(new MemoryPoolDayMetricTransformNode())
.addNext(new MemoryPoolDayMetricPersistenceWorker.Factory(moduleManager).create(workerCreateListener));
bridgeNode.addNext(new MemoryPoolMonthMetricTransformNode())
.addNext(new MemoryPoolMonthMetricPersistenceWorker.Factory(moduleManager).create(workerCreateListener));
}
}
/*
* 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.skywalking.apm.collector.analysis.jvm.provider.worker.memorypool;
import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.WorkerIdDefine;
import org.apache.skywalking.apm.collector.analysis.worker.model.impl.PersistenceWorker;
import org.apache.skywalking.apm.collector.analysis.worker.model.impl.PersistenceWorkerProvider;
import org.apache.skywalking.apm.collector.core.module.ModuleManager;
import org.apache.skywalking.apm.collector.storage.StorageModule;
import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO;
import org.apache.skywalking.apm.collector.storage.dao.mpoolmp.IMemoryPoolMinuteMetricPersistenceDAO;
import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetric;
/**
* @author peng-yongsheng
*/
public class MemoryPoolMinuteMetricPersistenceWorker extends PersistenceWorker<MemoryPoolMetric> {
@Override public int id() {
return WorkerIdDefine.MEMORY_POOL_MINUTE_METRIC_PERSISTENCE_WORKER_ID;
}
public MemoryPoolMinuteMetricPersistenceWorker(ModuleManager moduleManager) {
super(moduleManager);
}
@Override protected boolean needMergeDBData() {
return true;
}
@SuppressWarnings("unchecked")
@Override protected IPersistenceDAO<?, ?, MemoryPoolMetric> persistenceDAO() {
return getModuleManager().find(StorageModule.NAME).getService(IMemoryPoolMinuteMetricPersistenceDAO.class);
}
public static class Factory extends PersistenceWorkerProvider<MemoryPoolMetric, MemoryPoolMinuteMetricPersistenceWorker> {
public Factory(ModuleManager moduleManager) {
super(moduleManager);
}
@Override public MemoryPoolMinuteMetricPersistenceWorker workerInstance(ModuleManager moduleManager) {
return new MemoryPoolMinuteMetricPersistenceWorker(moduleManager);
}
@Override
public int queueSize() {
return 1024;
}
}
}
/*
* 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.skywalking.apm.collector.analysis.jvm.provider.worker.memorypool;
import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.WorkerIdDefine;
import org.apache.skywalking.apm.collector.core.graph.Next;
import org.apache.skywalking.apm.collector.core.graph.NodeProcessor;
import org.apache.skywalking.apm.collector.core.util.Const;
import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils;
import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetric;
/**
* @author peng-yongsheng
*/
public class MemoryPoolMinuteMetricTransformNode implements NodeProcessor<MemoryPoolMetric, MemoryPoolMetric> {
@Override public int id() {
return WorkerIdDefine.MEMORY_POOL_MINUTE_METRIC_TRANSFORM_NODE_ID;
}
@Override public void process(MemoryPoolMetric memoryPoolMetric, Next<MemoryPoolMetric> next) {
long timeBucket = TimeBucketUtils.INSTANCE.secondToMinute(memoryPoolMetric.getTimeBucket());
memoryPoolMetric.setId(String.valueOf(timeBucket) + Const.ID_SPLIT + memoryPoolMetric.getMetricId());
memoryPoolMetric.setTimeBucket(timeBucket);
next.execute(memoryPoolMetric);
}
}
/*
* 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.skywalking.apm.collector.analysis.jvm.provider.worker.memorypool;
import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.WorkerIdDefine;
import org.apache.skywalking.apm.collector.analysis.worker.model.impl.PersistenceWorker;
import org.apache.skywalking.apm.collector.analysis.worker.model.impl.PersistenceWorkerProvider;
import org.apache.skywalking.apm.collector.core.module.ModuleManager;
import org.apache.skywalking.apm.collector.storage.StorageModule;
import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO;
import org.apache.skywalking.apm.collector.storage.dao.mpoolmp.IMemoryPoolMonthMetricPersistenceDAO;
import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetric;
/**
* @author peng-yongsheng
*/
public class MemoryPoolMonthMetricPersistenceWorker extends PersistenceWorker<MemoryPoolMetric> {
@Override public int id() {
return WorkerIdDefine.MEMORY_POOL_MONTH_METRIC_PERSISTENCE_WORKER_ID;
}
public MemoryPoolMonthMetricPersistenceWorker(ModuleManager moduleManager) {
super(moduleManager);
}
@Override protected boolean needMergeDBData() {
return true;
}
@SuppressWarnings("unchecked")
@Override protected IPersistenceDAO<?, ?, MemoryPoolMetric> persistenceDAO() {
return getModuleManager().find(StorageModule.NAME).getService(IMemoryPoolMonthMetricPersistenceDAO.class);
}
public static class Factory extends PersistenceWorkerProvider<MemoryPoolMetric, MemoryPoolMonthMetricPersistenceWorker> {
public Factory(ModuleManager moduleManager) {
super(moduleManager);
}
@Override public MemoryPoolMonthMetricPersistenceWorker workerInstance(ModuleManager moduleManager) {
return new MemoryPoolMonthMetricPersistenceWorker(moduleManager);
}
@Override
public int queueSize() {
return 1024;
}
}
}
/*
* 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.skywalking.apm.collector.analysis.jvm.provider.worker.memorypool;
import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.WorkerIdDefine;
import org.apache.skywalking.apm.collector.core.graph.Next;
import org.apache.skywalking.apm.collector.core.graph.NodeProcessor;
import org.apache.skywalking.apm.collector.core.util.Const;
import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils;
import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetric;
/**
* @author peng-yongsheng
*/
public class MemoryPoolMonthMetricTransformNode implements NodeProcessor<MemoryPoolMetric, MemoryPoolMetric> {
@Override public int id() {
return WorkerIdDefine.MEMORY_POOL_MONTH_METRIC_TRANSFORM_NODE_ID;
}
@Override public void process(MemoryPoolMetric memoryPoolMetric, Next<MemoryPoolMetric> next) {
long timeBucket = TimeBucketUtils.INSTANCE.secondToMonth(memoryPoolMetric.getTimeBucket());
memoryPoolMetric.setId(String.valueOf(timeBucket) + Const.ID_SPLIT + memoryPoolMetric.getMetricId());
memoryPoolMetric.setTimeBucket(timeBucket);
next.execute(memoryPoolMetric);
}
}
......@@ -16,7 +16,7 @@
*
*/
package org.apache.skywalking.apm.collector.analysis.jvm.provider.worker;
package org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.memorypool;
import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.WorkerIdDefine;
import org.apache.skywalking.apm.collector.analysis.worker.model.impl.PersistenceWorker;
......@@ -24,19 +24,19 @@ import org.apache.skywalking.apm.collector.analysis.worker.model.impl.Persistenc
import org.apache.skywalking.apm.collector.core.module.ModuleManager;
import org.apache.skywalking.apm.collector.storage.StorageModule;
import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO;
import org.apache.skywalking.apm.collector.storage.dao.IMemoryPoolMetricPersistenceDAO;
import org.apache.skywalking.apm.collector.storage.dao.mpoolmp.IMemoryPoolSecondMetricPersistenceDAO;
import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetric;
/**
* @author peng-yongsheng
*/
public class MemoryPoolMetricPersistenceWorker extends PersistenceWorker<MemoryPoolMetric> {
public class MemoryPoolSecondMetricPersistenceWorker extends PersistenceWorker<MemoryPoolMetric> {
@Override public int id() {
return WorkerIdDefine.MEMORY_POOL_METRIC_PERSISTENCE_WORKER_ID;
return WorkerIdDefine.MEMORY_POOL_SECOND_METRIC_PERSISTENCE_WORKER_ID;
}
public MemoryPoolMetricPersistenceWorker(ModuleManager moduleManager) {
public MemoryPoolSecondMetricPersistenceWorker(ModuleManager moduleManager) {
super(moduleManager);
}
......@@ -46,17 +46,17 @@ public class MemoryPoolMetricPersistenceWorker extends PersistenceWorker<MemoryP
@SuppressWarnings("unchecked")
@Override protected IPersistenceDAO<?, ?, MemoryPoolMetric> persistenceDAO() {
return getModuleManager().find(StorageModule.NAME).getService(IMemoryPoolMetricPersistenceDAO.class);
return getModuleManager().find(StorageModule.NAME).getService(IMemoryPoolSecondMetricPersistenceDAO.class);
}
public static class Factory extends PersistenceWorkerProvider<MemoryPoolMetric, MemoryPoolMetricPersistenceWorker> {
public static class Factory extends PersistenceWorkerProvider<MemoryPoolMetric, MemoryPoolSecondMetricPersistenceWorker> {
public Factory(ModuleManager moduleManager) {
super(moduleManager);
}
@Override public MemoryPoolMetricPersistenceWorker workerInstance(ModuleManager moduleManager) {
return new MemoryPoolMetricPersistenceWorker(moduleManager);
@Override public MemoryPoolSecondMetricPersistenceWorker workerInstance(ModuleManager moduleManager) {
return new MemoryPoolSecondMetricPersistenceWorker(moduleManager);
}
@Override
......
......@@ -55,7 +55,7 @@ import org.apache.skywalking.apm.collector.storage.dao.IInstanceRegisterDAO;
import org.apache.skywalking.apm.collector.storage.dao.IInstanceUIDAO;
import org.apache.skywalking.apm.collector.storage.dao.memorymp.IMemorySecondMetricPersistenceDAO;
import org.apache.skywalking.apm.collector.storage.dao.IMemoryMetricUIDAO;
import org.apache.skywalking.apm.collector.storage.dao.IMemoryPoolMetricPersistenceDAO;
import org.apache.skywalking.apm.collector.storage.dao.mpoolmp.IMemoryPoolSecondMetricPersistenceDAO;
import org.apache.skywalking.apm.collector.storage.dao.IMemoryPoolMetricUIDAO;
import org.apache.skywalking.apm.collector.storage.dao.INetworkAddressCacheDAO;
import org.apache.skywalking.apm.collector.storage.dao.INetworkAddressRegisterDAO;
......@@ -117,7 +117,7 @@ public class StorageModule extends Module {
classes.add(ICpuSecondMetricPersistenceDAO.class);
classes.add(IGCSecondMetricPersistenceDAO.class);
classes.add(IMemorySecondMetricPersistenceDAO.class);
classes.add(IMemoryPoolMetricPersistenceDAO.class);
classes.add(IMemoryPoolSecondMetricPersistenceDAO.class);
classes.add(IGlobalTracePersistenceDAO.class);
classes.add(IApplicationComponentMinutePersistenceDAO.class);
......
......@@ -16,7 +16,7 @@
*
*/
package org.apache.skywalking.apm.collector.storage.dao;
package org.apache.skywalking.apm.collector.storage.dao.mpoolmp;
import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO;
import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetric;
......@@ -24,5 +24,5 @@ import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetric;
/**
* @author peng-yongsheng
*/
public interface IMemoryPoolMetricPersistenceDAO<Insert, Update, DataImpl extends MemoryPoolMetric> extends IPersistenceDAO<Insert, Update, DataImpl> {
public interface IMemoryPoolDayMetricPersistenceDAO<INSERT, UPDATE, STREAM_DATA extends MemoryPoolMetric> extends IPersistenceDAO<INSERT, UPDATE, STREAM_DATA> {
}
/*
* 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.skywalking.apm.collector.storage.dao.mpoolmp;
import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO;
import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetric;
/**
* @author peng-yongsheng
*/
public interface IMemoryPoolHourMetricPersistenceDAO<INSERT, UPDATE, STREAM_DATA extends MemoryPoolMetric> extends IPersistenceDAO<INSERT, UPDATE, STREAM_DATA> {
}
/*
* 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.skywalking.apm.collector.storage.dao.mpoolmp;
import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO;
import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetric;
/**
* @author peng-yongsheng
*/
public interface IMemoryPoolMinuteMetricPersistenceDAO<INSERT, UPDATE, STREAM_DATA extends MemoryPoolMetric> extends IPersistenceDAO<INSERT, UPDATE, STREAM_DATA> {
}
/*
* 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.skywalking.apm.collector.storage.dao.mpoolmp;
import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO;
import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetric;
/**
* @author peng-yongsheng
*/
public interface IMemoryPoolMonthMetricPersistenceDAO<INSERT, UPDATE, STREAM_DATA extends MemoryPoolMetric> extends IPersistenceDAO<INSERT, UPDATE, STREAM_DATA> {
}
/*
* 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.skywalking.apm.collector.storage.dao.mpoolmp;
import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO;
import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetric;
/**
* @author peng-yongsheng
*/
public interface IMemoryPoolSecondMetricPersistenceDAO<INSERT, UPDATE, STREAM_DATA extends MemoryPoolMetric> extends IPersistenceDAO<INSERT, UPDATE, STREAM_DATA> {
}
......@@ -16,21 +16,21 @@
*
*/
package org.apache.skywalking.apm.collector.storage.table.jvm;
import org.apache.skywalking.apm.collector.core.data.Column;
import org.apache.skywalking.apm.collector.core.data.AbstractData;
import org.apache.skywalking.apm.collector.core.data.StreamData;
import org.apache.skywalking.apm.collector.core.data.operator.CoverOperation;
import org.apache.skywalking.apm.collector.core.data.operator.NonOperation;
/**
* @author peng-yongsheng
*/
public class MemoryPoolMetric extends AbstractData {
public class MemoryPoolMetric extends StreamData {
private static final Column[] STRING_COLUMNS = {
new Column(MemoryPoolMetricTable.COLUMN_ID, new NonOperation()),
new Column(MemoryPoolMetricTable.COLUMN_METRIC_ID, new NonOperation()),
};
private static final Column[] LONG_COLUMNS = {
......@@ -50,10 +50,27 @@ public class MemoryPoolMetric extends AbstractData {
};
private static final Column[] BOOLEAN_COLUMNS = {};
private static final Column[] BYTE_COLUMNS = {};
public MemoryPoolMetric(String id) {
super(id, STRING_COLUMNS, LONG_COLUMNS, DOUBLE_COLUMNS, INTEGER_COLUMNS, BOOLEAN_COLUMNS, BYTE_COLUMNS);
public MemoryPoolMetric() {
super(STRING_COLUMNS, LONG_COLUMNS, DOUBLE_COLUMNS, INTEGER_COLUMNS, BOOLEAN_COLUMNS, BYTE_COLUMNS);
}
@Override public String getId() {
return getDataString(0);
}
@Override public void setId(String id) {
setDataString(0, id);
}
@Override public String getMetricId() {
return getDataString(1);
}
@Override public void setMetricId(String metricId) {
setDataString(1, metricId);
}
public Long getInit() {
......
......@@ -33,6 +33,7 @@ import org.apache.skywalking.apm.collector.storage.dao.cpump.ICpuSecondMetricPer
import org.apache.skywalking.apm.collector.storage.dao.gcmp.IGCSecondMetricPersistenceDAO;
import org.apache.skywalking.apm.collector.storage.dao.imp.IInstanceMinuteMetricPersistenceDAO;
import org.apache.skywalking.apm.collector.storage.dao.memorymp.IMemorySecondMetricPersistenceDAO;
import org.apache.skywalking.apm.collector.storage.dao.mpoolmp.IMemoryPoolSecondMetricPersistenceDAO;
import org.apache.skywalking.apm.collector.storage.dao.srmp.IServiceReferenceMinuteMetricPersistenceDAO;
/**
......@@ -86,7 +87,7 @@ public class DataTTLKeeperTimer {
IMemorySecondMetricPersistenceDAO memoryMetricPersistenceDAO = moduleManager.find(StorageModule.NAME).getService(IMemorySecondMetricPersistenceDAO.class);
memoryMetricPersistenceDAO.deleteHistory(startTimestamp, endTimestamp);
IMemoryPoolMetricPersistenceDAO memoryPoolMetricPersistenceDAO = moduleManager.find(StorageModule.NAME).getService(IMemoryPoolMetricPersistenceDAO.class);
IMemoryPoolSecondMetricPersistenceDAO memoryPoolMetricPersistenceDAO = moduleManager.find(StorageModule.NAME).getService(IMemoryPoolSecondMetricPersistenceDAO.class);
memoryPoolMetricPersistenceDAO.deleteHistory(startTimestamp, endTimestamp);
}
......
......@@ -64,7 +64,7 @@ import org.apache.skywalking.apm.collector.storage.dao.IInstanceRegisterDAO;
import org.apache.skywalking.apm.collector.storage.dao.IInstanceUIDAO;
import org.apache.skywalking.apm.collector.storage.dao.memorymp.IMemorySecondMetricPersistenceDAO;
import org.apache.skywalking.apm.collector.storage.dao.IMemoryMetricUIDAO;
import org.apache.skywalking.apm.collector.storage.dao.IMemoryPoolMetricPersistenceDAO;
import org.apache.skywalking.apm.collector.storage.dao.mpoolmp.IMemoryPoolSecondMetricPersistenceDAO;
import org.apache.skywalking.apm.collector.storage.dao.IMemoryPoolMetricUIDAO;
import org.apache.skywalking.apm.collector.storage.dao.INetworkAddressCacheDAO;
import org.apache.skywalking.apm.collector.storage.dao.INetworkAddressRegisterDAO;
......@@ -118,7 +118,7 @@ import org.apache.skywalking.apm.collector.storage.es.dao.InstanceReferenceAlarm
import org.apache.skywalking.apm.collector.storage.es.dao.irmp.InstanceReferenceMinuteMetricEsPersistenceDAO;
import org.apache.skywalking.apm.collector.storage.es.dao.memorymp.MemorySecondMetricEsPersistenceDAO;
import org.apache.skywalking.apm.collector.storage.es.dao.MemoryMetricEsUIDAO;
import org.apache.skywalking.apm.collector.storage.es.dao.MemoryPoolMetricEsPersistenceDAO;
import org.apache.skywalking.apm.collector.storage.es.dao.mpoolmp.MemoryPoolSecondMetricEsPersistenceDAO;
import org.apache.skywalking.apm.collector.storage.es.dao.MemoryPoolMetricEsUIDAO;
import org.apache.skywalking.apm.collector.storage.es.dao.NetworkAddressEsCacheDAO;
import org.apache.skywalking.apm.collector.storage.es.dao.NetworkAddressRegisterEsDAO;
......@@ -230,7 +230,7 @@ public class StorageModuleEsProvider extends ModuleProvider {
this.registerServiceImplementation(ICpuSecondMetricPersistenceDAO.class, new CpuSecondMetricEsPersistenceDAO(elasticSearchClient));
this.registerServiceImplementation(IGCSecondMetricPersistenceDAO.class, new GCSecondMetricEsPersistenceDAO(elasticSearchClient));
this.registerServiceImplementation(IMemorySecondMetricPersistenceDAO.class, new MemorySecondMetricEsPersistenceDAO(elasticSearchClient));
this.registerServiceImplementation(IMemoryPoolMetricPersistenceDAO.class, new MemoryPoolMetricEsPersistenceDAO(elasticSearchClient));
this.registerServiceImplementation(IMemoryPoolSecondMetricPersistenceDAO.class, new MemoryPoolSecondMetricEsPersistenceDAO(elasticSearchClient));
this.registerServiceImplementation(IGlobalTracePersistenceDAO.class, new GlobalTraceEsPersistenceDAO(elasticSearchClient));
this.registerServiceImplementation(IApplicationComponentMinutePersistenceDAO.class, new ApplicationComponentMinuteEsPersistenceDAO(elasticSearchClient));
......
/*
* 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.skywalking.apm.collector.storage.es.dao;
import java.util.HashMap;
import java.util.Map;
import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient;
import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils;
import org.apache.skywalking.apm.collector.storage.dao.IMemoryPoolMetricPersistenceDAO;
import org.apache.skywalking.apm.collector.storage.es.base.dao.EsDAO;
import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetric;
import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetricTable;
import org.elasticsearch.action.index.IndexRequestBuilder;
import org.elasticsearch.action.update.UpdateRequestBuilder;
import org.elasticsearch.index.query.QueryBuilders;
import org.elasticsearch.index.reindex.BulkByScrollResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* @author peng-yongsheng
*/
public class MemoryPoolMetricEsPersistenceDAO extends EsDAO implements IMemoryPoolMetricPersistenceDAO<IndexRequestBuilder, UpdateRequestBuilder, MemoryPoolMetric> {
private final Logger logger = LoggerFactory.getLogger(MemoryPoolMetricEsPersistenceDAO.class);
public MemoryPoolMetricEsPersistenceDAO(ElasticSearchClient client) {
super(client);
}
@Override public MemoryPoolMetric get(String id) {
return null;
}
@Override public IndexRequestBuilder prepareBatchInsert(MemoryPoolMetric data) {
Map<String, Object> source = new HashMap<>();
source.put(MemoryPoolMetricTable.COLUMN_INSTANCE_ID, data.getInstanceId());
source.put(MemoryPoolMetricTable.COLUMN_POOL_TYPE, data.getPoolType());
source.put(MemoryPoolMetricTable.COLUMN_INIT, data.getInit());
source.put(MemoryPoolMetricTable.COLUMN_MAX, data.getMax());
source.put(MemoryPoolMetricTable.COLUMN_USED, data.getUsed());
source.put(MemoryPoolMetricTable.COLUMN_COMMITTED, data.getCommitted());
source.put(MemoryPoolMetricTable.COLUMN_TIME_BUCKET, data.getTimeBucket());
return getClient().prepareIndex(MemoryPoolMetricTable.TABLE, data.getId()).setSource(source);
}
@Override public UpdateRequestBuilder prepareBatchUpdate(MemoryPoolMetric data) {
return null;
}
@Override public void deleteHistory(Long startTimestamp, Long endTimestamp) {
long startTimeBucket = TimeBucketUtils.INSTANCE.getSecondTimeBucket(startTimestamp);
long endTimeBucket = TimeBucketUtils.INSTANCE.getSecondTimeBucket(endTimestamp);
BulkByScrollResponse response = getClient().prepareDelete()
.filter(QueryBuilders.rangeQuery(MemoryPoolMetricTable.COLUMN_TIME_BUCKET).gte(startTimeBucket).lte(endTimeBucket))
.source(MemoryPoolMetricTable.TABLE)
.get();
long deleted = response.getDeleted();
logger.info("Delete {} rows history from {} index.", deleted, MemoryPoolMetricTable.TABLE);
}
}
/*
* 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.skywalking.apm.collector.storage.es.dao.mpoolmp;
import java.util.HashMap;
import java.util.Map;
import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient;
import org.apache.skywalking.apm.collector.storage.es.base.dao.AbstractPersistenceEsDAO;
import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetric;
import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetricTable;
/**
* @author peng-yongsheng
*/
public abstract class AbstractMemoryPoolMetricEsPersistenceDAO extends AbstractPersistenceEsDAO<MemoryPoolMetric> {
AbstractMemoryPoolMetricEsPersistenceDAO(ElasticSearchClient client) {
super(client);
}
@Override protected final String timeBucketColumnNameForDelete() {
return MemoryPoolMetricTable.COLUMN_TIME_BUCKET;
}
@Override protected final MemoryPoolMetric esDataToStreamData(Map<String, Object> source) {
return null;
}
@Override protected final Map<String, Object> esStreamDataToEsData(MemoryPoolMetric streamData) {
Map<String, Object> source = new HashMap<>();
source.put(MemoryPoolMetricTable.COLUMN_ID, streamData.getId());
source.put(MemoryPoolMetricTable.COLUMN_METRIC_ID, streamData.getMetricId());
source.put(MemoryPoolMetricTable.COLUMN_INSTANCE_ID, streamData.getInstanceId());
source.put(MemoryPoolMetricTable.COLUMN_POOL_TYPE, streamData.getPoolType());
source.put(MemoryPoolMetricTable.COLUMN_INIT, streamData.getInit());
source.put(MemoryPoolMetricTable.COLUMN_MAX, streamData.getMax());
source.put(MemoryPoolMetricTable.COLUMN_USED, streamData.getUsed());
source.put(MemoryPoolMetricTable.COLUMN_COMMITTED, streamData.getCommitted());
source.put(MemoryPoolMetricTable.COLUMN_TIME_BUCKET, streamData.getTimeBucket());
return source;
}
}
/*
* 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.skywalking.apm.collector.storage.es.dao.mpoolmp;
import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient;
import org.apache.skywalking.apm.collector.core.storage.TimePyramid;
import org.apache.skywalking.apm.collector.core.util.Const;
import org.apache.skywalking.apm.collector.storage.dao.mpoolmp.IMemoryPoolDayMetricPersistenceDAO;
import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetric;
import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetricTable;
import org.elasticsearch.action.index.IndexRequestBuilder;
import org.elasticsearch.action.update.UpdateRequestBuilder;
/**
* @author peng-yongsheng
*/
public class MemoryPoolDayMetricEsPersistenceDAO extends AbstractMemoryPoolMetricEsPersistenceDAO implements IMemoryPoolDayMetricPersistenceDAO<IndexRequestBuilder, UpdateRequestBuilder, MemoryPoolMetric> {
public MemoryPoolDayMetricEsPersistenceDAO(ElasticSearchClient client) {
super(client);
}
@Override protected String tableName() {
return MemoryPoolMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName();
}
}
/*
* 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.skywalking.apm.collector.storage.es.dao.mpoolmp;
import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient;
import org.apache.skywalking.apm.collector.core.storage.TimePyramid;
import org.apache.skywalking.apm.collector.core.util.Const;
import org.apache.skywalking.apm.collector.storage.dao.mpoolmp.IMemoryPoolHourMetricPersistenceDAO;
import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetric;
import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetricTable;
import org.elasticsearch.action.index.IndexRequestBuilder;
import org.elasticsearch.action.update.UpdateRequestBuilder;
/**
* @author peng-yongsheng
*/
public class MemoryPoolHourMetricEsPersistenceDAO extends AbstractMemoryPoolMetricEsPersistenceDAO implements IMemoryPoolHourMetricPersistenceDAO<IndexRequestBuilder, UpdateRequestBuilder, MemoryPoolMetric> {
public MemoryPoolHourMetricEsPersistenceDAO(ElasticSearchClient client) {
super(client);
}
@Override protected String tableName() {
return MemoryPoolMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName();
}
}
/*
* 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.skywalking.apm.collector.storage.es.dao.mpoolmp;
import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient;
import org.apache.skywalking.apm.collector.core.storage.TimePyramid;
import org.apache.skywalking.apm.collector.core.util.Const;
import org.apache.skywalking.apm.collector.storage.dao.mpoolmp.IMemoryPoolMinuteMetricPersistenceDAO;
import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetric;
import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetricTable;
import org.elasticsearch.action.index.IndexRequestBuilder;
import org.elasticsearch.action.update.UpdateRequestBuilder;
/**
* @author peng-yongsheng
*/
public class MemoryPoolMinuteMetricEsPersistenceDAO extends AbstractMemoryPoolMetricEsPersistenceDAO implements IMemoryPoolMinuteMetricPersistenceDAO<IndexRequestBuilder, UpdateRequestBuilder, MemoryPoolMetric> {
public MemoryPoolMinuteMetricEsPersistenceDAO(ElasticSearchClient client) {
super(client);
}
@Override protected String tableName() {
return MemoryPoolMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName();
}
}
/*
* 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.skywalking.apm.collector.storage.es.dao.mpoolmp;
import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient;
import org.apache.skywalking.apm.collector.core.storage.TimePyramid;
import org.apache.skywalking.apm.collector.core.util.Const;
import org.apache.skywalking.apm.collector.storage.dao.mpoolmp.IMemoryPoolMonthMetricPersistenceDAO;
import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetric;
import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetricTable;
import org.elasticsearch.action.index.IndexRequestBuilder;
import org.elasticsearch.action.update.UpdateRequestBuilder;
/**
* @author peng-yongsheng
*/
public class MemoryPoolMonthMetricEsPersistenceDAO extends AbstractMemoryPoolMetricEsPersistenceDAO implements IMemoryPoolMonthMetricPersistenceDAO<IndexRequestBuilder, UpdateRequestBuilder, MemoryPoolMetric> {
public MemoryPoolMonthMetricEsPersistenceDAO(ElasticSearchClient client) {
super(client);
}
@Override protected String tableName() {
return MemoryPoolMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName();
}
}
/*
* 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.skywalking.apm.collector.storage.es.dao.mpoolmp;
import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient;
import org.apache.skywalking.apm.collector.core.storage.TimePyramid;
import org.apache.skywalking.apm.collector.core.util.Const;
import org.apache.skywalking.apm.collector.storage.dao.mpoolmp.IMemoryPoolSecondMetricPersistenceDAO;
import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetric;
import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetricTable;
import org.elasticsearch.action.index.IndexRequestBuilder;
import org.elasticsearch.action.update.UpdateRequestBuilder;
/**
* @author peng-yongsheng
*/
public class MemoryPoolSecondMetricEsPersistenceDAO extends AbstractMemoryPoolMetricEsPersistenceDAO implements IMemoryPoolSecondMetricPersistenceDAO<IndexRequestBuilder, UpdateRequestBuilder, MemoryPoolMetric> {
public MemoryPoolSecondMetricEsPersistenceDAO(ElasticSearchClient client) {
super(client);
}
@Override protected String tableName() {
return MemoryPoolMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Second.getName();
}
}
......@@ -60,7 +60,7 @@ import org.apache.skywalking.apm.collector.storage.dao.IInstanceRegisterDAO;
import org.apache.skywalking.apm.collector.storage.dao.IInstanceUIDAO;
import org.apache.skywalking.apm.collector.storage.dao.memorymp.IMemorySecondMetricPersistenceDAO;
import org.apache.skywalking.apm.collector.storage.dao.IMemoryMetricUIDAO;
import org.apache.skywalking.apm.collector.storage.dao.IMemoryPoolMetricPersistenceDAO;
import org.apache.skywalking.apm.collector.storage.dao.mpoolmp.IMemoryPoolSecondMetricPersistenceDAO;
import org.apache.skywalking.apm.collector.storage.dao.IMemoryPoolMetricUIDAO;
import org.apache.skywalking.apm.collector.storage.dao.INetworkAddressCacheDAO;
import org.apache.skywalking.apm.collector.storage.dao.INetworkAddressRegisterDAO;
......@@ -114,7 +114,7 @@ import org.apache.skywalking.apm.collector.storage.h2.dao.InstanceReferenceAlarm
import org.apache.skywalking.apm.collector.storage.h2.dao.InstanceReferenceMetricH2PersistenceDAO;
import org.apache.skywalking.apm.collector.storage.h2.dao.MemorySecondMetricH2PersistenceDAO;
import org.apache.skywalking.apm.collector.storage.h2.dao.MemoryMetricH2UIDAO;
import org.apache.skywalking.apm.collector.storage.h2.dao.MemoryPoolMetricH2PersistenceDAO;
import org.apache.skywalking.apm.collector.storage.h2.dao.MemoryPoolSecondMetricH2PersistenceDAO;
import org.apache.skywalking.apm.collector.storage.h2.dao.MemoryPoolMetricH2UIDAO;
import org.apache.skywalking.apm.collector.storage.h2.dao.NetworkAddressH2CacheDAO;
import org.apache.skywalking.apm.collector.storage.h2.dao.NetworkAddressRegisterH2DAO;
......@@ -208,7 +208,7 @@ public class StorageModuleH2Provider extends ModuleProvider {
this.registerServiceImplementation(ICpuSecondMetricPersistenceDAO.class, new CpuSecondMetricH2PersistenceDAO(h2Client));
this.registerServiceImplementation(IGCSecondMetricPersistenceDAO.class, new GCSecondMetricH2PersistenceDAO(h2Client));
this.registerServiceImplementation(IMemorySecondMetricPersistenceDAO.class, new MemorySecondMetricH2PersistenceDAO(h2Client));
this.registerServiceImplementation(IMemoryPoolMetricPersistenceDAO.class, new MemoryPoolMetricH2PersistenceDAO(h2Client));
this.registerServiceImplementation(IMemoryPoolSecondMetricPersistenceDAO.class, new MemoryPoolSecondMetricH2PersistenceDAO(h2Client));
this.registerServiceImplementation(IGlobalTracePersistenceDAO.class, new GlobalTraceH2PersistenceDAO(h2Client));
this.registerServiceImplementation(IApplicationComponentMinutePersistenceDAO.class, new ApplicationComponentH2MinutePersistenceDAO(h2Client));
......
......@@ -23,7 +23,7 @@ import java.util.HashMap;
import java.util.Map;
import org.apache.skywalking.apm.collector.client.h2.H2Client;
import org.apache.skywalking.apm.collector.storage.base.sql.SqlBuilder;
import org.apache.skywalking.apm.collector.storage.dao.IMemoryPoolMetricPersistenceDAO;
import org.apache.skywalking.apm.collector.storage.dao.mpoolmp.IMemoryPoolSecondMetricPersistenceDAO;
import org.apache.skywalking.apm.collector.storage.h2.base.dao.H2DAO;
import org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity;
import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetric;
......@@ -32,9 +32,9 @@ import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetricTab
/**
* @author peng-yongsheng, clevertension
*/
public class MemoryPoolMetricH2PersistenceDAO extends H2DAO implements IMemoryPoolMetricPersistenceDAO<H2SqlEntity, H2SqlEntity, MemoryPoolMetric> {
public class MemoryPoolSecondMetricH2PersistenceDAO extends H2DAO implements IMemoryPoolSecondMetricPersistenceDAO<H2SqlEntity, H2SqlEntity, MemoryPoolMetric> {
public MemoryPoolMetricH2PersistenceDAO(H2Client client) {
public MemoryPoolSecondMetricH2PersistenceDAO(H2Client client) {
super(client);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册