提交 69bdfbad 编写于 作者: P peng-yongsheng

GC metric pyramid aggregate test successful.

上级 1985fad1
......@@ -70,7 +70,7 @@ public class JVMMetricsServiceHandler extends JVMMetricsServiceGrpc.JVMMetricsSe
// sendToCpuMetricService(instanceId, time, metric.getCpu());
sendToMemoryMetricService(instanceId, time, metric.getMemoryList());
sendToMemoryPoolMetricService(instanceId, time, metric.getMemoryPoolList());
// sendToGCMetricService(instanceId, time, metric.getGcList());
sendToGCMetricService(instanceId, time, metric.getGcList());
});
responseObserver.onNext(Downstream.newBuilder().build());
......
......@@ -20,6 +20,8 @@ package org.apache.skywalking.apm.collector.agent.grpc.provider.handler;
import io.grpc.ManagedChannel;
import io.grpc.ManagedChannelBuilder;
import org.apache.skywalking.apm.network.proto.GC;
import org.apache.skywalking.apm.network.proto.GCPhrase;
import org.apache.skywalking.apm.network.proto.JVMMetric;
import org.apache.skywalking.apm.network.proto.JVMMetrics;
import org.apache.skywalking.apm.network.proto.JVMMetricsServiceGrpc;
......@@ -42,6 +44,7 @@ public class JVMMetricServiceHandlerTestCase {
JVMMetric.Builder metricBuilder = JVMMetric.newBuilder();
metricBuilder.setTime(System.currentTimeMillis());
buildGCMetric(metricBuilder);
buildMemoryMetric(metricBuilder);
buildMemoryPoolMetric(metricBuilder);
......@@ -71,4 +74,12 @@ public class JVMMetricServiceHandlerTestCase {
metricBuilder.addMemory(builder);
}
private static void buildGCMetric(JVMMetric.Builder metricBuilder) {
GC.Builder builder = GC.newBuilder();
builder.setPhrase(GCPhrase.NEW);
builder.setCount(2);
metricBuilder.addGc(builder);
}
}
......@@ -45,12 +45,16 @@ public class GCMetricService implements IGCMetricService {
}
@Override public void send(int instanceId, long timeBucket, int phraseValue, long count, long time) {
String metricId = instanceId + Const.ID_SPLIT + String.valueOf(phraseValue);
String id = timeBucket + Const.ID_SPLIT + metricId;
GCMetric gcMetric = new GCMetric();
gcMetric.setId(timeBucket + Const.ID_SPLIT + instanceId + Const.ID_SPLIT + String.valueOf(phraseValue));
gcMetric.setId(id);
gcMetric.setMetricId(metricId);
gcMetric.setInstanceId(instanceId);
gcMetric.setPhrase(phraseValue);
gcMetric.setCount(count);
gcMetric.setTime(time);
gcMetric.setTimes(1L);
gcMetric.setTimeBucket(timeBucket);
logger.debug("push to gc metric graph, id: {}", gcMetric.getId());
......
......@@ -36,9 +36,10 @@ public class GCDayMetricTransformNode implements NodeProcessor<GCMetric, GCMetri
@Override public void process(GCMetric gcMetric, Next<GCMetric> next) {
long timeBucket = TimeBucketUtils.INSTANCE.secondToDay(gcMetric.getTimeBucket());
gcMetric.setId(String.valueOf(timeBucket) + Const.ID_SPLIT + gcMetric.getMetricId());
gcMetric.setTimeBucket(timeBucket);
next.execute(gcMetric);
GCMetric newGCMetric = GCMetricCopy.copy(gcMetric);
newGCMetric.setId(String.valueOf(timeBucket) + Const.ID_SPLIT + gcMetric.getMetricId());
newGCMetric.setTimeBucket(timeBucket);
next.execute(newGCMetric);
}
}
......@@ -36,9 +36,10 @@ public class GCHourMetricTransformNode implements NodeProcessor<GCMetric, GCMetr
@Override public void process(GCMetric gcMetric, Next<GCMetric> next) {
long timeBucket = TimeBucketUtils.INSTANCE.secondToHour(gcMetric.getTimeBucket());
gcMetric.setId(String.valueOf(timeBucket) + Const.ID_SPLIT + gcMetric.getMetricId());
gcMetric.setTimeBucket(timeBucket);
next.execute(gcMetric);
GCMetric newGCMetric = GCMetricCopy.copy(gcMetric);
newGCMetric.setId(String.valueOf(timeBucket) + Const.ID_SPLIT + gcMetric.getMetricId());
newGCMetric.setTimeBucket(timeBucket);
next.execute(newGCMetric);
}
}
/*
* 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.gc;
import org.apache.skywalking.apm.collector.storage.table.jvm.GCMetric;
/**
* @author peng-yongsheng
*/
public class GCMetricCopy {
public static GCMetric copy(GCMetric gcMetric) {
GCMetric newGCMetric = new GCMetric();
newGCMetric.setId(gcMetric.getId());
newGCMetric.setMetricId(gcMetric.getMetricId());
newGCMetric.setInstanceId(gcMetric.getInstanceId());
newGCMetric.setPhrase(gcMetric.getPhrase());
newGCMetric.setCount(gcMetric.getCount());
newGCMetric.setTimes(gcMetric.getTimes());
newGCMetric.setTimeBucket(gcMetric.getTimeBucket());
return newGCMetric;
}
}
......@@ -36,9 +36,10 @@ public class GCMinuteMetricTransformNode implements NodeProcessor<GCMetric, GCMe
@Override public void process(GCMetric gcMetric, Next<GCMetric> next) {
long timeBucket = TimeBucketUtils.INSTANCE.secondToMinute(gcMetric.getTimeBucket());
gcMetric.setId(String.valueOf(timeBucket) + Const.ID_SPLIT + gcMetric.getMetricId());
gcMetric.setTimeBucket(timeBucket);
next.execute(gcMetric);
GCMetric newGCMetric = GCMetricCopy.copy(gcMetric);
newGCMetric.setId(String.valueOf(timeBucket) + Const.ID_SPLIT + gcMetric.getMetricId());
newGCMetric.setTimeBucket(timeBucket);
next.execute(newGCMetric);
}
}
......@@ -36,9 +36,10 @@ public class GCMonthMetricTransformNode implements NodeProcessor<GCMetric, GCMet
@Override public void process(GCMetric gcMetric, Next<GCMetric> next) {
long timeBucket = TimeBucketUtils.INSTANCE.secondToMonth(gcMetric.getTimeBucket());
gcMetric.setId(String.valueOf(timeBucket) + Const.ID_SPLIT + gcMetric.getMetricId());
gcMetric.setTimeBucket(timeBucket);
next.execute(gcMetric);
GCMetric newGCMetric = GCMetricCopy.copy(gcMetric);
newGCMetric.setId(String.valueOf(timeBucket) + Const.ID_SPLIT + gcMetric.getMetricId());
newGCMetric.setTimeBucket(timeBucket);
next.execute(newGCMetric);
}
}
......@@ -72,6 +72,10 @@ import org.apache.skywalking.apm.collector.storage.dao.cache.IInstanceCacheDAO;
import org.apache.skywalking.apm.collector.storage.dao.cache.INetworkAddressCacheDAO;
import org.apache.skywalking.apm.collector.storage.dao.cache.IServiceNameCacheDAO;
import org.apache.skywalking.apm.collector.storage.dao.cpump.ICpuSecondMetricPersistenceDAO;
import org.apache.skywalking.apm.collector.storage.dao.gcmp.IGCDayMetricPersistenceDAO;
import org.apache.skywalking.apm.collector.storage.dao.gcmp.IGCHourMetricPersistenceDAO;
import org.apache.skywalking.apm.collector.storage.dao.gcmp.IGCMinuteMetricPersistenceDAO;
import org.apache.skywalking.apm.collector.storage.dao.gcmp.IGCMonthMetricPersistenceDAO;
import org.apache.skywalking.apm.collector.storage.dao.gcmp.IGCSecondMetricPersistenceDAO;
import org.apache.skywalking.apm.collector.storage.dao.imp.IInstanceDayMetricPersistenceDAO;
import org.apache.skywalking.apm.collector.storage.dao.imp.IInstanceHourMetricPersistenceDAO;
......@@ -148,7 +152,12 @@ public class StorageModule extends Module {
private void addPersistenceDAO(List<Class> classes) {
classes.add(ICpuSecondMetricPersistenceDAO.class);
classes.add(IGCSecondMetricPersistenceDAO.class);
classes.add(IGCMinuteMetricPersistenceDAO.class);
classes.add(IGCHourMetricPersistenceDAO.class);
classes.add(IGCDayMetricPersistenceDAO.class);
classes.add(IGCMonthMetricPersistenceDAO.class);
classes.add(IMemorySecondMetricPersistenceDAO.class);
classes.add(IMemoryMinuteMetricPersistenceDAO.class);
......
......@@ -20,6 +20,7 @@ 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.StreamData;
import org.apache.skywalking.apm.collector.core.data.operator.AddOperation;
import org.apache.skywalking.apm.collector.core.data.operator.CoverOperation;
import org.apache.skywalking.apm.collector.core.data.operator.NonOperation;
......@@ -34,8 +35,8 @@ public class GCMetric extends StreamData {
};
private static final Column[] LONG_COLUMNS = {
new Column(GCMetricTable.COLUMN_COUNT, new CoverOperation()),
new Column(GCMetricTable.COLUMN_TIME, new CoverOperation()),
new Column(GCMetricTable.COLUMN_COUNT, new AddOperation()),
new Column(GCMetricTable.COLUMN_TIMES, new AddOperation()),
new Column(GCMetricTable.COLUMN_TIME_BUCKET, new CoverOperation()),
};
......@@ -78,12 +79,12 @@ public class GCMetric extends StreamData {
setDataLong(0, count);
}
public Long getTime() {
public Long getTimes() {
return getDataLong(1);
}
public void setTime(Long time) {
setDataLong(1, time);
public void setTimes(Long times) {
setDataLong(1, times);
}
public Long getTimeBucket() {
......
......@@ -16,7 +16,6 @@
*
*/
package org.apache.skywalking.apm.collector.storage.table.jvm;
import org.apache.skywalking.apm.collector.core.data.CommonTable;
......@@ -29,5 +28,5 @@ public class GCMetricTable extends CommonTable {
public static final String COLUMN_INSTANCE_ID = "instance_id";
public static final String COLUMN_PHRASE = "phrase";
public static final String COLUMN_COUNT = "count";
public static final String COLUMN_TIME = "time";
public static final String COLUMN_TIMES = "times";
}
......@@ -81,6 +81,10 @@ import org.apache.skywalking.apm.collector.storage.dao.cache.IInstanceCacheDAO;
import org.apache.skywalking.apm.collector.storage.dao.cache.INetworkAddressCacheDAO;
import org.apache.skywalking.apm.collector.storage.dao.cache.IServiceNameCacheDAO;
import org.apache.skywalking.apm.collector.storage.dao.cpump.ICpuSecondMetricPersistenceDAO;
import org.apache.skywalking.apm.collector.storage.dao.gcmp.IGCDayMetricPersistenceDAO;
import org.apache.skywalking.apm.collector.storage.dao.gcmp.IGCHourMetricPersistenceDAO;
import org.apache.skywalking.apm.collector.storage.dao.gcmp.IGCMinuteMetricPersistenceDAO;
import org.apache.skywalking.apm.collector.storage.dao.gcmp.IGCMonthMetricPersistenceDAO;
import org.apache.skywalking.apm.collector.storage.dao.gcmp.IGCSecondMetricPersistenceDAO;
import org.apache.skywalking.apm.collector.storage.dao.imp.IInstanceDayMetricPersistenceDAO;
import org.apache.skywalking.apm.collector.storage.dao.imp.IInstanceHourMetricPersistenceDAO;
......@@ -168,6 +172,10 @@ import org.apache.skywalking.apm.collector.storage.es.dao.cache.InstanceEsCacheD
import org.apache.skywalking.apm.collector.storage.es.dao.cache.NetworkAddressEsCacheDAO;
import org.apache.skywalking.apm.collector.storage.es.dao.cache.ServiceNameEsCacheDAO;
import org.apache.skywalking.apm.collector.storage.es.dao.cpump.CpuSecondMetricEsPersistenceDAO;
import org.apache.skywalking.apm.collector.storage.es.dao.gcmp.GCDayMetricEsPersistenceDAO;
import org.apache.skywalking.apm.collector.storage.es.dao.gcmp.GCHourMetricEsPersistenceDAO;
import org.apache.skywalking.apm.collector.storage.es.dao.gcmp.GCMinuteMetricEsPersistenceDAO;
import org.apache.skywalking.apm.collector.storage.es.dao.gcmp.GCMonthMetricEsPersistenceDAO;
import org.apache.skywalking.apm.collector.storage.es.dao.gcmp.GCSecondMetricEsPersistenceDAO;
import org.apache.skywalking.apm.collector.storage.es.dao.imp.InstanceDayMetricEsPersistenceDAO;
import org.apache.skywalking.apm.collector.storage.es.dao.imp.InstanceHourMetricEsPersistenceDAO;
......@@ -294,7 +302,12 @@ public class StorageModuleEsProvider extends ModuleProvider {
private void registerPersistenceDAO() throws ServiceNotProvidedException {
this.registerServiceImplementation(ICpuSecondMetricPersistenceDAO.class, new CpuSecondMetricEsPersistenceDAO(elasticSearchClient));
this.registerServiceImplementation(IGCSecondMetricPersistenceDAO.class, new GCSecondMetricEsPersistenceDAO(elasticSearchClient));
this.registerServiceImplementation(IGCMinuteMetricPersistenceDAO.class, new GCMinuteMetricEsPersistenceDAO(elasticSearchClient));
this.registerServiceImplementation(IGCHourMetricPersistenceDAO.class, new GCHourMetricEsPersistenceDAO(elasticSearchClient));
this.registerServiceImplementation(IGCDayMetricPersistenceDAO.class, new GCDayMetricEsPersistenceDAO(elasticSearchClient));
this.registerServiceImplementation(IGCMonthMetricPersistenceDAO.class, new GCMonthMetricEsPersistenceDAO(elasticSearchClient));
this.registerServiceImplementation(IMemorySecondMetricPersistenceDAO.class, new MemorySecondMetricEsPersistenceDAO(elasticSearchClient));
this.registerServiceImplementation(IMemoryMinuteMetricPersistenceDAO.class, new MemoryMinuteMetricEsPersistenceDAO(elasticSearchClient));
......
......@@ -39,7 +39,19 @@ public abstract class AbstractGCMetricEsPersistenceDAO extends AbstractPersisten
}
@Override protected final GCMetric esDataToStreamData(Map<String, Object> source) {
return null;
GCMetric gcMetric = new GCMetric();
gcMetric.setId((String)source.get(GCMetricTable.COLUMN_ID));
gcMetric.setMetricId((String)source.get(GCMetricTable.COLUMN_METRIC_ID));
gcMetric.setInstanceId(((Number)source.get(GCMetricTable.COLUMN_INSTANCE_ID)).intValue());
gcMetric.setPhrase(((Number)source.get(GCMetricTable.COLUMN_PHRASE)).intValue());
gcMetric.setCount(((Number)source.get(GCMetricTable.COLUMN_COUNT)).longValue());
gcMetric.setTimes(((Number)source.get(GCMetricTable.COLUMN_TIMES)).longValue());
gcMetric.setTimeBucket(((Number)source.get(GCMetricTable.COLUMN_TIME_BUCKET)).longValue());
return gcMetric;
}
@Override protected final Map<String, Object> esStreamDataToEsData(GCMetric streamData) {
......@@ -50,7 +62,7 @@ public abstract class AbstractGCMetricEsPersistenceDAO extends AbstractPersisten
source.put(GCMetricTable.COLUMN_INSTANCE_ID, streamData.getInstanceId());
source.put(GCMetricTable.COLUMN_PHRASE, streamData.getPhrase());
source.put(GCMetricTable.COLUMN_COUNT, streamData.getCount());
source.put(GCMetricTable.COLUMN_TIME, streamData.getTime());
source.put(GCMetricTable.COLUMN_TIMES, streamData.getTimes());
source.put(GCMetricTable.COLUMN_TIME_BUCKET, streamData.getTimeBucket());
return source;
......
......@@ -16,31 +16,28 @@
*
*/
package org.apache.skywalking.apm.collector.storage.es.define;
package org.apache.skywalking.apm.collector.storage.es.define.gc;
import org.apache.skywalking.apm.collector.storage.es.base.define.ElasticSearchColumnDefine;
import org.apache.skywalking.apm.collector.storage.table.jvm.GCMetricTable;
import org.apache.skywalking.apm.collector.storage.es.base.define.ElasticSearchTableDefine;
import org.apache.skywalking.apm.collector.storage.table.jvm.GCMetricTable;
/**
* @author peng-yongsheng
*/
public class GCMetricEsTableDefine extends ElasticSearchTableDefine {
public GCMetricEsTableDefine() {
super(GCMetricTable.TABLE);
}
public abstract class AbstractGCMetricEsTableDefine extends ElasticSearchTableDefine {
@Override public int refreshInterval() {
return 1;
public AbstractGCMetricEsTableDefine(String name) {
super(name);
}
@Override public void initialize() {
@Override public final void initialize() {
addColumn(new ElasticSearchColumnDefine(GCMetricTable.COLUMN_ID, ElasticSearchColumnDefine.Type.Keyword.name()));
addColumn(new ElasticSearchColumnDefine(GCMetricTable.COLUMN_METRIC_ID, ElasticSearchColumnDefine.Type.Keyword.name()));
addColumn(new ElasticSearchColumnDefine(GCMetricTable.COLUMN_INSTANCE_ID, ElasticSearchColumnDefine.Type.Integer.name()));
addColumn(new ElasticSearchColumnDefine(GCMetricTable.COLUMN_PHRASE, ElasticSearchColumnDefine.Type.Integer.name()));
addColumn(new ElasticSearchColumnDefine(GCMetricTable.COLUMN_COUNT, ElasticSearchColumnDefine.Type.Long.name()));
addColumn(new ElasticSearchColumnDefine(GCMetricTable.COLUMN_TIME, ElasticSearchColumnDefine.Type.Long.name()));
addColumn(new ElasticSearchColumnDefine(GCMetricTable.COLUMN_TIMES, ElasticSearchColumnDefine.Type.Long.name()));
addColumn(new ElasticSearchColumnDefine(GCMetricTable.COLUMN_TIME_BUCKET, ElasticSearchColumnDefine.Type.Long.name()));
}
}
/*
* 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.define.gc;
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.table.jvm.GCMetricTable;
/**
* @author peng-yongsheng
*/
public class GCDayMetricEsTableDefine extends AbstractGCMetricEsTableDefine {
public GCDayMetricEsTableDefine() {
super(GCMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName());
}
@Override public int refreshInterval() {
return 1;
}
}
/*
* 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.define.gc;
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.table.jvm.GCMetricTable;
/**
* @author peng-yongsheng
*/
public class GCHourMetricEsTableDefine extends AbstractGCMetricEsTableDefine {
public GCHourMetricEsTableDefine() {
super(GCMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName());
}
@Override public int refreshInterval() {
return 1;
}
}
/*
* 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.define.gc;
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.table.jvm.GCMetricTable;
/**
* @author peng-yongsheng
*/
public class GCMinuteMetricEsTableDefine extends AbstractGCMetricEsTableDefine {
public GCMinuteMetricEsTableDefine() {
super(GCMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName());
}
@Override public int refreshInterval() {
return 1;
}
}
/*
* 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.define.gc;
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.table.jvm.GCMetricTable;
/**
* @author peng-yongsheng
*/
public class GCMonthMetricEsTableDefine extends AbstractGCMetricEsTableDefine {
public GCMonthMetricEsTableDefine() {
super(GCMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName());
}
@Override public int refreshInterval() {
return 1;
}
}
/*
* 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.define.gc;
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.table.jvm.GCMetricTable;
/**
* @author peng-yongsheng
*/
public class GCSecondMetricEsTableDefine extends AbstractGCMetricEsTableDefine {
public GCSecondMetricEsTableDefine() {
super(GCMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Second.getName());
}
@Override public int refreshInterval() {
return 1;
}
}
......@@ -75,4 +75,10 @@ org.apache.skywalking.apm.collector.storage.es.define.memory.MemorySecondMetricE
org.apache.skywalking.apm.collector.storage.es.define.memory.MemoryMinuteMetricEsTableDefine
org.apache.skywalking.apm.collector.storage.es.define.memory.MemoryHourMetricEsTableDefine
org.apache.skywalking.apm.collector.storage.es.define.memory.MemoryDayMetricEsTableDefine
org.apache.skywalking.apm.collector.storage.es.define.memory.MemoryMonthMetricEsTableDefine
\ No newline at end of file
org.apache.skywalking.apm.collector.storage.es.define.memory.MemoryMonthMetricEsTableDefine
org.apache.skywalking.apm.collector.storage.es.define.gc.GCSecondMetricEsTableDefine
org.apache.skywalking.apm.collector.storage.es.define.gc.GCMinuteMetricEsTableDefine
org.apache.skywalking.apm.collector.storage.es.define.gc.GCHourMetricEsTableDefine
org.apache.skywalking.apm.collector.storage.es.define.gc.GCDayMetricEsTableDefine
org.apache.skywalking.apm.collector.storage.es.define.gc.GCMonthMetricEsTableDefine
\ No newline at end of file
......@@ -49,7 +49,6 @@ public class GCSecondMetricH2PersistenceDAO extends H2DAO implements IGCSecondMe
source.put(GCMetricTable.COLUMN_INSTANCE_ID, data.getInstanceId());
source.put(GCMetricTable.COLUMN_PHRASE, data.getPhrase());
source.put(GCMetricTable.COLUMN_COUNT, data.getCount());
source.put(GCMetricTable.COLUMN_TIME, data.getTime());
source.put(GCMetricTable.COLUMN_TIME_BUCKET, data.getTimeBucket());
String sql = SqlBuilder.buildBatchInsertSql(GCMetricTable.TABLE, source.keySet());
......
......@@ -37,7 +37,7 @@ public class GCMetricH2TableDefine extends H2TableDefine {
addColumn(new H2ColumnDefine(GCMetricTable.COLUMN_INSTANCE_ID, H2ColumnDefine.Type.Int.name()));
addColumn(new H2ColumnDefine(GCMetricTable.COLUMN_PHRASE, H2ColumnDefine.Type.Int.name()));
addColumn(new H2ColumnDefine(GCMetricTable.COLUMN_COUNT, H2ColumnDefine.Type.Bigint.name()));
addColumn(new H2ColumnDefine(GCMetricTable.COLUMN_TIME, H2ColumnDefine.Type.Bigint.name()));
addColumn(new H2ColumnDefine(GCMetricTable.COLUMN_TIMES, H2ColumnDefine.Type.Bigint.name()));
addColumn(new H2ColumnDefine(GCMetricTable.COLUMN_TIME_BUCKET, H2ColumnDefine.Type.Bigint.name()));
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册