https://skyapm.github.io/document-cn-translation-of-skywalking/zh/6.2.0/concepts-and-designs/scope-definitions.html

定义了上面的字段之后,为了计算数据,skywalking定义了一种OAL脚本来进行聚合运算

https://skyapm.github.io/document-cn-translation-of-skywalking/zh/6.2.0/concepts-and-designs/oal.html

skywalking的所有的oal定义在文件official_analysis.oal中

文件的内容如下

// All scope metrics
all_p99 = from(All.latency).p99(10);
all_p95 = from(All.latency).p95(10);
all_p90 = from(All.latency).p90(10);
all_p75 = from(All.latency).p75(10);
all_p50 = from(All.latency).p50(10);
all_heatmap = from(All.latency).thermodynamic(100, 20); // Service scope metrics
service_resp_time = from(Service.latency).longAvg();
service_sla = from(Service.*).percent(status == true);
service_cpm = from(Service.*).cpm();
service_p99 = from(Service.latency).p99(10);
service_p95 = from(Service.latency).p95(10);
service_p90 = from(Service.latency).p90(10);
service_p75 = from(Service.latency).p75(10);
service_p50 = from(Service.latency).p50(10); // Service relation scope metrics for topology
service_relation_client_cpm = from(ServiceRelation.*).filter(detectPoint == DetectPoint.CLIENT).cpm();
service_relation_server_cpm = from(ServiceRelation.*).filter(detectPoint == DetectPoint.SERVER).cpm();
service_relation_client_call_sla = from(ServiceRelation.*).filter(detectPoint == DetectPoint.CLIENT).percent(status == true);
service_relation_server_call_sla = from(ServiceRelation.*).filter(detectPoint == DetectPoint.SERVER).percent(status == true);
service_relation_client_resp_time = from(ServiceRelation.latency).filter(detectPoint == DetectPoint.CLIENT).longAvg();
service_relation_server_resp_time = from(ServiceRelation.latency).filter(detectPoint == DetectPoint.SERVER).longAvg();
service_relation_client_p99 = from(ServiceRelation.latency).filter(detectPoint == DetectPoint.CLIENT).p99(10);
service_relation_server_p99 = from(ServiceRelation.latency).filter(detectPoint == DetectPoint.SERVER).p99(10);
service_relation_client_p95 = from(ServiceRelation.latency).filter(detectPoint == DetectPoint.CLIENT).p95(10);
service_relation_server_p95 = from(ServiceRelation.latency).filter(detectPoint == DetectPoint.SERVER).p95(10);
service_relation_client_p90 = from(ServiceRelation.latency).filter(detectPoint == DetectPoint.CLIENT).p90(10);
service_relation_server_p90 = from(ServiceRelation.latency).filter(detectPoint == DetectPoint.SERVER).p90(10);
service_relation_client_p75 = from(ServiceRelation.latency).filter(detectPoint == DetectPoint.CLIENT).p75(10);
service_relation_server_p75 = from(ServiceRelation.latency).filter(detectPoint == DetectPoint.SERVER).p75(10);
service_relation_client_p50 = from(ServiceRelation.latency).filter(detectPoint == DetectPoint.CLIENT).p50(10);
service_relation_server_p50 = from(ServiceRelation.latency).filter(detectPoint == DetectPoint.SERVER).p50(10); // Service Instance Scope metrics
service_instance_sla = from(ServiceInstance.*).percent(status == true);
service_instance_resp_time= from(ServiceInstance.latency).longAvg();
service_instance_cpm = from(ServiceInstance.*).cpm(); // Endpoint scope metrics
endpoint_cpm = from(Endpoint.*).cpm();
endpoint_avg = from(Endpoint.latency).longAvg();
endpoint_sla = from(Endpoint.*).percent(status == true);
endpoint_p99 = from(Endpoint.latency).p99(10);
endpoint_p95 = from(Endpoint.latency).p95(10);
endpoint_p90 = from(Endpoint.latency).p90(10);
endpoint_p75 = from(Endpoint.latency).p75(10);
endpoint_p50 = from(Endpoint.latency).p50(10); // Endpoint relation scope metrics
endpoint_relation_cpm = from(EndpointRelation.*).filter(detectPoint == DetectPoint.SERVER).cpm();
endpoint_relation_resp_time = from(EndpointRelation.rpcLatency).filter(detectPoint == DetectPoint.SERVER).longAvg(); // JVM instance metrics
instance_jvm_cpu = from(ServiceInstanceJVMCPU.usePercent).doubleAvg();
instance_jvm_memory_heap = from(ServiceInstanceJVMMemory.used).filter(heapStatus == true).longAvg();
instance_jvm_memory_noheap = from(ServiceInstanceJVMMemory.used).filter(heapStatus == false).longAvg();
instance_jvm_memory_heap_max = from(ServiceInstanceJVMMemory.max).filter(heapStatus == true).longAvg();
instance_jvm_memory_noheap_max = from(ServiceInstanceJVMMemory.max).filter(heapStatus == false).longAvg();
instance_jvm_young_gc_time = from(ServiceInstanceJVMGC.time).filter(phrase == GCPhrase.NEW).sum();
instance_jvm_old_gc_time = from(ServiceInstanceJVMGC.time).filter(phrase == GCPhrase.OLD).sum();
instance_jvm_young_gc_count = from(ServiceInstanceJVMGC.count).filter(phrase == GCPhrase.NEW).sum();
instance_jvm_old_gc_count = from(ServiceInstanceJVMGC.count).filter(phrase == GCPhrase.OLD).sum(); database_access_resp_time = from(DatabaseAccess.latency).longAvg();
database_access_sla = from(DatabaseAccess.*).percent(status == true);
database_access_cpm = from(DatabaseAccess.*).cpm();
database_access_p99 = from(DatabaseAccess.latency).p99(10);
database_access_p95 = from(DatabaseAccess.latency).p95(10);
database_access_p90 = from(DatabaseAccess.latency).p90(10);
database_access_p75 = from(DatabaseAccess.latency).p75(10);
database_access_p50 = from(DatabaseAccess.latency).p50(10); // CLR instance metrics
instance_clr_cpu = from(ServiceInstanceCLRCPU.usePercent).doubleAvg();
instance_clr_gen0_collect_count = from(ServiceInstanceCLRGC.gen0CollectCount).sum();
instance_clr_gen1_collect_count = from(ServiceInstanceCLRGC.gen1CollectCount).sum();
instance_clr_gen2_collect_count = from(ServiceInstanceCLRGC.gen2CollectCount).sum();
instance_clr_heap_memory = from(ServiceInstanceCLRGC.heapMemory).longAvg();
instance_clr_available_completion_port_threads = from(ServiceInstanceCLRThread.availableCompletionPortThreads).max();
instance_clr_available_worker_threads = from(ServiceInstanceCLRThread.availableWorkerThreads).max();
instance_clr_max_completion_port_threads = from(ServiceInstanceCLRThread.maxCompletionPortThreads).max();
instance_clr_max_worker_threads = from(ServiceInstanceCLRThread.maxWorkerThreads).max(); // Envoy instance metrics
envoy_heap_memory_max_used = from(EnvoyInstanceMetric.value).filter(metricName == "server.memory_heap_size").maxDouble();
envoy_total_connections_used = from(EnvoyInstanceMetric.value).filter(metricName == "server.total_connections").maxDouble();
envoy_parent_connections_used = from(EnvoyInstanceMetric.value).filter(metricName == "server.parent_connections").maxDouble(); // Disable unnecessary hard core sources
/////////
// disable(segment);
// disable(endpoint_relation_server_side);
// disable(top_n_database_statement);
// disable(zipkin_span);
// disable(jaeger_span);

定义的指标值如下

全局指标

all_p99, 所有服务响应时间的 p99 值
all_p95
all_p90
all_p75
all_p70
all_heatmap, 所有服务响应时间的热点图
服务指标 service_resp_time, 服务的平均响应时间
service_sla, 服务的成功率
service_cpm, 服务每分钟调用次数
service_p99, 服务响应时间的 p99 值
service_p95
service_p90
service_p75
service_p50
服务实例指标 service_instance_sla, 服务实例的成功率
service_instance_resp_time, 服务实例的平均响应时间
service_instance_cpm, 服务实例每分钟调用次数
端点指标 endpoint_cpm, 端点每分钟调用次数
endpoint_avg, 端点平均响应时间
endpoint_sla, 端点成功率
endpoint_p99, 端点响应时间的 p99 值
endpoint_p95
endpoint_p90
endpoint_p75
endpoint_p50
JVM 指标, JVM 相关的指标, 只有当 javaagent 启用时才有效 instance_jvm_cpu
instance_jvm_memory_heap
instance_jvm_memory_noheap
instance_jvm_memory_heap_max
instance_jvm_memory_noheap_max
instance_jvm_young_gc_time
instance_jvm_old_gc_time
instance_jvm_young_gc_count
instance_jvm_old_gc_count
服务关系指标, 代表服务之间调用的指标 指标的 ID 只能在拓扑图查询中获取 service_relation_client_cpm, 在客户端每分钟检测到的调用次数
service_relation_server_cpm, 在服务端每分钟检测到的调用次数
service_relation_client_call_sla, 在客户端检测到的成功率
service_relation_server_call_sla, 在服务端检测到的成功率
service_relation_client_resp_time, 在客户端检测到的平均响应时间
service_relation_server_resp_time, 在服务端检测到的平均响应时间
端点关系指标, 代表相互依赖的端点之间的指标. 只有在追踪代理启用时有效. 指标 ID 只能在拓扑查询中获得. endpoint_relation_cpm
endpoint_relation_resp_time

我们来看看skywalking中页面框图的意思

上面对于的计算指标是

首先看latency表示的意思是服务下每个请求的耗时

all_p99 = from(All.latency).p99(10);all表示所有的服务,服务就是应用的意思当前系统下面有三个应用,三个应用下面一共存在1000次请求,这里指的就是所有1000次请求中99%的请求响应时间都是在某个范围内

global Top Throughput中表示当前所有的应用中的方法中,那个请求的数量最多

global Top slow Endpoint表示当前所有应用下面的那个请求最耗时

这里的Global  heatmap实际上调用的是

当前的请求在热力图上的分布情况,每一次请求在热力图上面对应一个点

表示当前应用下的全部请求耗时在20毫秒和100毫秒

https://skyapm.github.io/document-cn-translation-of-skywalking/zh/6.2.0/concepts-and-designs/oal.html

https://skyapm.github.io/document-cn-translation-of-skywalking/zh/6.2.0/concepts-and-designs/scope-definitions.html

service_resp_time = from(Service.latency).longAvg();

表示当前应用下每个请求的耗时的平均值,所以存在不准的情况,应该不应该把当前应用向注册中心那个请求时间算在内,这里要注意

service_sla = from(Service.*).percent(status == true);

表示当前应用下sla:请求的成功率是多少

上面表表示应用spring-user在20点34分到21点04分这半个小时内,应用这段时间内每分钟的请求数目是1.33次,这个1.33次是如何算出来的了

     

应用在20点43分,发送了一次请求,在20点44分发送了一次请求,在20点45分发生了2次请求,所有20点43 20点44分 20点45分,三分钟之内发送了4请请求,每一分钟的平均请求时间为4除以3等于1.33.,这里要注意虽然选择的查询时间从20点11到21点11一共30分钟,这里面大部分时间没有请求产生,平均请求次数不能是4/30,而是统计真正发送请求的时间

对于的信息在数据库的表service_cpm中可以看到,entity_id表示当前应用的编号,3对于的就是spring-user应用,service_cpm记录的是当前一个小时之内应用的访问数据

如果当前应用选择查询的时间超过一个小时,选择最近一天,如下图所示,我们看到cpm为0,因为查询的是

我们可以看到选择最近一天查询的时间间隔是小时,查询的是service_cpm_hour这张表

从上面分析我们已经知道应用在20点43分,发送了一次请求,在20点44分发送了一次请求,在20点45分发生了2次请求,所有20点43 20点44分 20点45分,所以在20 内发送了4次请求,所有表中service_cpm_hour对于的2020010420这个时间点的值是4,页面上从1月3号21点到1月4号21点内没有任何请求,所以cpm为0

同理,选择最近一周,查询的是service_cpm_day这张表

在表service_cpm_day中时间是按照天进行统计的,在20200104 在1月4号这天发生了4次请求

同理应用的平均响应时间类似,这里为啥是74264.67ms了

应用在20点43分的这一分钟内发送了请求应用的平均响应时间123851,在20点44分应用在这一分钟内发生了请求对于的平均响应时间是76455,在20点45分发生了请求对于的平均响应时间是22488,所以在20点00到21点这段时间内,只有3分钟内发送了请求,其余时间没有发送请求,平均响应时间为(123851+76455+22488)/3=74264.67ms

应用的平均响应时间,是依据应用下的每个应用的实例响应时间计算出来的,查询的表如下

应用下面的p99 p50如下,查询的是service_p50相关的表

表示当前应用下面那个请求最慢,当前应用存在哪些实例

对于方法的操作

首先要选择那个应用,然后选择该应用下对于的端点

调用的统计信息为

// Endpoint scope metrics
endpoint_cpm = from(Endpoint.*).cpm();
endpoint_avg = from(Endpoint.latency).longAvg();
endpoint_sla = from(Endpoint.*).percent(status == true);
endpoint_p99 = from(Endpoint.latency).p99(10);
endpoint_p95 = from(Endpoint.latency).p95(10);
endpoint_p90 = from(Endpoint.latency).p90(10);
endpoint_p75 = from(Endpoint.latency).p75(10);
endpoint_p50 = from(Endpoint.latency).p50(10);

表示该端点对于的平均响应时间,平均请求信息,平均每分钟的请求数目灯

表示应用spring-user的方法/user/5在20点45分,这一分钟内的平均响应时间是25577毫秒

这里表示的是应用spring-user的方法/user/5在20点32分到21点02分内,方法的平均响应时间是74714毫秒

skywalking中表字段的信息的更多相关文章

  1. net发布的dll方法和类显示注释信息(字段说明信息)[图解]

    自己发布的dll添加的另一个项目中突然没有字段说明信息了,给使用带来了很多的不便,原因是为了跨项目引用,所以导致不显示注释信息的,一下是解决这个问题的方法. 在要发布(被引用)的项目上右键 => ...

  2. crmsql句子的实体关系实体字段的信息窗口

    在crm里面怎样用sql语句查询这些信息? 查询实体信息: --查询实体信息,实体名称:account select * from MetadataSchema.Entity where name= ...

  3. mysql alter 用法,修改表,字段等信息

    一: 修改表信息 1.修改表名 alter table test_a rename to sys_app; 2.修改表注释 alter table sys_application comment '系 ...

  4. sqlserver 获取数据库、表和字段相关信息

    --获取指定服务器上的所有数据库 SELECT Name FROM Master..SysDatabases ORDER BY Name --获取指定数据库下所有表 SELECT Name FROM ...

  5. salesforce lightning零基础学习(十六) 公用组件之 获取字段label信息

    我们做的项目好多都是多语言的项目,针对不同国家需要展示不同的语言的标题.我们在classic中的VF page可谓是得心应手,因为系统中已经封装好了我们可以直接在VF获取label/api name等 ...

  6. 查找SQL数据表或视图中的字段属性信息

    一.只支持表,非常牛逼的 SELECT a.name,(case when (SELECT count(*) FROM sysobjects WHERE (name in (SELECT name F ...

  7. Golang中Struct与DB中表字段通过反射自动映射 - sqlmapper

    Golang中操作数据库已经有现成的库"database/sql"可以用,但是"database/sql"只提供了最基础的操作接口: 对数据库中一张表的增删改查 ...

  8. 修改SQL数据库中表字段类型时,报“一个或多个对象访问此列”错误的解决方法

    在SQL数据库中使用SQL语句(格式:alter table [tablename] alter column [colname] [newDataType])修改某表的字段类型时,报一下错误:由于一 ...

  9. Oracle中表字段相关操作举例

    --创建测试表 create or replace table student ( xh ), --学号 xm ), --姓名 sex ), --性别 birthday date, --日期 sal ...

随机推荐

  1. [Firefox附加组件]0003.弹出对话框

    Firefox中使用面板(panel)模块来显示弹出对话框,面板的内容通过HTML编写.你可以在面板上运行content script,尽管在面板里的脚本无法直接访问插件代码,但是你可以在面板脚本和插 ...

  2. SSIS 数据类型 第二篇:变量的数据类型

    变量(Variable)用于存储在Package运行时用到的值,集成服务支持两种类型的变量:用户自定义的变量和系统变量,自定义的变量由用户来定义,系统变量由集成服务来定义. 变量的用途十分广泛,用于容 ...

  3. AD17无法复制原理图到Word的解决方法

    标题: 解决AD17无法复制原理图到WORD 作者: 梦幻之心星 347369787@QQ.com 标签: [AD, Word, 原理图] 目录: 软件 日期: 2019-3-17 目录 前提说明: ...

  4. MySQL 可重复读,差点就我背上了一个 P0 事故!

    小黑黑的碎碎念 哎,最近有点忙,备考复习不利,明天还要搬家,好难啊!! 本想着这周鸽了,但是想想还是不行,爬起来,更新一下,周更可不能断.偷懒一下,修改一下之前的一篇历史文章,重新发布一下. P0 事 ...

  5. Rocket - tilelink - Broadcast

    https://mp.weixin.qq.com/s/-pjCLzzincJz0Z66orx8kg   介绍Broadcast的实现.   ​​   1. 基本介绍   TLBroadcast实现的是 ...

  6. 【Linux】将javaweb项目部署到CentOS的tomcat上

    1.将项目打包成war包 build之后war文件就生成了. 2.拷贝war文件到CentOS的tomcat的项目文件夹中 用WinSCP将文件粘帖进这个文件夹中 /wocloud/tomcat_cl ...

  7. Java实现 LeetCode 650 只有两个键的键盘(递归 || 数学)

    650. 只有两个键的键盘 最初在一个记事本上只有一个字符 'A'.你每次可以对这个记事本进行两种操作: Copy All (复制全部) : 你可以复制这个记事本中的所有字符(部分的复制是不允许的). ...

  8. Java实现 蓝桥杯 算法提高 周期字串

    算法提高 周期字串 时间限制:1.0s 内存限制:256.0MB 问题描述 右右喜欢听故事,但是右右的妈妈总是讲一些"从前有座山,山里有座庙,庙里有个老和尚给小和尚讲故事,讲的什么呢?从前有 ...

  9. Java实现 蓝桥杯VIP 算法提高 陶陶摘苹果2

    算法提高 陶陶摘苹果2 时间限制:1.0s 内存限制:256.0MB 问题描述 陶陶家的院子里有一棵苹果树,每到秋天树上就会结出n个苹果.苹果成熟的时候,陶陶就会跑去摘苹果.陶陶有个30厘米高的板凳, ...

  10. Java实现 LeetCode 37 解数独

    37. 解数独 编写一个程序,通过已填充的空格来解决数独问题. 一个数独的解法需遵循如下规则: 数字 1-9 在每一行只能出现一次. 数字 1-9 在每一列只能出现一次. 数字 1-9 在每一个以粗实 ...