Fix inconsistent virtual cache describe between code and scope definitions doc (#9663)
This commit is contained in:
parent
f7812c6961
commit
4e73a30d6f
|
|
@ -315,7 +315,7 @@ This calculates the metrics data from each request of cache system.
|
|||
| cacheTypeId | The ID of the component used in this call. | | int |
|
||||
| latency | The time taken by each request. | | int(in ms)|
|
||||
| status | Indicates the success or failure of the request.| | boolean |
|
||||
| op | Indicates this access is used for `write` or `read` | | string |
|
||||
| operation | Indicates this access is used for `write` or `read` | | string |
|
||||
|
||||
|
||||
### SCOPE `CacheSlowAccess`
|
||||
|
|
@ -330,4 +330,4 @@ This calculates the metrics data from slow request of cache system , which is us
|
|||
| latency | The time taken by each request. | | int(in ms)|
|
||||
| traceId | The traceId of this slow access| | string|
|
||||
| status | Indicates the success or failure of the request.| | boolean |
|
||||
| op | Indicates this access is used for `write` or `read` | | string |
|
||||
| operation | Indicates this access is used for `write` or `read` | | string |
|
||||
|
|
@ -37,9 +37,9 @@ import org.apache.skywalking.oap.server.core.analysis.TimeBucket;
|
|||
import org.apache.skywalking.oap.server.core.config.NamingControl;
|
||||
import org.apache.skywalking.oap.server.core.source.ServiceMeta;
|
||||
import org.apache.skywalking.oap.server.core.source.Source;
|
||||
import org.apache.skywalking.oap.server.core.source.VirtualCacheAccess;
|
||||
import org.apache.skywalking.oap.server.core.source.CacheAccess;
|
||||
import org.apache.skywalking.oap.server.core.source.VirtualCacheOperation;
|
||||
import org.apache.skywalking.oap.server.core.source.VirtualCacheSlowAccess;
|
||||
import org.apache.skywalking.oap.server.core.source.CacheSlowAccess;
|
||||
import org.apache.skywalking.oap.server.library.util.StringUtil;
|
||||
|
||||
@Slf4j
|
||||
|
|
@ -80,7 +80,7 @@ public class VirtualCacheProcessor implements VirtualServiceProcessor {
|
|||
.getThreshold(cacheType))
|
||||
|| (op == VirtualCacheOperation.Read && latency > config.getCacheReadLatencyThresholdsAndWatcher()
|
||||
.getThreshold(cacheType))) {
|
||||
VirtualCacheSlowAccess slowAccess = new VirtualCacheSlowAccess();
|
||||
CacheSlowAccess slowAccess = new CacheSlowAccess();
|
||||
slowAccess.setCacheServiceId(IDManager.ServiceID.buildId(serviceName, false));
|
||||
slowAccess.setLatency(latency);
|
||||
slowAccess.setId(segmentObject.getTraceSegmentId() + "-" + span.getSpanId());
|
||||
|
|
@ -92,7 +92,7 @@ public class VirtualCacheProcessor implements VirtualServiceProcessor {
|
|||
slowAccess.setOperation(op);
|
||||
sourceList.add(slowAccess);
|
||||
}
|
||||
VirtualCacheAccess access = new VirtualCacheAccess();
|
||||
CacheAccess access = new CacheAccess();
|
||||
access.setCacheTypeId(span.getComponentId());
|
||||
access.setLatency(latency);
|
||||
access.setName(serviceName);
|
||||
|
|
|
|||
|
|
@ -36,9 +36,9 @@ import org.apache.skywalking.oap.server.core.config.NamingControl;
|
|||
import org.apache.skywalking.oap.server.core.config.group.EndpointNameGrouping;
|
||||
import org.apache.skywalking.oap.server.core.source.ServiceMeta;
|
||||
import org.apache.skywalking.oap.server.core.source.Source;
|
||||
import org.apache.skywalking.oap.server.core.source.VirtualCacheAccess;
|
||||
import org.apache.skywalking.oap.server.core.source.CacheAccess;
|
||||
import org.apache.skywalking.oap.server.core.source.VirtualCacheOperation;
|
||||
import org.apache.skywalking.oap.server.core.source.VirtualCacheSlowAccess;
|
||||
import org.apache.skywalking.oap.server.core.source.CacheSlowAccess;
|
||||
import org.joda.time.DateTime;
|
||||
import org.joda.time.format.DateTimeFormat;
|
||||
import org.junit.Assert;
|
||||
|
|
@ -81,7 +81,7 @@ public class VirtualCacheProcessorTest {
|
|||
Assert.assertEquals(202209121413L, serviceMeta.getTimeBucket());
|
||||
Assert.assertEquals(Layer.VIRTUAL_CACHE, serviceMeta.getLayer());
|
||||
|
||||
VirtualCacheSlowAccess slowAccess = (VirtualCacheSlowAccess) sources.get(1);
|
||||
CacheSlowAccess slowAccess = (CacheSlowAccess) sources.get(1);
|
||||
Assert.assertEquals("MTI3LjAuMC4xOjYzNzk=.0", slowAccess.getCacheServiceId());
|
||||
Assert.assertEquals(1000, slowAccess.getLatency());
|
||||
Assert.assertEquals(20220912141312L, slowAccess.getTimeBucket());
|
||||
|
|
@ -90,7 +90,7 @@ public class VirtualCacheProcessorTest {
|
|||
Assert.assertNotNull(slowAccess.getCommand());
|
||||
Assert.assertNotNull(slowAccess.getKey());
|
||||
|
||||
VirtualCacheAccess cacheAccess = (VirtualCacheAccess) sources.get(2);
|
||||
CacheAccess cacheAccess = (CacheAccess) sources.get(2);
|
||||
Assert.assertEquals("127.0.0.1:6379", cacheAccess.getName());
|
||||
Assert.assertEquals(1000, cacheAccess.getLatency());
|
||||
Assert.assertEquals(202209121413L, cacheAccess.getTimeBucket());
|
||||
|
|
@ -121,7 +121,7 @@ public class VirtualCacheProcessorTest {
|
|||
Assert.assertEquals(202209121413L, serviceMeta.getTimeBucket());
|
||||
Assert.assertEquals(Layer.VIRTUAL_CACHE, serviceMeta.getLayer());
|
||||
|
||||
VirtualCacheAccess cacheAccess = (VirtualCacheAccess) sources.get(1);
|
||||
CacheAccess cacheAccess = (CacheAccess) sources.get(1);
|
||||
Assert.assertEquals("127.0.0.1:6379", cacheAccess.getName());
|
||||
Assert.assertEquals(3, cacheAccess.getLatency());
|
||||
Assert.assertEquals(202209121413L, cacheAccess.getTimeBucket());
|
||||
|
|
@ -150,7 +150,7 @@ public class VirtualCacheProcessorTest {
|
|||
Assert.assertEquals(202209121413L, serviceMeta.getTimeBucket());
|
||||
Assert.assertEquals(Layer.VIRTUAL_CACHE, serviceMeta.getLayer());
|
||||
|
||||
VirtualCacheSlowAccess slowAccess = (VirtualCacheSlowAccess) sources.get(1);
|
||||
CacheSlowAccess slowAccess = (CacheSlowAccess) sources.get(1);
|
||||
Assert.assertEquals("cmVkaXMtbG9jYWw=.0", slowAccess.getCacheServiceId());
|
||||
Assert.assertEquals(1000, slowAccess.getLatency());
|
||||
Assert.assertEquals(20220912141312L, slowAccess.getTimeBucket());
|
||||
|
|
@ -159,7 +159,7 @@ public class VirtualCacheProcessorTest {
|
|||
Assert.assertNotNull(slowAccess.getCommand());
|
||||
Assert.assertNotNull(slowAccess.getKey());
|
||||
|
||||
VirtualCacheAccess cacheAccess = (VirtualCacheAccess) sources.get(2);
|
||||
CacheAccess cacheAccess = (CacheAccess) sources.get(2);
|
||||
Assert.assertEquals("redis-local", cacheAccess.getName());
|
||||
Assert.assertEquals(1000, cacheAccess.getLatency());
|
||||
Assert.assertEquals(202209121413L, cacheAccess.getTimeBucket());
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ SRC_SERVICE_INSTANCE_CLR_GC: 'ServiceInstanceCLRGC';
|
|||
SRC_SERVICE_INSTANCE_CLR_THREAD: 'ServiceInstanceCLRThread';
|
||||
SRC_ENVOY_INSTANCE_METRIC: 'EnvoyInstanceMetric';
|
||||
SRC_EVENT: 'Event';
|
||||
SRC_CACHE_ACCESS: 'VirtualCacheAccess';
|
||||
SRC_CACHE_ACCESS: 'CacheAccess';
|
||||
|
||||
|
||||
// Browser keywords
|
||||
|
|
|
|||
|
|
@ -21,12 +21,12 @@ package org.apache.skywalking.oap.server.core.analysis.manual.cache;
|
|||
import org.apache.skywalking.oap.server.core.analysis.SourceDispatcher;
|
||||
import org.apache.skywalking.oap.server.core.analysis.worker.TopNStreamProcessor;
|
||||
import org.apache.skywalking.oap.server.core.source.VirtualCacheOperation;
|
||||
import org.apache.skywalking.oap.server.core.source.VirtualCacheSlowAccess;
|
||||
import org.apache.skywalking.oap.server.core.source.CacheSlowAccess;
|
||||
|
||||
public class CacheSlowAccessDispatcher implements SourceDispatcher<VirtualCacheSlowAccess> {
|
||||
public class CacheSlowAccessDispatcher implements SourceDispatcher<CacheSlowAccess> {
|
||||
|
||||
@Override
|
||||
public void dispatch(VirtualCacheSlowAccess source) {
|
||||
public void dispatch(CacheSlowAccess source) {
|
||||
// There are only two kinds of Operation : write or read .Refer VirtualCacheProcessor#prepareVSIfNecessary
|
||||
if (source.getOperation() == VirtualCacheOperation.Read) {
|
||||
TopNCacheReadCommand readCommand = new TopNCacheReadCommand();
|
||||
|
|
|
|||
|
|
@ -25,9 +25,9 @@ import org.apache.skywalking.oap.server.core.analysis.IDManager;
|
|||
import static org.apache.skywalking.oap.server.core.source.DefaultScopeDefine.CACHE_ACCESS;
|
||||
import static org.apache.skywalking.oap.server.core.source.DefaultScopeDefine.SERVICE_CATALOG_NAME;
|
||||
|
||||
@ScopeDeclaration(id = CACHE_ACCESS, name = "VirtualCacheAccess", catalog = SERVICE_CATALOG_NAME)
|
||||
@ScopeDeclaration(id = CACHE_ACCESS, name = "CacheAccess", catalog = SERVICE_CATALOG_NAME)
|
||||
@ScopeDefaultColumn.VirtualColumnDefinition(fieldName = "entityId", columnName = "entity_id", isID = true, type = String.class)
|
||||
public class VirtualCacheAccess extends Source {
|
||||
public class CacheAccess extends Source {
|
||||
|
||||
@Override
|
||||
public int scope() {
|
||||
|
|
@ -26,7 +26,7 @@ import static org.apache.skywalking.oap.server.core.source.DefaultScopeDefine.CA
|
|||
import static org.apache.skywalking.oap.server.core.source.DefaultScopeDefine.SERVICE_CATALOG_NAME;
|
||||
|
||||
@ScopeDeclaration(id = CACHE_SLOW_ACCESS, name = "VirtualCacheSlowAccess", catalog = SERVICE_CATALOG_NAME)
|
||||
public class VirtualCacheSlowAccess extends Source {
|
||||
public class CacheSlowAccess extends Source {
|
||||
@Getter
|
||||
@Setter
|
||||
private String id;
|
||||
|
|
@ -72,17 +72,17 @@ database_access_sla = from(DatabaseAccess.*).percent(status == true);
|
|||
database_access_cpm = from(DatabaseAccess.*).cpm();
|
||||
database_access_percentile = from(DatabaseAccess.latency).percentile(10);
|
||||
|
||||
cache_read_resp_time = from(VirtualCacheAccess.latency).filter(operation == VirtualCacheOperation.Read).longAvg();
|
||||
cache_read_sla = from(VirtualCacheAccess.*).filter(operation == VirtualCacheOperation.Read).percent(status == true);
|
||||
cache_read_cpm = from(VirtualCacheAccess.*).filter(operation == VirtualCacheOperation.Read).cpm();
|
||||
cache_read_percentile = from(VirtualCacheAccess.latency).filter(operation == VirtualCacheOperation.Read).percentile(10);
|
||||
cache_read_resp_time = from(CacheAccess.latency).filter(operation == VirtualCacheOperation.Read).longAvg();
|
||||
cache_read_sla = from(CacheAccess.*).filter(operation == VirtualCacheOperation.Read).percent(status == true);
|
||||
cache_read_cpm = from(CacheAccess.*).filter(operation == VirtualCacheOperation.Read).cpm();
|
||||
cache_read_percentile = from(CacheAccess.latency).filter(operation == VirtualCacheOperation.Read).percentile(10);
|
||||
|
||||
cache_write_resp_time = from(VirtualCacheAccess.latency).filter(operation == VirtualCacheOperation.Write).longAvg();
|
||||
cache_write_sla = from(VirtualCacheAccess.*).filter(operation == VirtualCacheOperation.Write).percent(status == true);
|
||||
cache_write_cpm = from(VirtualCacheAccess.*).filter(operation == VirtualCacheOperation.Write).cpm();
|
||||
cache_write_percentile = from(VirtualCacheAccess.latency).filter(operation == VirtualCacheOperation.Write).percentile(10);
|
||||
cache_write_resp_time = from(CacheAccess.latency).filter(operation == VirtualCacheOperation.Write).longAvg();
|
||||
cache_write_sla = from(CacheAccess.*).filter(operation == VirtualCacheOperation.Write).percent(status == true);
|
||||
cache_write_cpm = from(CacheAccess.*).filter(operation == VirtualCacheOperation.Write).cpm();
|
||||
cache_write_percentile = from(CacheAccess.latency).filter(operation == VirtualCacheOperation.Write).percentile(10);
|
||||
|
||||
cache_access_resp_time = from(VirtualCacheAccess.latency).longAvg();
|
||||
cache_access_sla = from(VirtualCacheAccess.*).percent(status == true);
|
||||
cache_access_cpm = from(VirtualCacheAccess.*).cpm();
|
||||
cache_access_percentile = from(VirtualCacheAccess.latency).percentile(10);
|
||||
cache_access_resp_time = from(CacheAccess.latency).longAvg();
|
||||
cache_access_sla = from(CacheAccess.*).percent(status == true);
|
||||
cache_access_cpm = from(CacheAccess.*).cpm();
|
||||
cache_access_percentile = from(CacheAccess.latency).percentile(10);
|
||||
Loading…
Reference in New Issue